VTK  9.5.20250718
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkPoints;
29class vtkPolyData;
31class vtkActor;
32class vtkVectorText;
33class vtkFollower;
34class vtkBox;
36class vtkGlyph3D;
37class vtkDoubleArray;
39class vtkProperty;
40
41class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkDistanceRepresentation3D
43{
44public:
49
51
55 void PrintSelf(ostream& os, vtkIndent indent) override;
57
61 double GetDistance() override { return this->Distance; }
62
64
68 void SetGlyphScale(double scale);
69 vtkGetMacro(GlyphScale, double);
70
71 vtkGetMacro(GlyphScaleSpecified, bool);
72 vtkSetMacro(GlyphScaleSpecified, bool);
74
79
81
85 void SetLabelPosition(double labelPosition);
86 vtkGetMacro(LabelPosition, double);
88
90
93 vtkSetClampMacro(MaximumNumberOfRulerTicks, int, 1, VTK_INT_MAX);
94 vtkGetMacro(MaximumNumberOfRulerTicks, int);
96
98
102 vtkGetObjectMacro(GlyphActor, vtkActor);
104
106
110 vtkGetObjectMacro(LabelActor, vtkFollower);
113
115
121 double* GetPoint1WorldPosition() override;
123 double* GetPoint2WorldPosition() override;
125 void GetPoint1WorldPosition(double pos[3]) VTK_FUTURE_CONST override;
127 void GetPoint2WorldPosition(double pos[3]) VTK_FUTURE_CONST override;
129 void SetPoint1WorldPosition(double pos[3]) override;
131 void SetPoint2WorldPosition(double pos[3]) override;
133
135 void SetPoint1DisplayPosition(double pos[3]) override;
137 void SetPoint2DisplayPosition(double pos[3]) override;
139 void GetPoint1DisplayPosition(double pos[3]) VTK_FUTURE_CONST override;
141 void GetPoint2DisplayPosition(double pos[3]) VTK_FUTURE_CONST override;
142
144
147 void BuildRepresentation() override;
148 double* GetBounds() override;
150
152
155 void ReleaseGraphicsResources(vtkWindow* w) override;
156 int RenderOpaqueGeometry(vtkViewport* viewport) override;
157 int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
159
161
165 void SetLabelScale(double x, double y, double z)
166 {
167 double scale[3];
168 scale[0] = x;
169 scale[1] = y;
170 scale[2] = z;
171 this->SetLabelScale(scale);
172 }
173 virtual void SetLabelScale(double scale[3]);
174 virtual double* GetLabelScale();
176
181
182protected:
185
186 // The line
191
192 // The distance label
196
197 // Support internal operations
199
200 // The 3D disk tick marks
209
210 // Glyph3D scale
213
214 // The distance between the two points
215 double Distance;
216
217 // Support GetBounds() method
219
220 // Maximum number of ticks on the 3d ruler
222
223 // Label title position
225
226private:
228 void operator=(const vtkDistanceRepresentation3D&) = delete;
229
230 // Internal method to update the position of the label.
231 void UpdateLabelPosition();
232};
233
234VTK_ABI_NAMESPACE_END
235#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 PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual vtkProperty * GetLineProperty()
Convenience method to get the line actor property.
virtual vtkProperty * GetLabelProperty()
Get the distance annotation property.
~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 SetGlyphScale(double scale)
Scale the glyphs used as tick marks.
virtual double * GetLabelScale()
Scale text (font size along each dimension).
double GetDistance() override
Satisfy the superclasses API.
virtual void SetLabelScale(double scale[3])
Scale text (font size along each dimension).
virtual void SetLabelActor(vtkFollower *)
Convenience method Get the label actor.
represent the vtkDistanceWidget
dynamic, self-adjusting array of double
a subclass of actor that always faces the camera
Definition vtkFollower.h:93
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:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_INT_MAX
Definition vtkType.h:161
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)