diff --git a/cmake/version.cmake b/cmake/version.cmake index c491e7e..6cf2da7 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -3,7 +3,7 @@ # set (QT_VTK_MAJOR_VERSION "8") -set (QT_VTK_MINOR_VERSION "7") +set (QT_VTK_MINOR_VERSION "8") set (QT_VTK_RELEASE_VERSION "0") set (QT_VTK_VERSION ${QT_VTK_MAJOR_VERSION}.${QT_VTK_MINOR_VERSION}.${QT_VTK_RELEASE_VERSION}) diff --git a/src/QtVtk/QtVtkViewPointToolButton.cpp b/src/QtVtk/QtVtkViewPointToolButton.cpp index 1ddd498..24160b8 100644 --- a/src/QtVtk/QtVtkViewPointToolButton.cpp +++ b/src/QtVtk/QtVtkViewPointToolButton.cpp @@ -174,16 +174,25 @@ QtVtkViewPointToolButton::QtVtkViewPointToolButton (QWidget* parent, const std:: _renderer->Register (0); QMenu* menu = new QMenu (this); + menu->setToolTipsVisible (true); QAction* action = new QAction ("Appliquer", this); + action->setToolTip (QSTR ("Applique le paramétrage du point de vue à la vue courante.")); connect (action, SIGNAL (triggered ( )), this, SLOT (applyViewPointCallback ( ))); menu->addAction (action); + action = new QAction ("Réinitialiser", this); + connect (action, SIGNAL (triggered ( )), this, SLOT (reinitializeViewPointCallback ( ))); + action->setToolTip (QSTR ("Réinitialise le point de vue à partir de la vue courante.")); + menu->addAction (action); action = new QAction ("Modifier ...", this); + action->setToolTip (QSTR ("Affiche une boite de dialogue de modification du paramétrage du point de vue.")); connect (action, SIGNAL (triggered ( )), this, SLOT (editViewPointCallback ( ))); menu->addAction (action); action = new QAction ("Supprimer ...", this); + action->setToolTip (QSTR ("Supprime ce point de vue.")); connect (action, SIGNAL (triggered ( )), this, SLOT (removeViewPointCallback ( ))); menu->addAction (action); action = new QAction ("Exporter ...", this); + action->setToolTip (QSTR ("Enregistre le paramétrage de ce point de vue dans un fichier XML.")); connect (action, SIGNAL (triggered ( )), this, SLOT (exportViewPointCallback ( ))); menu->addAction (action); setMenu (menu); @@ -203,16 +212,25 @@ QtVtkViewPointToolButton::QtVtkViewPointToolButton (QWidget* parent, const strin _renderer->Register (0); QMenu* menu = new QMenu (this); + menu->setToolTipsVisible (true); QAction* action = new QAction ("Appliquer", this); + action->setToolTip (QSTR ("Applique le paramétrage du point de vue à la vue courante.")); connect (action, SIGNAL (triggered ( )), this, SLOT (applyViewPointCallback ( ))); menu->addAction (action); + action = new QAction ("Réinitialiser", this); + connect (action, SIGNAL (triggered ( )), this, SLOT (reinitializeViewPointCallback ( ))); + action->setToolTip (QSTR ("Réinitialise le point de vue à partir de la vue courante.")); + menu->addAction (action); action = new QAction ("Modifier ...", this); + action->setToolTip (QSTR ("Affiche une boite de dialogue de modification du paramétrage du point de vue.")); connect (action, SIGNAL (triggered ( )), this, SLOT (editViewPointCallback ( ))); menu->addAction (action); action = new QAction ("Supprimer ...", this); + action->setToolTip (QSTR ("Supprime ce point de vue.")); connect (action, SIGNAL (triggered ( )), this, SLOT (removeViewPointCallback ( ))); menu->addAction (action); action = new QAction ("Exporter ...", this); + action->setToolTip (QSTR ("Enregistre le paramétrage de ce point de vue dans un fichier XML.")); connect (action, SIGNAL (triggered ( )), this, SLOT (exportViewPointCallback ( ))); menu->addAction (action); setMenu (menu); @@ -259,6 +277,27 @@ void QtVtkViewPointToolButton::setViewPoint (const QtVtkViewPointToolButton::Vtk } // QtVtkViewPointToolButton::setViewPoint +void QtVtkViewPointToolButton::reinitializeViewPoint (vtkCamera& camera, vtkRenderer* renderer) +{ + if (&camera != _camera) + { + if (0 != _camera) + _camera->UnRegister (0); + _camera = &camera; + _camera->Register (0); + } // if (&camera != _camera) + _viewPoint = *_camera; + if (_renderer != renderer) + { + if (0 != _renderer) + _renderer->UnRegister (0); + _renderer = renderer; + if (0 != _renderer) + _renderer->Register (0); + } // if (_renderer != renderer) +} // QtVtkViewPointToolButton::reinitializeViewPoint + + void QtVtkViewPointToolButton::applyViewPointCallback ( ) { assert (0 != _camera && "QtVtkViewPointToolButton::applyViewPointCallback : null camera"); @@ -276,6 +315,13 @@ void QtVtkViewPointToolButton::applyViewPointCallback ( ) } // QtVtkViewPointToolButton::applyViewPointCallback +void QtVtkViewPointToolButton::reinitializeViewPointCallback ( ) +{ + assert (0 != _camera && "QtVtkViewPointToolButton::reinitializeViewPointCallback : null camera"); + reinitializeViewPoint (*_camera, _renderer); +} // QtVtkViewPointToolButton::reinitializeViewPointCallback + + void QtVtkViewPointToolButton::editViewPointCallback ( ) { assert (0 != _camera && "QtVtkViewPointToolButton::editViewPointCallback : null camera"); diff --git a/src/QtVtk/public/QtVtk/QtVtkViewPointToolButton.h b/src/QtVtk/public/QtVtk/QtVtkViewPointToolButton.h index 8a8e224..770c364 100644 --- a/src/QtVtk/public/QtVtk/QtVtkViewPointToolButton.h +++ b/src/QtVtk/public/QtVtk/QtVtkViewPointToolButton.h @@ -82,6 +82,11 @@ class QtVtkViewPointToolButton : public QToolButton */ virtual void setViewPoint (const VtkViewPoint& vp); + /** + * Réinitialise le point de vue à partir du point de vue transmis en argument. + */ + virtual void reinitializeViewPoint (vtkCamera& camera, vtkRenderer* renderer); + protected slots : @@ -89,6 +94,11 @@ class QtVtkViewPointToolButton : public QToolButton * Modifie la vue conformément aux paramétrage de ce point de vue. */ virtual void applyViewPointCallback ( ); + + /** + * Réinitialise le point de vue à partir de la vue courante. + */ + virtual void reinitializeViewPointCallback ( ); /** * Affiche une boite de dialogue de modification du point de vue. diff --git a/versions.txt b/versions.txt index 33dbacf..ff81288 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,11 @@ A FAIRE : tester le vtkIntersectionPolyDataFilter de VTK 7, voir si de base il propose les services attendus (Inner, ...). +Version 8.8.0 : 15/04/25 +=============== + +Méthode QtVtkViewPointToolButton::reinitializeViewPoint + activation tooltips. + + Version 8.7.0 : 08/04/25 ===============