VTK
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 
29 #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:
48 
53 
55 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
67  void SetWorldPosition(double p[3]) override;
68  void SetDisplayPosition(double p[3]) override;
70 
72 
75  vtkPolyData * GetHandle();
77 
79 
82  void SetProperty(vtkProperty*);
83  void SetSelectedProperty(vtkProperty*);
84  vtkGetObjectMacro(Property,vtkProperty);
85  vtkGetObjectMacro(SelectedProperty,vtkProperty);
87 
92  virtual vtkAbstractTransform * GetTransform();
93 
95 
98  void BuildRepresentation() override;
99  void StartWidgetInteraction(double eventPos[2]) override;
100  void WidgetInteraction(double eventPos[2]) override;
101  int ComputeInteractionState(int X, int Y, int modify=0) override;
103 
105 
108  void ShallowCopy(vtkProp *prop) override;
109  void DeepCopy(vtkProp *prop) override;
110  void GetActors(vtkPropCollection *) override;
111  void ReleaseGraphicsResources(vtkWindow *) override;
112  int RenderOpaqueGeometry(vtkViewport *viewport) override;
113  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
115  double *GetBounds() override;
117 
119 
123  vtkSetMacro( LabelVisibility, vtkTypeBool );
124  vtkGetMacro( LabelVisibility, vtkTypeBool );
125  vtkBooleanMacro( LabelVisibility, vtkTypeBool );
126  vtkSetMacro( SelectedLabelVisibility, vtkTypeBool );
127  vtkGetMacro( SelectedLabelVisibility, vtkTypeBool );
128  vtkBooleanMacro( SelectedLabelVisibility, vtkTypeBool );
129 
130  virtual void SetLabelTextInput( const char * label );
131  virtual char * GetLabelTextInput();
133 
135 
138  vtkGetObjectMacro( LabelText, vtkBillboardTextActor3D );
140 
142 
145  vtkSetMacro( HandleVisibility, vtkTypeBool );
146  vtkGetMacro( HandleVisibility, vtkTypeBool );
147  vtkBooleanMacro( HandleVisibility, vtkTypeBool );
149 
151 
154  void Highlight(int highlight) override;
156 
158 
168  vtkSetMacro( SmoothMotion, vtkTypeBool );
169  vtkGetMacro( SmoothMotion, vtkTypeBool );
170  vtkBooleanMacro( SmoothMotion, vtkTypeBool );
172 
174 
177  void SetSideLength(double);
178  vtkGetMacro( SideLength, double );
180 
182 
185  vtkSetMacro( AdaptiveScaling, vtkTypeBool );
186  vtkGetMacro( AdaptiveScaling, vtkTypeBool );
187  vtkBooleanMacro( AdaptiveScaling, vtkTypeBool );
189 
191 
195  vtkSetClampMacro( RescaleFactor, double, 1., VTK_DOUBLE_MAX );
196  vtkGetMacro( RescaleFactor, double );
198 
200 
207  void SetMinRelativeCubeScreenArea(double);
208  vtkGetMacro( MinRelativeCubeScreenArea, double );
209  void SetMaxRelativeCubeScreenArea(double);
210  vtkGetMacro( MaxRelativeCubeScreenArea, double );
212 
214 
217  vtkSetStringMacro(LengthUnit);
218  vtkGetStringMacro(LengthUnit);
220 
221  /*
222  * Register internal Pickers within PickingManager
223  */
224  void RegisterPickers() override;
225 
226 protected:
229 
236  double LastPickPosition[3];
237  double LastEventPosition[2];
243  double Offset[3];
248  double SideLength;
249  char * LengthUnit;
250 
251  // Methods to manipulate the cursor
252  virtual void Translate(double *p1, double *p2);
253  virtual void Scale(double *p1, double *p2, double eventPos[2]);
254  virtual void MoveFocus(double *p1, double *p2);
255 
256  void CreateDefaultProperties();
257 
263  void ScaleIfNecessary(vtkViewport*);
264 
276  void MoveFocusRequest( double *p1, double *p2,
277  double eventPos[2], double requestedDisplayPos[3] );
278 
284  virtual void SetUniformScale( double scale );
285 
295  virtual void UpdateHandle();
296 
300  virtual void UpdateLabel();
301 
302  // Handle the label.
308 
309 private:
312  void operator=(
314 };
315 
316 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
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:169
abstract specification for Viewports
Definition: vtkViewport.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:66
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:85
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:37
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:46
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:69
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