VTK  9.1.0
vtkMeasurementCubeHandleRepresentation3D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMeasurementCubeHandleRepresentation3D.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
23#ifndef vtkMeasurementCubeHandleRepresentation3D_h
24#define vtkMeasurementCubeHandleRepresentation3D_h
25
27#include "vtkInteractionWidgetsModule.h" // For export macro
28
29class vtkProperty;
31class vtkCellPicker;
34class vtkMatrix4x4;
35class vtkPolyData;
37class vtkActor;
38class vtkFollower;
40
41class VTKINTERACTIONWIDGETS_EXPORT vtkMeasurementCubeHandleRepresentation3D
43{
44public:
49
51
55 void PrintSelf(ostream& os, vtkIndent indent) override;
57
59
62 void SetWorldPosition(double p[3]) override;
63 void SetDisplayPosition(double p[3]) override;
65
67
72
74
79 vtkGetObjectMacro(Property, vtkProperty);
80 vtkGetObjectMacro(SelectedProperty, vtkProperty);
82
88
90
93 void BuildRepresentation() override;
94 void StartWidgetInteraction(double eventPos[2]) override;
95 void WidgetInteraction(double eventPos[2]) override;
96 int ComputeInteractionState(int X, int Y, int modify = 0) override;
98
100
103 void ShallowCopy(vtkProp* prop) override;
104 void DeepCopy(vtkProp* prop) override;
107 int RenderOpaqueGeometry(vtkViewport* viewport) override;
110 double* GetBounds() override;
112
114
118 vtkSetMacro(LabelVisibility, vtkTypeBool);
119 vtkGetMacro(LabelVisibility, vtkTypeBool);
120 vtkBooleanMacro(LabelVisibility, vtkTypeBool);
121 vtkSetMacro(SelectedLabelVisibility, vtkTypeBool);
122 vtkGetMacro(SelectedLabelVisibility, vtkTypeBool);
123 vtkBooleanMacro(SelectedLabelVisibility, vtkTypeBool);
124
125 virtual void SetLabelTextInput(const char* label);
126 virtual char* GetLabelTextInput();
128
130
133 vtkGetObjectMacro(LabelText, vtkBillboardTextActor3D);
135
137
140 vtkSetMacro(HandleVisibility, vtkTypeBool);
141 vtkGetMacro(HandleVisibility, vtkTypeBool);
142 vtkBooleanMacro(HandleVisibility, vtkTypeBool);
144
146
149 void Highlight(int highlight) override;
151
153
163 vtkSetMacro(SmoothMotion, vtkTypeBool);
164 vtkGetMacro(SmoothMotion, vtkTypeBool);
165 vtkBooleanMacro(SmoothMotion, vtkTypeBool);
167
169
172 void SetSideLength(double);
173 vtkGetMacro(SideLength, double);
175
177
180 vtkSetMacro(AdaptiveScaling, vtkTypeBool);
181 vtkGetMacro(AdaptiveScaling, vtkTypeBool);
182 vtkBooleanMacro(AdaptiveScaling, vtkTypeBool);
184
186
190 vtkSetClampMacro(RescaleFactor, double, 1., VTK_DOUBLE_MAX);
191 vtkGetMacro(RescaleFactor, double);
193
195
203 vtkGetMacro(MinRelativeCubeScreenArea, double);
205 vtkGetMacro(MaxRelativeCubeScreenArea, double);
207
209
212 vtkSetStringMacro(LengthUnit);
213 vtkGetStringMacro(LengthUnit);
215
216 /*
217 * Register internal Pickers within PickingManager
218 */
219 void RegisterPickers() override;
220
221protected:
224
231 double LastPickPosition[3];
232 double LastEventPosition[2];
238 double Offset[3];
245
246 // Methods to manipulate the cursor
247 virtual void Scale(const double* p1, const double* p2, const double eventPos[2]);
248 virtual void MoveFocus(const double* p1, const double* p2);
249
251
258
271 const double* p1, const double* p2, const double eventPos[2], double requestedDisplayPos[3]);
272
278 virtual void SetUniformScale(double scale);
279
289 virtual void UpdateHandle();
290
294 virtual void UpdateLabel();
295
296 // Handle the label.
302
303private:
306 void operator=(const vtkMeasurementCubeHandleRepresentation3D&) = delete;
307};
308
309#endif
superclass for all geometric transformations
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:96
a subclass of actor that always faces the camera
Definition: vtkFollower.h:120
abstract class for representing widget handles
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
convert a matrix to a transform
represent a unit cube for measuring/comparing to data.
void BuildRepresentation() override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkPolyData * GetHandle()
Get the handle polydata.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void SetSelectedProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to make this class properly act like a vtkWidgetRepresentation.
virtual void SetLabelTextInput(const char *label)
A label may be associated with the cube.
virtual void Scale(const double *p1, const double *p2, const double eventPos[2])
void SetMinRelativeCubeScreenArea(double)
Set the min/max cube representational area relative to the render window area.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void SetMaxRelativeCubeScreenArea(double)
Set the min/max cube representational area relative to the render window area.
void ScaleIfNecessary(vtkViewport *)
If adaptive scaling is enabled, rescale the cube so that its representational area in the display win...
void SetSideLength(double)
Set the length of a side of the cube (default is 1).
virtual void MoveFocus(const double *p1, const double *p2)
void SetProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
virtual void SetUniformScale(double scale)
The handle may be scaled uniformly in all three dimensions using this API.
virtual vtkAbstractTransform * GetTransform()
Get the transform used to transform the generic handle polydata before placing it in the render windo...
void StartWidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
static vtkMeasurementCubeHandleRepresentation3D * New()
Instantiate this class.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
void Highlight(int highlight) override
Toggle highlighting (used when the cube is selected).
void ShallowCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void DeepCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void MoveFocusRequest(const double *p1, const double *p2, const double eventPos[2], double requestedDisplayPos[3])
Given a motion vector defined by p1 --> p2 (p1 and p2 are in world coordinates), the new display posi...
void SetDisplayPosition(double p[3]) override
Set the position of the point in world and display coordinates.
virtual void UpdateLabel()
Opportunity to update the label position and text during each render.
virtual void UpdateHandle()
Update the actor position.
void WidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
void SetWorldPosition(double p[3]) override
Set the position of the point in world and display coordinates.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
virtual char * GetLabelTextInput()
A label may be associated with the cube.
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:67
represent surface properties of a geometric object
Definition: vtkProperty.h:171
transform points and associated normals and vectors for polygonal dataset
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
@ scale
Definition: vtkX3D.h:235
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165