Skip to content

Commit 08d5130

Browse files
author
Charles PIGNEROL
committed
Pre-release 5.9.0. Improvements to the vtkViewCubeActor class: a second click on a face cancels the roll, and the text is pressed as close as possible to the faces. Highlighting of the hovered face.
1 parent d02f763 commit 08d5130

File tree

3 files changed

+172
-113
lines changed

3 files changed

+172
-113
lines changed

src/VtkContrib/public/VtkContrib/vtkViewCubeActor.h

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ class vtkViewCubeActor : public vtkPropAssembly
8888
*/
8989
virtual void PickCallback (int x, int y);
9090

91+
/**
92+
* Regarde si une face du cube est pointée aux coordonnées transmises et, le cas échéant, met cette face en surbrillance. Annule ue éventuelle surbrillance antérieure d'une autre face.
93+
*/
94+
virtual void HighlightCallback (int x, int y);
95+
9196

9297
protected:
9398

@@ -108,28 +113,28 @@ class vtkViewCubeActor : public vtkPropAssembly
108113
vtkViewCubeActor (const vtkViewCubeActor&);
109114
vtkViewCubeActor& operator = (const vtkViewCubeActor&);
110115

111-
vtkRenderer *Renderer, *DrivenRenderer;
116+
vtkRenderer *Renderer, *DrivenRenderer;
112117

113118
/** Le "cube". */
114-
vtkSmartPointer<vtkPolyData> CubePolyData;
115-
vtkSmartPointer<vtkActor> CubeActor;
116-
vtkSmartPointer<vtkPolyDataMapper> CubePolyDataMapper;
119+
vtkSmartPointer<vtkPolyData> CubePolyData, HighlightPolyData;
120+
vtkSmartPointer<vtkActor> CubeActor, HighlightActor;
121+
vtkSmartPointer<vtkPolyDataMapper> CubePolyDataMapper, HighlightPolyDataMapper;
117122

118123
/** Le picking sur les faces du ViewCube. */
119-
vtkSmartPointer<vtkCellPicker> CellPicker;
124+
vtkSmartPointer<vtkCellPicker> CellPicker;
120125

121-
/** La dernière face pickée. */
122-
unsigned char LastPickedFace;
126+
/** La dernière face pickée, éventuelle face en cours de surbrillance. */
127+
unsigned char LastPickedFace, HighlightedFace;
123128

124129
/** Les labels. */
125-
vtkSmartPointer<vtkVectorText> XPlusVectorText, XMinusVectorText, YPlusVectorText, YMinusVectorText, ZPlusVectorText, ZMinusVectorText;
126-
vtkSmartPointer<vtkActor> XPlusActor, XMinusActor, YPlusActor, YMinusActor, ZPlusActor, ZMinusActor;
130+
vtkSmartPointer<vtkVectorText> XPlusVectorText, XMinusVectorText, YPlusVectorText, YMinusVectorText, ZPlusVectorText, ZMinusVectorText;
131+
vtkSmartPointer<vtkActor> XPlusActor, XMinusActor, YPlusActor, YMinusActor, ZPlusActor, ZMinusActor;
127132

128133
/** Les vecteurs "orientation vers le haut". */
129-
vtkSmartPointer<vtkDoubleArray> ViewUpVectors;
134+
vtkSmartPointer<vtkDoubleArray> ViewUpVectors;
130135

131136
/** L'éventuelle transformation utilisateur. */
132-
vtkTransform *Transform;
137+
vtkTransform *Transform;
133138
}; // class vtkViewCubeActor
134139

135140

0 commit comments

Comments
 (0)