VTK  9.2.5
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 
36 #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 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
52 {
53 public:
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
70  double GetDistance() override { return this->Distance; }
71 
73 
77  void SetGlyphScale(double scale);
78  vtkGetMacro(GlyphScale, double);
80 
85 
87 
91  void SetLabelPosition(double labelPosition);
92  vtkGetMacro(LabelPosition, double);
94 
96 
99  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
100  vtkGetMacro(MaximumNumberOfRulerTicks, int);
102 
104 
108  vtkGetObjectMacro(GlyphActor, vtkActor);
110 
112 
116  vtkGetObjectMacro(LabelActor, vtkFollower);
117  virtual void SetLabelActor(vtkFollower*);
119 
121 
126  double* GetPoint1WorldPosition() override;
127  double* GetPoint2WorldPosition() override;
128  void GetPoint1WorldPosition(double pos[3]) override;
129  void GetPoint2WorldPosition(double pos[3]) override;
130  void SetPoint1WorldPosition(double pos[3]) override;
131  void SetPoint2WorldPosition(double pos[3]) override;
133 
134  void SetPoint1DisplayPosition(double pos[3]) override;
135  void SetPoint2DisplayPosition(double pos[3]) override;
136  void GetPoint1DisplayPosition(double pos[3]) override;
137  void GetPoint2DisplayPosition(double pos[3]) override;
138 
140 
143  void BuildRepresentation() override;
144  double* GetBounds() override;
146 
148 
152  int RenderOpaqueGeometry(vtkViewport* viewport) override;
155 
157 
161  void SetLabelScale(double x, double y, double z)
162  {
163  double scale[3];
164  scale[0] = x;
165  scale[1] = y;
166  scale[2] = z;
167  this->SetLabelScale(scale);
168  }
169  virtual void SetLabelScale(double scale[3]);
170  virtual double* GetLabelScale();
172 
177 
178 protected:
181 
182  // The line
187 
188  // The distance label
192 
193  // Support internal operations
195 
196  // The 3D disk tick marks
205 
206  // Glyph3D scale
207  double GlyphScale;
209 
210  // The distance between the two points
211  double Distance;
212 
213  // Support GetBounds() method
215 
216  // Maximum number of ticks on the 3d ruler
218 
219  // Label title position
221 
222 private:
224  void operator=(const vtkDistanceRepresentation3D&) = delete;
225 
226  // Internal method to update the position of the label.
227  void UpdateLabelPosition();
228 };
229 
230 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
implicit function for a bounding box
Definition: vtkBox.h:141
generate a polygonal cylinder centered at the origin
represent the vtkDistanceWidget
void BuildRepresentation() override
Method to satisfy superclasses' API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
void SetPoint1DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
virtual vtkProperty * GetLineProperty()
Convenience method to get the line actor property.
~vtkDistanceRepresentation3D() override
vtkTransformPolyDataFilter * GlyphXForm
void SetLabelPosition(double labelPosition)
Set/Get position of the label title in normalized coordinates [0,1].
double * GetPoint2WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetPoint1WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetLabelScale(double x, double y, double z)
Scale text (font size along each dimension).
void GetPoint2DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetGlyphScale(double scale)
Scale the glyphs used as tick marks.
void GetPoint1DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
double * GetBounds() override
Method to satisfy superclasses' API.
double * GetPoint1WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
void SetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
void GetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
static vtkDistanceRepresentation3D * New()
Instantiate class.
void SetPoint2DisplayPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
virtual double * GetLabelScale()
Scale text (font size along each dimension).
virtual vtkProperty * GetLabelProperty()
Get the distance annotation property.
void GetPoint1WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
double GetDistance() override
Satisfy the superclasses API.
virtual void SetLabelScale(double scale[3])
Scale text (font size along each dimension).
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
virtual void SetLabelActor(vtkFollower *)
Convenience method Get the label actor.
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
represent the vtkDistanceWidget
dynamic, self-adjusting array of double
a subclass of actor that always faces the camera
Definition: vtkFollower.h:123
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:222
a simple class to control print indentation
Definition: vtkIndent.h:119
represent and manipulate 3D points
Definition: vtkPoints.h:149
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
represent surface properties of a geometric object
Definition: vtkProperty.h:177
transform points and associated normals and vectors for polygonal dataset
create polygonal text
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ scale
Definition: vtkX3D.h:235
#define VTK_INT_MAX
Definition: vtkType.h:155