VTK  9.3.1
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 
73  virtual vtkProperty* GetLineProperty();
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 
140  void ReleaseGraphicsResources(vtkWindow* w) override;
141  int RenderOpaqueGeometry(vtkViewport* viewport) override;
142  int RenderTranslucentPolygonalGeometry(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 
165  virtual vtkProperty* GetLabelProperty();
166 
167 protected:
169  ~vtkDistanceRepresentation3D() override;
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
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:40
generate a polygonal cylinder centered at the 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:56
#define VTK_INT_MAX
Definition: vtkType.h:144
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:27
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:28
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:101
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:32
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:30
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:28
double GetDistance() override
Satisfy the superclasses API.
create polygonal text
Definition: vtkVectorText.h:36