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 
18 #include "vtkInteractionWidgetsModule.h" // For export macro
19 
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkProperty;
22 class vtkPolyDataMapper;
23 class vtkCellPicker;
26 class vtkMatrix4x4;
27 class vtkPolyData;
29 class vtkActor;
30 class vtkFollower;
32 
33 class VTKINTERACTIONWIDGETS_EXPORT vtkMeasurementCubeHandleRepresentation3D
35 {
36 public:
41 
43 
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;
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:
216 
223  double LastPickPosition[3];
224  double LastEventPosition[2];
230  double Offset[3];
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.
294 
295 private:
298  void operator=(const vtkMeasurementCubeHandleRepresentation3D&) = delete;
299 };
300 
301 VTK_ABI_NAMESPACE_END
302 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
virtual void SetWorldPosition(double pos[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:56
virtual void StartWidgetInteraction(double eventPos[2])
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
transform points and associated normals and vectors for polygonal dataset
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
virtual void SetDisplayPosition(double pos[2])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
superclass for all geometric transformations
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
represent a unit cube for measuring/comparing to data.
virtual void DeepCopy(vtkProp *prop)
Methods to make this class properly act like a vtkWidgetRepresentation.
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:32
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:61
void ShallowCopy(vtkProp *prop) override
Methods to make this class properly act like a vtkWidgetRepresentation.
virtual void Highlight(int vtkNotUsed(highlightOn))
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
convert a matrix to a transform