VTK  9.7.1
vtkDistanceRepresentation2D.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
25 #ifndef vtkDistanceRepresentation2D_h
26 #define vtkDistanceRepresentation2D_h
27 
29 #include "vtkInteractionWidgetsModule.h" // For export macro
30 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkAxisActor2D;
34 class vtkProperty2D;
35 
36 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkDistanceRepresentation2D
38 {
39 public:
44 
46 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  double GetDistance() override { return this->Distance; }
57 
59 
65  double* GetPoint1WorldPosition() override;
67  double* GetPoint2WorldPosition() override;
69  void GetPoint1WorldPosition(double pos[3]) VTK_FUTURE_CONST override;
71  void GetPoint2WorldPosition(double pos[3]) VTK_FUTURE_CONST override;
73  void SetPoint1WorldPosition(double pos[3]) override;
75  void SetPoint2WorldPosition(double pos[3]) override;
77 
79  void SetPoint1DisplayPosition(double pos[3]) override;
81  void SetPoint2DisplayPosition(double pos[3]) override;
83  void GetPoint1DisplayPosition(double pos[3]) VTK_FUTURE_CONST override;
85  void GetPoint2DisplayPosition(double pos[3]) VTK_FUTURE_CONST override;
86 
88 
93  vtkAxisActor2D* GetAxis();
94  vtkProperty2D* GetAxisProperty();
96 
100  void BuildRepresentation() override;
101 
103 
106  void ReleaseGraphicsResources(vtkWindow* w) override;
107  int RenderOverlay(vtkViewport* viewport) override;
108  int RenderOpaqueGeometry(vtkViewport* viewport) override;
110 
111 protected:
113  ~vtkDistanceRepresentation2D() override;
114 
115  // Add a line to the mix
116  vtkNew<vtkAxisActor2D> AxisActor;
117  vtkProperty2D* AxisProperty;
118 
119  // The distance between the two points
120  double Distance;
121 
122 private:
123  vtkDistanceRepresentation2D(const vtkDistanceRepresentation2D&) = delete;
124  void operator=(const vtkDistanceRepresentation2D&) = delete;
125 };
126 
127 VTK_ABI_NAMESPACE_END
128 #endif
abstract specification for Viewports
Definition: vtkViewport.h:46
represent the vtkDistanceWidget
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
Create an axis with tick marks and labels.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_MARSHALEXCLUDE(reason)
double GetDistance() override
Satisfy the superclasses API.
Allocate and hold a VTK object.
represent surface properties of a 2D image
Definition: vtkProperty2D.h:30
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent the vtkDistanceWidget