VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkPoints;
29 class vtkPolyData;
30 class vtkPolyDataMapper;
31 class vtkActor;
32 class vtkVectorText;
33 class vtkFollower;
34 class vtkBox;
35 class vtkCylinderSource;
36 class vtkGlyph3D;
37 class vtkDoubleArray;
38 class vtkTransformFilter;
39 class vtkProperty;
40 
41 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkDistanceRepresentation3D
43 {
44 public:
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 
78  virtual vtkProperty* GetLineProperty();
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);
111  virtual void SetLabelActor(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 
180  virtual vtkProperty* GetLabelProperty();
181 
182 protected:
184  ~vtkDistanceRepresentation3D() override;
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
211  double GlyphScale;
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 
226 private:
228  void operator=(const vtkDistanceRepresentation3D&) = delete;
229 
230  // Internal method to update the position of the label.
231  void UpdateLabelPosition();
232 };
233 
234 VTK_ABI_NAMESPACE_END
235 #endif
void GetBounds(T a, double bds[6])
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
generate a polygonal cylinder centered at the origin
abstract specification for Viewports
Definition: vtkViewport.h:46
represent the vtkDistanceWidget
represent surface properties of a geometric object
Definition: vtkProperty.h:59
#define VTK_INT_MAX
Definition: vtkType.h:192
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
represent the vtkDistanceWidget
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
a simple class to control print indentation
Definition: vtkIndent.h:28
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:102
#define VTK_MARSHALEXCLUDE(reason)
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:33
transform points and associated normals and vectors
#define VTK_MARSHALAUTO
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
represent and manipulate 3D points
Definition: vtkPoints.h:30
double GetDistance() override
Satisfy the superclasses API.
create polygonal text
Definition: vtkVectorText.h:36