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 =========================================================================*/
23 #ifndef vtkMeasurementCubeHandleRepresentation3D_h
24 #define vtkMeasurementCubeHandleRepresentation3D_h
25 
26 #include "vtkInteractionWidgetsModule.h" // For export macro
28 
29 class vtkProperty;
30 class vtkPolyDataMapper;
31 class vtkCellPicker;
34 class vtkMatrix4x4;
35 class vtkPolyData;
37 class vtkActor;
38 class vtkFollower;
40 
41 class VTKINTERACTIONWIDGETS_EXPORT vtkMeasurementCubeHandleRepresentation3D
43 {
44 public:
45 
50 
52 
57  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
64  void SetWorldPosition(double p[3]) override;
65  void SetDisplayPosition(double p[3]) override;
67 
69 
72  vtkPolyData * GetHandle();
74 
76 
79  void SetProperty(vtkProperty*);
80  void SetSelectedProperty(vtkProperty*);
81  vtkGetObjectMacro(Property,vtkProperty);
82  vtkGetObjectMacro(SelectedProperty,vtkProperty);
84 
89  virtual vtkAbstractTransform * GetTransform();
90 
92 
95  void BuildRepresentation() override;
96  void StartWidgetInteraction(double eventPos[2]) override;
97  void WidgetInteraction(double eventPos[2]) override;
98  int ComputeInteractionState(int X, int Y, int modify=0) override;
100 
102 
105  void ShallowCopy(vtkProp *prop) override;
106  void DeepCopy(vtkProp *prop) override;
107  void GetActors(vtkPropCollection *) override;
108  void ReleaseGraphicsResources(vtkWindow *) override;
109  int RenderOpaqueGeometry(vtkViewport *viewport) override;
110  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
111  int HasTranslucentPolygonalGeometry() override;
112  double *GetBounds() override;
114 
116 
120  vtkSetMacro( LabelVisibility, vtkTypeBool );
121  vtkGetMacro( LabelVisibility, vtkTypeBool );
122  vtkBooleanMacro( LabelVisibility, vtkTypeBool );
123  vtkSetMacro( SelectedLabelVisibility, vtkTypeBool );
124  vtkGetMacro( SelectedLabelVisibility, vtkTypeBool );
125  vtkBooleanMacro( SelectedLabelVisibility, vtkTypeBool );
126 
127  virtual void SetLabelTextInput( const char * label );
128  virtual char * GetLabelTextInput();
130 
132 
135  vtkGetObjectMacro( LabelText, vtkBillboardTextActor3D );
137 
139 
142  vtkSetMacro( HandleVisibility, vtkTypeBool );
143  vtkGetMacro( HandleVisibility, vtkTypeBool );
144  vtkBooleanMacro( HandleVisibility, vtkTypeBool );
146 
148 
151  void Highlight(int highlight) override;
153 
155 
165  vtkSetMacro( SmoothMotion, vtkTypeBool );
166  vtkGetMacro( SmoothMotion, vtkTypeBool );
167  vtkBooleanMacro( SmoothMotion, vtkTypeBool );
169 
171 
174  void SetSideLength(double);
175  vtkGetMacro( SideLength, double );
177 
179 
182  vtkSetMacro( AdaptiveScaling, vtkTypeBool );
183  vtkGetMacro( AdaptiveScaling, vtkTypeBool );
184  vtkBooleanMacro( AdaptiveScaling, vtkTypeBool );
186 
188 
192  vtkSetClampMacro( RescaleFactor, double, 1., VTK_DOUBLE_MAX );
193  vtkGetMacro( RescaleFactor, double );
195 
197 
204  void SetMinRelativeCubeScreenArea(double);
205  vtkGetMacro( MinRelativeCubeScreenArea, double );
206  void SetMaxRelativeCubeScreenArea(double);
207  vtkGetMacro( MaxRelativeCubeScreenArea, double );
209 
211 
214  vtkSetStringMacro(LengthUnit);
215  vtkGetStringMacro(LengthUnit);
217 
218 protected:
221 
228  double LastPickPosition[3];
229  double LastEventPosition[2];
235  double Offset[3];
240  double SideLength;
241  char * LengthUnit;
242 
243  // Register internal Pickers within PickingManager
244  void RegisterPickers() override;
245 
246  // Methods to manipulate the cursor
247  virtual void Translate(double *p1, double *p2);
248  virtual void Scale(double *p1, double *p2, double eventPos[2]);
249  virtual void MoveFocus(double *p1, double *p2);
250 
251  void CreateDefaultProperties();
252 
258  void ScaleIfNecessary(vtkViewport*);
259 
271  void MoveFocusRequest( double *p1, double *p2,
272  double eventPos[2], double requestedDisplayPos[3] );
273 
279  virtual void SetUniformScale( double scale );
280 
290  virtual void UpdateHandle();
291 
295  virtual void UpdateLabel();
296 
297  // Handle the label.
303 
304 private:
307  void operator=(
309 };
310 
311 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
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:45
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract class for representing widget handles
#define VTK_DOUBLE_MAX
Definition: vtkType.h:167
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:60
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:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
int HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
a simple class to control print indentation
Definition: vtkIndent.h:33
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:40
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:63
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