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 =========================================================================*/
29 #ifndef vtkDistanceRepresentation3D_h
30 #define vtkDistanceRepresentation3D_h
31 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
34 
35 class vtkPoints;
36 class vtkPolyData;
37 class vtkPolyDataMapper;
38 class vtkActor;
39 class vtkVectorText;
40 class vtkFollower;
41 class vtkBox;
42 class vtkCylinderSource;
43 class vtkGlyph3D;
44 class vtkDoubleArray;
46 class vtkProperty;
47 
48 
49 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
50 {
51 public:
56 
58 
62  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
68  double GetDistance() override
69  {return this->Distance;}
70 
72 
76  void SetGlyphScale(double scale);
77  vtkGetMacro(GlyphScale, double);
79 
83  virtual vtkProperty *GetLineProperty();
84 
86 
90  void SetLabelPosition(double labelPosition);
91  vtkGetMacro(LabelPosition, double);
93 
95 
98  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
99  vtkGetMacro(MaximumNumberOfRulerTicks, int);
101 
103 
107  vtkGetObjectMacro(GlyphActor, vtkActor);
109 
111 
115  vtkGetObjectMacro(LabelActor, vtkFollower);
116  virtual void SetLabelActor(vtkFollower *);
118 
120 
125  double* GetPoint1WorldPosition() override;
126  double* GetPoint2WorldPosition() override;
127  void GetPoint1WorldPosition(double pos[3]) override;
128  void GetPoint2WorldPosition(double pos[3]) override;
129  void SetPoint1WorldPosition(double pos[3]) override;
130  void SetPoint2WorldPosition(double pos[3]) override;
132 
133  void SetPoint1DisplayPosition(double pos[3]) override;
134  void SetPoint2DisplayPosition(double pos[3]) override;
135  void GetPoint1DisplayPosition(double pos[3]) override;
136  void GetPoint2DisplayPosition(double pos[3]) override;
137 
139 
142  void BuildRepresentation() override;
143  double *GetBounds() override;
145 
147 
150  void ReleaseGraphicsResources(vtkWindow *w) override;
151  int RenderOpaqueGeometry(vtkViewport *viewport) override;
152  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
154 
156 
160  void SetLabelScale(double x, double y, double z)
161  {
162  double scale[3];
163  scale[0] = x;
164  scale[1] = y;
165  scale[2] = z;
166  this->SetLabelScale(scale);
167  }
168  virtual void SetLabelScale( double scale[3] );
169  virtual double * GetLabelScale();
171 
175  virtual vtkProperty *GetLabelProperty();
176 
177 protected:
179  ~vtkDistanceRepresentation3D() override;
180 
181  // The line
186 
187  // The distance label
191 
192  // Support internal operations
194 
195  // The 3D disk tick marks
204 
205  // Glyph3D scale
206  double GlyphScale;
208 
209  // The distance between the two points
210  double Distance;
211 
212  // Support GetBounds() method
214 
215  // Maximum number of ticks on the 3d ruler
217 
218  // Label title position
220 
221 private:
223  void operator=(const vtkDistanceRepresentation3D&) = delete;
224 
225  // Internal method to update the position of the label.
226  void UpdateLabelPosition();
227 };
228 
229 #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:45
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:44
represent the vtkDistanceWidget
represent surface properties of a geometric object
Definition: vtkProperty.h:60
#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:79
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:34
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:33
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:105
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:40
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:38
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:33
double GetDistance() override
Satisfy the superclasses API.
create polygonal text
Definition: vtkVectorText.h:41