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
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkMeasurementCubeHandleRepresentation3D::WaitingForMotion
int WaitingForMotion
Definition: vtkMeasurementCubeHandleRepresentation3D.h:240
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkWidgetRepresentation::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
Definition: vtkWidgetRepresentation.h:217
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:50
vtkX3D::scale
Definition: vtkX3D.h:229
vtkMeasurementCubeHandleRepresentation3D::SideLength
double SideLength
Definition: vtkMeasurementCubeHandleRepresentation3D.h:248
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkMeasurementCubeHandleRepresentation3D::SelectedLabelVisibility
vtkTypeBool SelectedLabelVisibility
Definition: vtkMeasurementCubeHandleRepresentation3D.h:304
vtkMeasurementCubeHandleRepresentation3D::Actor
vtkActor * Actor
Definition: vtkMeasurementCubeHandleRepresentation3D.h:230
vtkMeasurementCubeHandleRepresentation3D::LengthUnit
char * LengthUnit
Definition: vtkMeasurementCubeHandleRepresentation3D.h:249
vtkHandleRepresentation::SetWorldPosition
virtual void SetWorldPosition(double pos[3])
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkMeasurementCubeHandleRepresentation3D::Property
vtkProperty * Property
Definition: vtkMeasurementCubeHandleRepresentation3D.h:238
vtkBillboardTextActor3D
Renders pixel-aligned text, facing the camera, anchored at a 3D point.
Definition: vtkBillboardTextActor3D.h:37
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkHandleRepresentation.h
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkHandleRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:223
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:220
vtkMeasurementCubeHandleRepresentation3D::HandleTransformMatrix
vtkMatrix4x4 * HandleTransformMatrix
Definition: vtkMeasurementCubeHandleRepresentation3D.h:234
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:137
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:215
vtkMeasurementCubeHandleRepresentation3D::RescaleFactor
double RescaleFactor
Definition: vtkMeasurementCubeHandleRepresentation3D.h:245
vtkMatrixToLinearTransform
convert a matrix to a transform
Definition: vtkMatrixToLinearTransform.h:40
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkMeasurementCubeHandleRepresentation3D::HandleTransform
vtkMatrixToLinearTransform * HandleTransform
Definition: vtkMeasurementCubeHandleRepresentation3D.h:233
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
vtkWidgetRepresentation::RegisterPickers
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
vtkMeasurementCubeHandleRepresentation3D
represent a unit cube for measuring/comparing to data.
Definition: vtkMeasurementCubeHandleRepresentation3D.h:44
vtkMeasurementCubeHandleRepresentation3D::MinRelativeCubeScreenArea
double MinRelativeCubeScreenArea
Definition: vtkMeasurementCubeHandleRepresentation3D.h:246
vtkMeasurementCubeHandleRepresentation3D::HandlePicker
vtkCellPicker * HandlePicker
Definition: vtkMeasurementCubeHandleRepresentation3D.h:235
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkMeasurementCubeHandleRepresentation3D::LabelText
vtkBillboardTextActor3D * LabelText
Definition: vtkMeasurementCubeHandleRepresentation3D.h:305
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkMeasurementCubeHandleRepresentation3D::LabelAnnotationTextScaleInitialized
bool LabelAnnotationTextScaleInitialized
Definition: vtkMeasurementCubeHandleRepresentation3D.h:306
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkMeasurementCubeHandleRepresentation3D::SmoothMotion
vtkTypeBool SmoothMotion
Definition: vtkMeasurementCubeHandleRepresentation3D.h:307
vtkMeasurementCubeHandleRepresentation3D::WaitCount
int WaitCount
Definition: vtkMeasurementCubeHandleRepresentation3D.h:241
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:222
vtkHandleRepresentation::DeepCopy
virtual void DeepCopy(vtkProp *prop)
vtkHandleRepresentation::SetDisplayPosition
virtual void SetDisplayPosition(double pos[3])
Handles usually have their coordinates set in display coordinates (generally by an associated widget)...
vtkMeasurementCubeHandleRepresentation3D::AdaptiveScaling
vtkTypeBool AdaptiveScaling
Definition: vtkMeasurementCubeHandleRepresentation3D.h:244
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkMeasurementCubeHandleRepresentation3D::LabelVisibility
vtkTypeBool LabelVisibility
Definition: vtkMeasurementCubeHandleRepresentation3D.h:303
vtkMeasurementCubeHandleRepresentation3D::SelectedProperty
vtkProperty * SelectedProperty
Definition: vtkMeasurementCubeHandleRepresentation3D.h:239
vtkMeasurementCubeHandleRepresentation3D::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkMeasurementCubeHandleRepresentation3D.h:231
vtkHandleRepresentation::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Methods to make this class properly act like a vtkWidgetRepresentation.
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:66
vtkWidgetRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkWidgetRepresentation.h:225
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkMeasurementCubeHandleRepresentation3D::HandleTransformFilter
vtkTransformPolyDataFilter * HandleTransformFilter
Definition: vtkMeasurementCubeHandleRepresentation3D.h:232
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:169
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkWidgetRepresentation::Highlight
virtual void Highlight(int vtkNotUsed(highlightOn))
Definition: vtkWidgetRepresentation.h:142
vtkMeasurementCubeHandleRepresentation3D::HandleVisibility
vtkTypeBool HandleVisibility
Definition: vtkMeasurementCubeHandleRepresentation3D.h:242
vtkMeasurementCubeHandleRepresentation3D::MaxRelativeCubeScreenArea
double MaxRelativeCubeScreenArea
Definition: vtkMeasurementCubeHandleRepresentation3D.h:247