VTK  9.4.20241221
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
26VTK_ABI_NAMESPACE_BEGIN
27class vtkPoints;
28class vtkPolyData;
30class vtkActor;
31class vtkVectorText;
32class vtkFollower;
33class vtkBox;
35class vtkGlyph3D;
36class vtkDoubleArray;
38class vtkProperty;
39
40class VTKINTERACTIONWIDGETS_EXPORT vtkDistanceRepresentation3D : public vtkDistanceRepresentation
41{
42public:
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);
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
167protected:
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
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
211private:
213 void operator=(const vtkDistanceRepresentation3D&) = delete;
214
215 // Internal method to update the position of the label.
216 void UpdateLabelPosition();
217};
218
219VTK_ABI_NAMESPACE_END
220#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
implicit function for a bounding box
Definition vtkBox.h:110
generate a polygonal cylinder centered at the origin
represent the vtkDistanceWidget
void BuildRepresentation() override
Method to satisfy superclasses' API.
double * GetPoint1WorldPosition() override
Methods to Set/Get the coordinates of the two points defining this representation.
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.
virtual vtkProperty * GetLineProperty()
Convenience method to get the line actor property.
virtual vtkProperty * GetLabelProperty()
Get the distance annotation property.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
~vtkDistanceRepresentation3D() override
vtkTransformPolyDataFilter * GlyphXForm
static vtkDistanceRepresentation3D * New()
Instantiate class.
void SetLabelPosition(double labelPosition)
Set/Get position of the label title in normalized coordinates [0,1].
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 * GetPoint2WorldPosition() 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.
double * GetBounds() override
Method to satisfy superclasses' API.
void GetPoint2WorldPosition(double pos[3]) override
Methods to Set/Get the coordinates of the two points defining this representation.
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).
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:92
copy oriented and scaled glyph geometry to every input point
Definition vtkGlyph3D.h:211
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:139
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
transform points and associated normals and vectors for polygonal dataset
create polygonal text
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_INT_MAX
Definition vtkType.h:144