VTK  9.6.1
vtkDistanceRepresentation.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
14
15#ifndef vtkDistanceRepresentation_h
16#define vtkDistanceRepresentation_h
17
18#include "vtkInteractionWidgetsModule.h" // For export macro
20#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21
22VTK_ABI_NAMESPACE_BEGIN
24
25class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkDistanceRepresentation
27{
28public:
30
34 void PrintSelf(ostream& os, vtkIndent indent) override;
36
41 virtual double GetDistance() = 0;
42
44
50 virtual void GetPoint1WorldPosition(double pos[3]) VTK_FUTURE_CONST = 0;
52 virtual void GetPoint2WorldPosition(double pos[3]) VTK_FUTURE_CONST = 0;
54 virtual double* GetPoint1WorldPosition() VTK_SIZEHINT(3) = 0;
56 virtual double* GetPoint2WorldPosition() VTK_SIZEHINT(3) = 0;
58 virtual void SetPoint1DisplayPosition(double pos[3]) = 0;
60 virtual void SetPoint2DisplayPosition(double pos[3]) = 0;
62 virtual void GetPoint1DisplayPosition(double pos[3]) VTK_FUTURE_CONST = 0;
64 virtual void GetPoint2DisplayPosition(double pos[3]) VTK_FUTURE_CONST = 0;
66 virtual void SetPoint1WorldPosition(double pos[3]) = 0;
68 virtual void SetPoint2WorldPosition(double pos[3]) = 0;
70
72
85
87
96
98
100
105 vtkSetClampMacro(Tolerance, int, 1, 100);
106 vtkGetMacro(Tolerance, int);
108
110
115 vtkSetStringMacro(LabelFormat);
116 vtkGetStringMacro(LabelFormat);
118
120
128 vtkSetMacro(Scale, double);
129 vtkGetMacro(Scale, double);
131
133
138 vtkSetMacro(RulerMode, vtkTypeBool);
139 vtkGetMacro(RulerMode, vtkTypeBool);
140 vtkBooleanMacro(RulerMode, vtkTypeBool);
142
144
148 vtkSetClampMacro(RulerDistance, double, 0, VTK_FLOAT_MAX);
149 vtkGetMacro(RulerDistance, double);
151
153
160 vtkSetClampMacro(NumberOfRulerTicks, int, 1, VTK_INT_MAX);
161 vtkGetMacro(NumberOfRulerTicks, int);
163
164 // Used to communicate about the state of the representation
165 enum
166 {
170 };
171
173
176 void BuildRepresentation() override;
177 int ComputeInteractionState(int X, int Y, int modify = 0) override;
178 void StartWidgetInteraction(double e[2]) override;
179 void WidgetInteraction(double e[2]) override;
181 unsigned long event, void* calldata) override;
183 unsigned long event, void* calldata) override;
185 unsigned long event, void* calldata, int modify = 0) override;
187
188protected:
191
192 // The handle and the rep used to close the handles
196
197 // Selection tolerance for the handles
199
200 // Format for printing the distance
202
203 // Scale to change from the VTK world coordinates to the desired coordinate
204 // system.
205 double Scale;
206
207 // Ruler related stuff
211
212private:
214 void operator=(const vtkDistanceRepresentation&) = delete;
215};
216
217VTK_ABI_NAMESPACE_END
218#endif
define the API for widget / widget representation
int ComputeInteractionState(int X, int Y, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
void StartComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
These are methods that satisfy vtkWidgetRepresentation's API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual void GetPoint2DisplayPosition(double pos[3]) VTK_FUTURE_CONST=0
Methods to Set/Get the coordinates of the two points defining this representation.
virtual double GetDistance()=0
This representation and all subclasses must keep a distance consistent with the state of the widget.
vtkHandleRepresentation * Point2Representation
vtkHandleRepresentation * HandleRepresentation
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the two internal vtkHandl...
virtual void SetPoint1WorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
virtual void GetPoint1DisplayPosition(double pos[3]) VTK_FUTURE_CONST=0
Methods to Set/Get the coordinates of the two points defining this representation.
void InstantiateHandleRepresentation()
This method is used to specify the type of handle representation to use for the two internal vtkHandl...
void SetPoint2Representation(vtkHandleRepresentation *obj)
Set/Get the two handle representations used for the vtkDistanceWidget.
virtual void GetPoint2WorldPosition(double pos[3]) VTK_FUTURE_CONST=0
Methods to Set/Get the coordinates of the two points defining this representation.
~vtkDistanceRepresentation() override
virtual void SetPoint2WorldPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetPoint2DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
void WidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
vtkHandleRepresentation * Point1Representation
void ComplexInteraction(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void GetPoint1WorldPosition(double pos[3]) VTK_FUTURE_CONST=0
Methods to Set/Get the coordinates of the two points defining this representation.
void SetPoint1Representation(vtkHandleRepresentation *obj)
Set/Get the two handle representations used for the vtkDistanceWidget.
void StartWidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetPoint1DisplayPosition(double pos[3])=0
Methods to Set/Get the coordinates of the two points defining this representation.
abstract class for representing widget handles
a simple class to control print indentation
Definition vtkIndent.h:29
platform-independent render window interaction including picking and frame rate control.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_INT_MAX
Definition vtkType.h:197
#define VTK_FLOAT_MAX
Definition vtkType.h:205
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)