@@ -174,16 +174,25 @@ QtVtkViewPointToolButton::QtVtkViewPointToolButton (QWidget* parent, const std::
174174 _renderer->Register (0 );
175175
176176 QMenu* menu = new QMenu (this );
177+ menu->setToolTipsVisible (true );
177178 QAction* action = new QAction (" Appliquer" , this );
179+ action->setToolTip (QSTR (" Applique le paramétrage du point de vue à la vue courante." ));
178180 connect (action, SIGNAL (triggered ( )), this , SLOT (applyViewPointCallback ( )));
179181 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);
180186 action = new QAction (" Modifier ..." , this );
187+ action->setToolTip (QSTR (" Affiche une boite de dialogue de modification du paramétrage du point de vue." ));
181188 connect (action, SIGNAL (triggered ( )), this , SLOT (editViewPointCallback ( )));
182189 menu->addAction (action);
183190 action = new QAction (" Supprimer ..." , this );
191+ action->setToolTip (QSTR (" Supprime ce point de vue." ));
184192 connect (action, SIGNAL (triggered ( )), this , SLOT (removeViewPointCallback ( )));
185193 menu->addAction (action);
186194 action = new QAction (" Exporter ..." , this );
195+ action->setToolTip (QSTR (" Enregistre le paramétrage de ce point de vue dans un fichier XML." ));
187196 connect (action, SIGNAL (triggered ( )), this , SLOT (exportViewPointCallback ( )));
188197 menu->addAction (action);
189198 setMenu (menu);
@@ -203,16 +212,25 @@ QtVtkViewPointToolButton::QtVtkViewPointToolButton (QWidget* parent, const strin
203212 _renderer->Register (0 );
204213
205214 QMenu* menu = new QMenu (this );
215+ menu->setToolTipsVisible (true );
206216 QAction* action = new QAction (" Appliquer" , this );
217+ action->setToolTip (QSTR (" Applique le paramétrage du point de vue à la vue courante." ));
207218 connect (action, SIGNAL (triggered ( )), this , SLOT (applyViewPointCallback ( )));
208219 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);
209224 action = new QAction (" Modifier ..." , this );
225+ action->setToolTip (QSTR (" Affiche une boite de dialogue de modification du paramétrage du point de vue." ));
210226 connect (action, SIGNAL (triggered ( )), this , SLOT (editViewPointCallback ( )));
211227 menu->addAction (action);
212228 action = new QAction (" Supprimer ..." , this );
229+ action->setToolTip (QSTR (" Supprime ce point de vue." ));
213230 connect (action, SIGNAL (triggered ( )), this , SLOT (removeViewPointCallback ( )));
214231 menu->addAction (action);
215232 action = new QAction (" Exporter ..." , this );
233+ action->setToolTip (QSTR (" Enregistre le paramétrage de ce point de vue dans un fichier XML." ));
216234 connect (action, SIGNAL (triggered ( )), this , SLOT (exportViewPointCallback ( )));
217235 menu->addAction (action);
218236 setMenu (menu);
@@ -259,6 +277,27 @@ void QtVtkViewPointToolButton::setViewPoint (const QtVtkViewPointToolButton::Vtk
259277} // QtVtkViewPointToolButton::setViewPoint
260278
261279
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+
262301void QtVtkViewPointToolButton::applyViewPointCallback ( )
263302{
264303 assert (0 != _camera && " QtVtkViewPointToolButton::applyViewPointCallback : null camera" );
@@ -276,6 +315,13 @@ void QtVtkViewPointToolButton::applyViewPointCallback ( )
276315} // QtVtkViewPointToolButton::applyViewPointCallback
277316
278317
318+ void QtVtkViewPointToolButton::reinitializeViewPointCallback ( )
319+ {
320+ assert (0 != _camera && " QtVtkViewPointToolButton::reinitializeViewPointCallback : null camera" );
321+ reinitializeViewPoint (*_camera, _renderer);
322+ } // QtVtkViewPointToolButton::reinitializeViewPointCallback
323+
324+
279325void QtVtkViewPointToolButton::editViewPointCallback ( )
280326{
281327 assert (0 != _camera && " QtVtkViewPointToolButton::editViewPointCallback : null camera" );
0 commit comments