VTK: Interaction/Widgets/vtkMeasurementCubeHandleRepresentation3D.h Source File

| VTK 9.3.1

vtkMeasurementCubeHandleRepresentation3D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkMeasurementCubeHandleRepresentation3D_h
15 #define vtkMeasurementCubeHandleRepresentation3D_h
16
17 #include "vtkHandleRepresentation.h"
18 #include "vtkInteractionWidgetsModule.h" // For export macro
19
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkProperty;
22 class vtkPolyDataMapper;
23 class vtkCellPicker;
24 class vtkTransformPolyDataFilter;
25 class vtkMatrixToLinearTransform;
26 class vtkMatrix4x4;
27 class vtkPolyData;
28 class vtkAbstractTransform;
29 class vtkActor;
30 class vtkFollower;
31 class vtkBillboardTextActor3D;
32
33 class VTKINTERACTIONWIDGETS_EXPORT vtkMeasurementCubeHandleRepresentation3D
34 : public vtkHandleRepresentation
35 {
36 public:
40 static vtkMeasurementCubeHandleRepresentation3D* New();
41
43
46 vtkTypeMacro(vtkMeasurementCubeHandleRepresentation3D, vtkHandleRepresentation);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
54 void SetWorldPosition(double p[3]) override;
55 void SetDisplayPosition(double p[3]) override;
57
59
62 vtkPolyData* GetHandle();
64
66
69 void SetProperty(vtkProperty*);
70 void SetSelectedProperty(vtkProperty*);
71 vtkGetObjectMacro(Property, vtkProperty);
72 vtkGetObjectMacro(SelectedProperty, vtkProperty);
74
79 virtual vtkAbstractTransform* GetTransform();
80
82
85 void BuildRepresentation() override;
86 void StartWidgetInteraction(double eventPos[2]) override;
87 void WidgetInteraction(double eventPos[2]) override;
88 int ComputeInteractionState(int X, int Y, int modify = 0) override;
90
92
95 void ShallowCopy(vtkProp* prop) override;
96 void DeepCopy(vtkProp* prop) override;
97 void GetActors(vtkPropCollection*) override;
98 void ReleaseGraphicsResources(vtkWindow*) override;
99 int RenderOpaqueGeometry(vtkViewport* viewport) override;
100 int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
101 vtkTypeBool HasTranslucentPolygonalGeometry() override;
102 double* GetBounds() override;
104
106
110 vtkSetMacro(LabelVisibility, vtkTypeBool);
111 vtkGetMacro(LabelVisibility, vtkTypeBool);
112 vtkBooleanMacro(LabelVisibility, vtkTypeBool);
113 vtkSetMacro(SelectedLabelVisibility, vtkTypeBool);
114 vtkGetMacro(SelectedLabelVisibility, vtkTypeBool);
115 vtkBooleanMacro(SelectedLabelVisibility, vtkTypeBool);
116
117 virtual void SetLabelTextInput(const char* label);
118 virtual char* GetLabelTextInput();
120
122
125 vtkGetObjectMacro(LabelText, vtkBillboardTextActor3D);
127
129
132 vtkSetMacro(HandleVisibility, vtkTypeBool);
133 vtkGetMacro(HandleVisibility, vtkTypeBool);
134 vtkBooleanMacro(HandleVisibility, vtkTypeBool);
136
138
141 void Highlight(int highlight) override;
143
145
155 vtkSetMacro(SmoothMotion, vtkTypeBool);
156 vtkGetMacro(SmoothMotion, vtkTypeBool);
157 vtkBooleanMacro(SmoothMotion, vtkTypeBool);
159
161
164 void SetSideLength(double);
165 vtkGetMacro(SideLength, double);
167
169
172 vtkSetMacro(AdaptiveScaling, vtkTypeBool);
173 vtkGetMacro(AdaptiveScaling, vtkTypeBool);
174 vtkBooleanMacro(AdaptiveScaling, vtkTypeBool);
176
178
182 vtkSetClampMacro(RescaleFactor, double, 1., VTK_DOUBLE_MAX);
183 vtkGetMacro(RescaleFactor, double);
185
187
194 void SetMinRelativeCubeScreenArea(double);
195 vtkGetMacro(MinRelativeCubeScreenArea, double);
196 void SetMaxRelativeCubeScreenArea(double);
197 vtkGetMacro(MaxRelativeCubeScreenArea, double);
199
201
204 vtkSetStringMacro(LengthUnit);
205 vtkGetStringMacro(LengthUnit);
207
208 /*
209 * Register internal Pickers within PickingManager
210 */
211 void RegisterPickers() override;
212
213 protected:
214 vtkMeasurementCubeHandleRepresentation3D();
215 ~vtkMeasurementCubeHandleRepresentation3D() override;
216
217 vtkActor* Actor;
218 vtkPolyDataMapper* Mapper;
219 vtkTransformPolyDataFilter* HandleTransformFilter;
220 vtkMatrixToLinearTransform* HandleTransform;
221 vtkMatrix4x4* HandleTransformMatrix;
222 vtkCellPicker* HandlePicker;
223 double LastPickPosition[3];
224 double LastEventPosition[2];
225 vtkProperty* Property;
226 vtkProperty* SelectedProperty;
227 int WaitingForMotion;
228 int WaitCount;
229 vtkTypeBool HandleVisibility;
230 double Offset[3];
231 vtkTypeBool AdaptiveScaling;
232 double RescaleFactor;
233 double MinRelativeCubeScreenArea;
234 double MaxRelativeCubeScreenArea;
235 double SideLength;
236 char* LengthUnit;
237
238 // Methods to manipulate the cursor
239 virtual void Scale(const double* p1, const double* p2, const double eventPos[2]);
240 virtual void MoveFocus(const double* p1, const double* p2);
241
242 void CreateDefaultProperties();
243
249 void ScaleIfNecessary(vtkViewport*);
250
262 void MoveFocusRequest(
263 const double* p1, const double* p2, const double eventPos[2], double requestedDisplayPos[3]);
264
270 virtual void SetUniformScale(double scale);
271
281 virtual void UpdateHandle();
282
286 virtual void UpdateLabel();
287
288 // Handle the label.
289 vtkTypeBool LabelVisibility;
290 vtkTypeBool SelectedLabelVisibility;
291 vtkBillboardTextActor3D* LabelText;
292 bool LabelAnnotationTextScaleInitialized;
293 vtkTypeBool SmoothMotion;
294
295 private:
296 vtkMeasurementCubeHandleRepresentation3D(
297 const vtkMeasurementCubeHandleRepresentation3D&) = delete;
298 void operator=(const vtkMeasurementCubeHandleRepresentation3D&) = delete;
299 };
300
301 VTK_ABI_NAMESPACE_END
302 #endif
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:39
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
vtkBillboardTextActor3D
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
Definition: vtkBillboardTextActor3D.h:39
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:71
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:42
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkMatrixToLinearTransform
convert a matrix to a transform
Definition: vtkMatrixToLinearTransform.h:30
vtkMeasurementCubeHandleRepresentation3D
represent a unit cube for measuring/comparing to data.
Definition: vtkMeasurementCubeHandleRepresentation3D.h:35
vtkMeasurementCubeHandleRepresentation3D::MaxRelativeCubeScreenArea
double MaxRelativeCubeScreenArea
Definition: vtkMeasurementCubeHandleRepresentation3D.h:234
vtkMeasurementCubeHandleRepresentation3D::BuildRepresentation
void BuildRepresentation() override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkMeasurementCubeHandleRepresentation3D::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::SetSelectedProperty
void SetSelectedProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
vtkMeasurementCubeHandleRepresentation3D::GetActors
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkMeasurementCubeHandleRepresentation3D::SetLabelTextInput
virtual void SetLabelTextInput(const char *label)
A label may be associated with the cube.
vtkMeasurementCubeHandleRepresentation3D::GetTransform
virtual vtkAbstractTransform * GetTransform()
Get the transform used to transform the generic handle polydata before placing it in the render windo...
vtkMeasurementCubeHandleRepresentation3D::LabelAnnotationTextScaleInitialized
bool LabelAnnotationTextScaleInitialized
Definition: vtkMeasurementCubeHandleRepresentation3D.h:292
vtkMeasurementCubeHandleRepresentation3D::SelectedLabelVisibility
vtkTypeBool SelectedLabelVisibility
Definition: vtkMeasurementCubeHandleRepresentation3D.h:290
vtkMeasurementCubeHandleRepresentation3D::Scale
virtual void Scale(const double *p1, const double *p2, const double eventPos[2])
vtkMeasurementCubeHandleRepresentation3D::HandleTransformMatrix
vtkMatrix4x4 * HandleTransformMatrix
Definition: vtkMeasurementCubeHandleRepresentation3D.h:221
vtkMeasurementCubeHandleRepresentation3D::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkMeasurementCubeHandleRepresentation3D.h:218
vtkMeasurementCubeHandleRepresentation3D::HandleVisibility
vtkTypeBool HandleVisibility
Definition: vtkMeasurementCubeHandleRepresentation3D.h:229
vtkMeasurementCubeHandleRepresentation3D::SetMinRelativeCubeScreenArea
void SetMinRelativeCubeScreenArea(double)
Set the min/max cube representational area relative to the render window area.
vtkMeasurementCubeHandleRepresentation3D::RegisterPickers
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
vtkMeasurementCubeHandleRepresentation3D::SetMaxRelativeCubeScreenArea
void SetMaxRelativeCubeScreenArea(double)
Set the min/max cube representational area relative to the render window area.
vtkMeasurementCubeHandleRepresentation3D::HandleTransformFilter
vtkTransformPolyDataFilter * HandleTransformFilter
Definition: vtkMeasurementCubeHandleRepresentation3D.h:219
vtkMeasurementCubeHandleRepresentation3D::ScaleIfNecessary
void ScaleIfNecessary(vtkViewport *)
If adaptive scaling is enabled, rescale the cube so that its representational area in the display win...
vtkMeasurementCubeHandleRepresentation3D::New
static vtkMeasurementCubeHandleRepresentation3D * New()
Instantiate this class.
vtkMeasurementCubeHandleRepresentation3D::SetSideLength
void SetSideLength(double)
Set the length of a side of the cube (default is 1).
vtkMeasurementCubeHandleRepresentation3D::MoveFocus
virtual void MoveFocus(const double *p1, const double *p2)
vtkMeasurementCubeHandleRepresentation3D::HandleTransform
vtkMatrixToLinearTransform * HandleTransform
Definition: vtkMeasurementCubeHandleRepresentation3D.h:220
vtkMeasurementCubeHandleRepresentation3D::SetProperty
void SetProperty(vtkProperty *)
Set/Get the handle properties when unselected and selected.
vtkMeasurementCubeHandleRepresentation3D::WaitingForMotion
int WaitingForMotion
Definition: vtkMeasurementCubeHandleRepresentation3D.h:227
vtkMeasurementCubeHandleRepresentation3D::GetHandle
vtkPolyData * GetHandle()
Get the handle polydata.
vtkMeasurementCubeHandleRepresentation3D::SetUniformScale
virtual void SetUniformScale(double scale)
The handle may be scaled uniformly in all three dimensions using this API.
vtkMeasurementCubeHandleRepresentation3D::MinRelativeCubeScreenArea
double MinRelativeCubeScreenArea
Definition: vtkMeasurementCubeHandleRepresentation3D.h:233
vtkMeasurementCubeHandleRepresentation3D::SmoothMotion
vtkTypeBool SmoothMotion
Definition: vtkMeasurementCubeHandleRepresentation3D.h:293
vtkMeasurementCubeHandleRepresentation3D::~vtkMeasurementCubeHandleRepresentation3D
~vtkMeasurementCubeHandleRepresentation3D() override
vtkMeasurementCubeHandleRepresentation3D::CreateDefaultProperties
void CreateDefaultProperties()
vtkMeasurementCubeHandleRepresentation3D::WaitCount
int WaitCount
Definition: vtkMeasurementCubeHandleRepresentation3D.h:228
vtkMeasurementCubeHandleRepresentation3D::LabelText
vtkBillboardTextActor3D * LabelText
Definition: vtkMeasurementCubeHandleRepresentation3D.h:291
vtkMeasurementCubeHandleRepresentation3D::StartWidgetInteraction
void StartWidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkMeasurementCubeHandleRepresentation3D::LengthUnit
char * LengthUnit
Definition: vtkMeasurementCubeHandleRepresentation3D.h:236
vtkMeasurementCubeHandleRepresentation3D::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::GetLabelTextInput
virtual char * GetLabelTextInput()
A label may be associated with the cube.
vtkMeasurementCubeHandleRepresentation3D::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::LabelVisibility
vtkTypeBool LabelVisibility
Definition: vtkMeasurementCubeHandleRepresentation3D.h:289
vtkMeasurementCubeHandleRepresentation3D::SelectedProperty
vtkProperty * SelectedProperty
Definition: vtkMeasurementCubeHandleRepresentation3D.h:226
vtkMeasurementCubeHandleRepresentation3D::Highlight
void Highlight(int highlight) override
Toggle highlighting (used when the cube is selected).
vtkMeasurementCubeHandleRepresentation3D::RescaleFactor
double RescaleFactor
Definition: vtkMeasurementCubeHandleRepresentation3D.h:232
vtkMeasurementCubeHandleRepresentation3D::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkMeasurementCubeHandleRepresentation3D::SideLength
double SideLength
Definition: vtkMeasurementCubeHandleRepresentation3D.h:235
vtkMeasurementCubeHandleRepresentation3D::DeepCopy
void DeepCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::MoveFocusRequest
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...
vtkMeasurementCubeHandleRepresentation3D::AdaptiveScaling
vtkTypeBool AdaptiveScaling
Definition: vtkMeasurementCubeHandleRepresentation3D.h:231
vtkMeasurementCubeHandleRepresentation3D::HandlePicker
vtkCellPicker * HandlePicker
Definition: vtkMeasurementCubeHandleRepresentation3D.h:222
vtkMeasurementCubeHandleRepresentation3D::Property
vtkProperty * Property
Definition: vtkMeasurementCubeHandleRepresentation3D.h:225
vtkMeasurementCubeHandleRepresentation3D::SetDisplayPosition
void SetDisplayPosition(double p[3]) override
Set the position of the point in world and display coordinates.
vtkMeasurementCubeHandleRepresentation3D::UpdateLabel
virtual void UpdateLabel()
Opportunity to update the label position and text during each render.
vtkMeasurementCubeHandleRepresentation3D::UpdateHandle
virtual void UpdateHandle()
Update the actor position.
vtkMeasurementCubeHandleRepresentation3D::vtkMeasurementCubeHandleRepresentation3D
vtkMeasurementCubeHandleRepresentation3D()
vtkMeasurementCubeHandleRepresentation3D::WidgetInteraction
void WidgetInteraction(double eventPos[2]) override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkMeasurementCubeHandleRepresentation3D::SetWorldPosition
void SetWorldPosition(double p[3]) override
Set the position of the point in world and display coordinates.
vtkMeasurementCubeHandleRepresentation3D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
vtkMeasurementCubeHandleRepresentation3D::Actor
vtkActor * Actor
Definition: vtkMeasurementCubeHandleRepresentation3D.h:217
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:37
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:66
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:47
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:54
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkHandleRepresentation.h
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154