Skip to content

Commit 0e86f30

Browse files
author
Charles PIGNEROL
committed
Version 8.8.0. QtVtkViewPoint method QToolButton::reinitializeViewPoint + activation tooltips.
1 parent 9923470 commit 0e86f30

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
set (QT_VTK_MAJOR_VERSION "8")
6-
set (QT_VTK_MINOR_VERSION "7")
6+
set (QT_VTK_MINOR_VERSION "8")
77
set (QT_VTK_RELEASE_VERSION "0")
88
set (QT_VTK_VERSION ${QT_VTK_MAJOR_VERSION}.${QT_VTK_MINOR_VERSION}.${QT_VTK_RELEASE_VERSION})
99

src/QtVtk/QtVtkViewPointToolButton.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
262301
void 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+
279325
void QtVtkViewPointToolButton::editViewPointCallback ( )
280326
{
281327
assert (0 != _camera && "QtVtkViewPointToolButton::editViewPointCallback : null camera");

src/QtVtk/public/QtVtk/QtVtkViewPointToolButton.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,23 @@ class QtVtkViewPointToolButton : public QToolButton
8282
*/
8383
virtual void setViewPoint (const VtkViewPoint& vp);
8484

85+
/**
86+
* Réinitialise le point de vue à partir du point de vue transmis en argument.
87+
*/
88+
virtual void reinitializeViewPoint (vtkCamera& camera, vtkRenderer* renderer);
89+
8590

8691
protected slots :
8792

8893
/**
8994
* Modifie la vue conformément aux paramétrage de ce point de vue.
9095
*/
9196
virtual void applyViewPointCallback ( );
97+
98+
/**
99+
* Réinitialise le point de vue à partir de la vue courante.
100+
*/
101+
virtual void reinitializeViewPointCallback ( );
92102

93103
/**
94104
* Affiche une boite de dialogue de modification du point de vue.

versions.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
A FAIRE : tester le vtkIntersectionPolyDataFilter de VTK 7, voir si de base il propose les services attendus (Inner, ...).
22

3+
Version 8.8.0 : 15/04/25
4+
===============
5+
6+
Méthode QtVtkViewPointToolButton::reinitializeViewPoint + activation tooltips.
7+
8+
39
Version 8.7.0 : 08/04/25
410
===============
511

0 commit comments

Comments
 (0)