VTK
vtkDistanceRepresentation3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDistanceRepresentation3D.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 =========================================================================*/
32 #ifndef vtkDistanceRepresentation3D_h
33 #define vtkDistanceRepresentation3D_h
34 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
37 
38 class vtkPoints;
39 class vtkPolyData;
40 class vtkPolyDataMapper;
41 class vtkActor;
42 class vtkVectorText;
43 class vtkFollower;
44 class vtkBox;
45 class vtkCylinderSource;
46 class vtkGlyph3D;
47 class vtkDoubleArray;
49 class vtkProperty;
50 
51 
52 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
53 {
54 public:
59 
61 
65  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
67 
71  double GetDistance() VTK_OVERRIDE
72  {return this->Distance;}
73 
75 
79  void SetGlyphScale(double scale);
80  vtkGetMacro(GlyphScale, double);
82 
86  virtual vtkProperty *GetLineProperty();
87 
89 
93  void SetLabelPosition(double labelPosition);
94  vtkGetMacro(LabelPosition, double);
96 
98 
101  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
102  vtkGetMacro(MaximumNumberOfRulerTicks, int);
104 
106 
110  vtkGetObjectMacro(GlyphActor, vtkActor);
112 
114 
118  vtkGetObjectMacro(LabelActor, vtkFollower);
120 
122 
127  double* GetPoint1WorldPosition() VTK_OVERRIDE;
128  double* GetPoint2WorldPosition() VTK_OVERRIDE;
129  void GetPoint1WorldPosition(double pos[3]) VTK_OVERRIDE;
130  void GetPoint2WorldPosition(double pos[3]) VTK_OVERRIDE;
131  void SetPoint1WorldPosition(double pos[3]) VTK_OVERRIDE;
132  void SetPoint2WorldPosition(double pos[3]) VTK_OVERRIDE;
134 
135  void SetPoint1DisplayPosition(double pos[3]) VTK_OVERRIDE;
136  void SetPoint2DisplayPosition(double pos[3]) VTK_OVERRIDE;
137  void GetPoint1DisplayPosition(double pos[3]) VTK_OVERRIDE;
138  void GetPoint2DisplayPosition(double pos[3]) VTK_OVERRIDE;
139 
141 
144  void BuildRepresentation() VTK_OVERRIDE;
145  double *GetBounds() VTK_OVERRIDE;
147 
149 
152  void ReleaseGraphicsResources(vtkWindow *w) VTK_OVERRIDE;
153  int RenderOpaqueGeometry(vtkViewport *viewport) VTK_OVERRIDE;
154  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) VTK_OVERRIDE;
156 
158 
162  void SetLabelScale(double x, double y, double z)
163  {
164  double scale[3];
165  scale[0] = x;
166  scale[1] = y;
167  scale[2] = z;
168  this->SetLabelScale(scale);
169  }
170  virtual void SetLabelScale( double scale[3] );
171  virtual double * GetLabelScale();
173 
177  virtual vtkProperty *GetLabelProperty();
178 
179 protected:
181  ~vtkDistanceRepresentation3D() VTK_OVERRIDE;
182 
183  // The line
188 
189  // The distance label
193 
194  // Support internal operations
196 
197  // The 3D disk tick marks
206 
207  // Glyph3D scale
208  double GlyphScale;
210 
211  // The distance between the two points
212  double Distance;
213 
214  // Support GetBounds() method
216 
217  // Maximum number of ticks on the 3d ruler
219 
220  // Label title position
222 
223 private:
224  vtkDistanceRepresentation3D(const vtkDistanceRepresentation3D&) VTK_DELETE_FUNCTION;
225  void operator=(const vtkDistanceRepresentation3D&) VTK_DELETE_FUNCTION;
226 
227  // Internal method to update the position of the label.
228  void UpdateLabelPosition();
229 };
230 
231 #endif
virtual void SetPoint1WorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
generate a cylinder centered at origin
virtual void SetPoint1DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
abstract specification for Viewports
Definition: vtkViewport.h:47
represent the vtkDistanceWidget
represent surface properties of a geometric object
Definition: vtkProperty.h:65
#define VTK_INT_MAX
Definition: vtkType.h:157
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
transform points and associated normals and vectors for polygonal dataset
virtual void GetPoint1DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
represent the vtkDistanceWidget
virtual void GetPoint2DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual double * GetPoint1WorldPosition()=0
Methods to Set/Get the coordinates of the two points defining this representation.
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
a simple class to control print indentation
Definition: vtkIndent.h:39
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:111
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void SetPoint2DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
map vtkPolyData to graphics primitives
virtual double * GetPoint2WorldPosition()=0
Methods to Set/Get the coordinates of the two points defining this representation.
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkTransformPolyDataFilter * GlyphXForm
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
implicit function for a bounding box
Definition: vtkBox.h:41
virtual void SetPoint2WorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
represent and manipulate 3D points
Definition: vtkPoints.h:39
double GetDistance() override
Satisfy the superclasses API.
create polygonal text
Definition: vtkVectorText.h:47