VTK  9.3.0
vtkDistanceRepresentation3D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
20 #ifndef vtkDistanceRepresentation3D_h
21 #define vtkDistanceRepresentation3D_h
22 
24 #include "vtkInteractionWidgetsModule.h" // For export macro
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkPoints;
28 class vtkPolyData;
29 class vtkPolyDataMapper;
30 class vtkActor;
31 class vtkVectorText;
32 class vtkFollower;
33 class vtkBox;
34 class vtkCylinderSource;
35 class vtkGlyph3D;
36 class vtkDoubleArray;
38 class vtkProperty;
39 
40 class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
41 {
42 public:
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
59  double GetDistance() override { return this->Distance; }
60 
62 
66  void SetGlyphScale(double scale);
67  vtkGetMacro(GlyphScale, double);
69 
74 
76 
80  void SetLabelPosition(double labelPosition);
81  vtkGetMacro(LabelPosition, double);
83 
85 
88  vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
89  vtkGetMacro(MaximumNumberOfRulerTicks, int);
91 
93 
97  vtkGetObjectMacro(GlyphActor, vtkActor);
99 
101 
105  vtkGetObjectMacro(LabelActor, vtkFollower);
106  virtual void SetLabelActor(vtkFollower*);
108 
110 
115  double* GetPoint1WorldPosition() override;
116  double* GetPoint2WorldPosition() override;
117  void GetPoint1WorldPosition(double pos[3]) override;
118  void GetPoint2WorldPosition(double pos[3]) override;
119  void SetPoint1WorldPosition(double pos[3]) override;
120  void SetPoint2WorldPosition(double pos[3]) override;
122 
123  void SetPoint1DisplayPosition(double pos[3]) override;
124  void SetPoint2DisplayPosition(double pos[3]) override;
125  void GetPoint1DisplayPosition(double pos[3]) override;
126  void GetPoint2DisplayPosition(double pos[3]) override;
127 
129 
132  void BuildRepresentation() override;
133  double* GetBounds() override;
135 
137 
141  int RenderOpaqueGeometry(vtkViewport* viewport) override;
144 
146 
150  void SetLabelScale(double x, double y, double z)
151  {
152  double scale[3];
153  scale[0] = x;
154  scale[1] = y;
155  scale[2] = z;
156  this->SetLabelScale(scale);
157  }
158  virtual void SetLabelScale(double scale[3]);
159  virtual double* GetLabelScale();
161 
166 
167 protected:
170 
171  // The line
176 
177  // The distance label
181 
182  // Support internal operations
184 
185  // The 3D disk tick marks
194 
195  // Glyph3D scale
196  double GlyphScale;
198 
199  // The distance between the two points
200  double Distance;
201 
202  // Support GetBounds() method
204 
205  // Maximum number of ticks on the 3d ruler
207 
208  // Label title position
210 
211 private:
213  void operator=(const vtkDistanceRepresentation3D&) = delete;
214 
215  // Internal method to update the position of the label.
216  void UpdateLabelPosition();
217 };
218 
219 VTK_ABI_NAMESPACE_END
220 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
implicit function for a bounding box
Definition: vtkBox.h:31
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:33
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:102
a simple class to control print indentation
Definition: vtkIndent.h:29
represent and manipulate 3D points
Definition: vtkPoints.h:29
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:80
represent surface properties of a geometric object
Definition: vtkProperty.h:57
transform points and associated normals and vectors for polygonal dataset
create polygonal text
Definition: vtkVectorText.h:37
abstract specification for Viewports
Definition: vtkViewport.h:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:28
@ scale
Definition: vtkX3D.h:229
#define VTK_INT_MAX
Definition: vtkType.h:144