@@ -174,16 +174,25 @@ QtVtkViewPointToolButton::QtVtkViewPointToolButton (QWidget* parent, const std::
174
174
_renderer->Register (0 );
175
175
176
176
QMenu* menu = new QMenu (this );
177
+ menu->setToolTipsVisible (true );
177
178
QAction* action = new QAction (" Appliquer" , this );
179
+ action->setToolTip (QSTR (" Applique le paramétrage du point de vue à la vue courante." ));
178
180
connect (action, SIGNAL (triggered ( )), this , SLOT (applyViewPointCallback ( )));
179
181
menu->addAction (action);
182
+ action = new QAction (" Réinitialiser" , this );
183
+ connect (action, SIGNAL (triggered ( )), this , SLOT (reinitializeViewPointCallback ( )));
184
+ action->setToolTip (QSTR (" Réinitialise le point de vue à partir de la vue courante." ));
185
+ menu->addAction (action);
180
186
action = new QAction (" Modifier ..." , this );
187
+ action->setToolTip (QSTR (" Affiche une boite de dialogue de modification du paramétrage du point de vue." ));
181
188
connect (action, SIGNAL (triggered ( )), this , SLOT (editViewPointCallback ( )));
182
189
menu->addAction (action);
183
190
action = new QAction (" Supprimer ..." , this );
191
+ action->setToolTip (QSTR (" Supprime ce point de vue." ));
184
192
connect (action, SIGNAL (triggered ( )), this , SLOT (removeViewPointCallback ( )));
185
193
menu->addAction (action);
186
194
action = new QAction (" Exporter ..." , this );
195
+ action->setToolTip (QSTR (" Enregistre le paramétrage de ce point de vue dans un fichier XML." ));
187
196
connect (action, SIGNAL (triggered ( )), this , SLOT (exportViewPointCallback ( )));
188
197
menu->addAction (action);
189
198
setMenu (menu);
@@ -203,16 +212,25 @@ QtVtkViewPointToolButton::QtVtkViewPointToolButton (QWidget* parent, const strin
203
212
_renderer->Register (0 );
204
213
205
214
QMenu* menu = new QMenu (this );
215
+ menu->setToolTipsVisible (true );
206
216
QAction* action = new QAction (" Appliquer" , this );
217
+ action->setToolTip (QSTR (" Applique le paramétrage du point de vue à la vue courante." ));
207
218
connect (action, SIGNAL (triggered ( )), this , SLOT (applyViewPointCallback ( )));
208
219
menu->addAction (action);
220
+ action = new QAction (" Réinitialiser" , this );
221
+ connect (action, SIGNAL (triggered ( )), this , SLOT (reinitializeViewPointCallback ( )));
222
+ action->setToolTip (QSTR (" Réinitialise le point de vue à partir de la vue courante." ));
223
+ menu->addAction (action);
209
224
action = new QAction (" Modifier ..." , this );
225
+ action->setToolTip (QSTR (" Affiche une boite de dialogue de modification du paramétrage du point de vue." ));
210
226
connect (action, SIGNAL (triggered ( )), this , SLOT (editViewPointCallback ( )));
211
227
menu->addAction (action);
212
228
action = new QAction (" Supprimer ..." , this );
229
+ action->setToolTip (QSTR (" Supprime ce point de vue." ));
213
230
connect (action, SIGNAL (triggered ( )), this , SLOT (removeViewPointCallback ( )));
214
231
menu->addAction (action);
215
232
action = new QAction (" Exporter ..." , this );
233
+ action->setToolTip (QSTR (" Enregistre le paramétrage de ce point de vue dans un fichier XML." ));
216
234
connect (action, SIGNAL (triggered ( )), this , SLOT (exportViewPointCallback ( )));
217
235
menu->addAction (action);
218
236
setMenu (menu);
@@ -259,6 +277,27 @@ void QtVtkViewPointToolButton::setViewPoint (const QtVtkViewPointToolButton::Vtk
259
277
} // QtVtkViewPointToolButton::setViewPoint
260
278
261
279
280
+ void QtVtkViewPointToolButton::reinitializeViewPoint (vtkCamera& camera, vtkRenderer* renderer)
281
+ {
282
+ if (&camera != _camera)
283
+ {
284
+ if (0 != _camera)
285
+ _camera->UnRegister (0 );
286
+ _camera = &camera;
287
+ _camera->Register (0 );
288
+ } // if (&camera != _camera)
289
+ _viewPoint = *_camera;
290
+ if (_renderer != renderer)
291
+ {
292
+ if (0 != _renderer)
293
+ _renderer->UnRegister (0 );
294
+ _renderer = renderer;
295
+ if (0 != _renderer)
296
+ _renderer->Register (0 );
297
+ } // if (_renderer != renderer)
298
+ } // QtVtkViewPointToolButton::reinitializeViewPoint
299
+
300
+
262
301
void QtVtkViewPointToolButton::applyViewPointCallback ( )
263
302
{
264
303
assert (0 != _camera && " QtVtkViewPointToolButton::applyViewPointCallback : null camera" );
@@ -276,6 +315,13 @@ void QtVtkViewPointToolButton::applyViewPointCallback ( )
276
315
} // QtVtkViewPointToolButton::applyViewPointCallback
277
316
278
317
318
+ void QtVtkViewPointToolButton::reinitializeViewPointCallback ( )
319
+ {
320
+ assert (0 != _camera && " QtVtkViewPointToolButton::reinitializeViewPointCallback : null camera" );
321
+ reinitializeViewPoint (*_camera, _renderer);
322
+ } // QtVtkViewPointToolButton::reinitializeViewPointCallback
323
+
324
+
279
325
void QtVtkViewPointToolButton::editViewPointCallback ( )
280
326
{
281
327
assert (0 != _camera && " QtVtkViewPointToolButton::editViewPointCallback : null camera" );
0 commit comments