Skip to content

Version 8.8.0. QtVtkViewPoint method QToolButton::reinitializeViewPoi… #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
46 changes: 46 additions & 0 deletions src/QtVtk/QtVtkViewPointToolButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
10 changes: 10 additions & 0 deletions src/QtVtk/public/QtVtk/QtVtkViewPointToolButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,23 @@ 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 :

/**
* 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.
Expand Down
6 changes: 6 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
@@ -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
===============

Expand Down