VTK  9.2.6
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 =========================================================================*/
26 #ifndef vtkMeasurementCubeHandleRepresentation3D_h
27 #define vtkMeasurementCubeHandleRepresentation3D_h
28 
30 #include "vtkInteractionWidgetsModule.h" // For export macro
31 
32 class vtkProperty;
33 class vtkPolyDataMapper;
34 class vtkCellPicker;
37 class vtkMatrix4x4;
38 class vtkPolyData;
40 class vtkActor;
41 class vtkFollower;
43 
44 class VTKINTERACTIONWIDGETS_EXPORT vtkMeasurementCubeHandleRepresentation3D
46 {
47 public:
52 
54 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
62 
65  void SetWorldPosition(double p[3]) override;
66  void SetDisplayPosition(double p[3]) override;
68 
70 
73  vtkPolyData* GetHandle();
75 
77 
80  void SetProperty(vtkProperty*);
81  void SetSelectedProperty(vtkProperty*);
82  vtkGetObjectMacro(Property, vtkProperty);
83  vtkGetObjectMacro(SelectedProperty, vtkProperty);
85 
90  virtual vtkAbstractTransform* GetTransform();
91 
93 
96  void BuildRepresentation() override;
97  void StartWidgetInteraction(double eventPos[2]) override;
98  void WidgetInteraction(double eventPos[2]) override;
99  int ComputeInteractionState(int X, int Y, int modify = 0) override;
101 
103 
106  void ShallowCopy(vtkProp* prop) override;
107  void DeepCopy(vtkProp* prop) override;
108  void GetActors(vtkPropCollection*) override;
109  void ReleaseGraphicsResources(vtkWindow*) override;
110  int RenderOpaqueGeometry(vtkViewport* viewport) override;
111  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
113  double* GetBounds() override;
115 
117 
121  vtkSetMacro(LabelVisibility, vtkTypeBool);
122  vtkGetMacro(LabelVisibility, vtkTypeBool);
123  vtkBooleanMacro(LabelVisibility, vtkTypeBool);
124  vtkSetMacro(SelectedLabelVisibility, vtkTypeBool);
125  vtkGetMacro(SelectedLabelVisibility, vtkTypeBool);
126  vtkBooleanMacro(SelectedLabelVisibility, vtkTypeBool);
127 
128  virtual void SetLabelTextInput(const char* label);
129  virtual char* GetLabelTextInput();
131 
133 
136  vtkGetObjectMacro(LabelText, vtkBillboardTextActor3D);
138 
140 
143  vtkSetMacro(HandleVisibility, vtkTypeBool);
144  vtkGetMacro(HandleVisibility, vtkTypeBool);
145  vtkBooleanMacro(HandleVisibility, vtkTypeBool);
147 
149 
152  void Highlight(int highlight) override;
154 
156 
166  vtkSetMacro(SmoothMotion, vtkTypeBool);
167  vtkGetMacro(SmoothMotion, vtkTypeBool);
168  vtkBooleanMacro(SmoothMotion, vtkTypeBool);
170 
172 
175  void SetSideLength(double);
176  vtkGetMacro(SideLength, double);
178 
180 
183  vtkSetMacro(AdaptiveScaling, vtkTypeBool);
184  vtkGetMacro(AdaptiveScaling, vtkTypeBool);
185  vtkBooleanMacro(AdaptiveScaling, vtkTypeBool);
187 
189 
193  vtkSetClampMacro(RescaleFactor, double, 1., VTK_DOUBLE_MAX);
194  vtkGetMacro(RescaleFactor, double);
196 
198 
205  void SetMinRelativeCubeScreenArea(double);
206  vtkGetMacro(MinRelativeCubeScreenArea, double);
207  void SetMaxRelativeCubeScreenArea(double);
208  vtkGetMacro(MaxRelativeCubeScreenArea, double);
210 
212 
215  vtkSetStringMacro(LengthUnit);
216  vtkGetStringMacro(LengthUnit);
218 
219  /*
220  * Register internal Pickers within PickingManager
221  */
222  void RegisterPickers() override;
223 
224 protected:
227 
234  double LastPickPosition[3];
235  double LastEventPosition[2];
241  double Offset[3];
246  double SideLength;
247  char* LengthUnit;
248 
249  // Methods to manipulate the cursor
250  virtual void Scale(const double* p1, const double* p2, const double eventPos[2]);
251  virtual void MoveFocus(const double* p1, const double* p2);
252 
253  void CreateDefaultProperties();
254 
260  void ScaleIfNecessary(vtkViewport*);
261 
273  void MoveFocusRequest(
274  const double* p1, const double* p2, const double eventPos[2], double requestedDisplayPos[3]);
275 
281  virtual void SetUniformScale(double scale);
282 
292  virtual void UpdateHandle();
293 
297  virtual void UpdateLabel();
298 
299  // Handle the label.
305 
306 private:
309  void operator=(const vtkMeasurementCubeHandleRepresentation3D&) = delete;
310 };
311 
312 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
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:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
abstract specification for Viewports
Definition: vtkViewport.h:55
represent surface properties of a geometric object
Definition: vtkProperty.h:67
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:90
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:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:39
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:43
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:72
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...
virtual void SetDisplayPosition(double pos[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
convert a matrix to a transform