VTK  9.3.20240425
vtkCompassRepresentation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4
40#ifndef vtkCompassRepresentation_h
41#define vtkCompassRepresentation_h
42
43#include "vtkCenteredSliderRepresentation.h" // to use in a SP
45#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
46#include "vtkInteractionWidgetsModule.h" // For export macro
47#include "vtkSmartPointer.h" // used for SmartPointers
48#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
49
50VTK_ABI_NAMESPACE_BEGIN
51class vtkActor2D;
52class vtkPoints;
53class vtkCellArray;
54class vtkPolyData;
56class vtkCoordinate;
57class vtkProperty2D;
59class vtkWindow;
60class vtkViewport;
61class vtkTransform;
63class vtkTextProperty;
64class vtkTextActor;
65
66class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCompassRepresentation
68{
69public:
74
76
80 void PrintSelf(ostream& os, vtkIndent indent) override;
82
92
102
104
108 vtkGetObjectMacro(RingProperty, vtkProperty2D);
110
112
116 vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
118
120
123 vtkGetObjectMacro(LabelProperty, vtkTextProperty);
125
127
132 void PlaceWidget(double bounds[6]) override;
133 void BuildRepresentation() override;
134 void StartWidgetInteraction(double eventPos[2]) override;
135 void WidgetInteraction(double eventPos[2]) override;
136 virtual void TiltWidgetInteraction(double eventPos[2]);
137 virtual void DistanceWidgetInteraction(double eventPos[2]);
138 int ComputeInteractionState(int X, int Y, int modify = 0) override;
139 void Highlight(int) override;
141
143
146 void GetActors(vtkPropCollection* propCollection) override;
147 void ReleaseGraphicsResources(vtkWindow* window) override;
148 int RenderOverlay(vtkViewport* viewPort) override;
151
153
157 virtual void SetHeading(double heading);
158 virtual double GetHeading();
160
162
166 virtual void SetTilt(double tilt);
167 virtual double GetTilt();
169
171
174 void SetMaximumTiltAngle(double angle);
176 void SetMinimumTiltAngle(double angle);
179
181
184 virtual void UpdateTilt(double deltaTilt = 0);
186
187 virtual void EndTilt();
188
190
194 virtual void SetDistance(double distance);
195 virtual double GetDistance();
197
199
202 void SetMaximumDistance(double distance);
204 void SetMinimumDistance(double distance);
207
209
212 virtual void UpdateDistance(double deltaDistance = 0);
214
215 virtual void EndDistance();
216
217 void SetRenderer(vtkRenderer* renderer) override;
218
219 // Enums are used to describe what is selected
221 {
222 Outside = 0,
230 DistanceAdjusting
231 };
232
233protected:
236
237 // Positioning the widget
240
241 // radius values
244
245 // tilt and distance rep
246
249
250 // Define the geometry. It is constructed in canaonical position
251 // along the x-axis and then rotated into position.
254
260
263
268
270
271 // build the tube geometry
272 void BuildRing();
274
275 // used for positioning etc
276 void GetCenterAndUnitRadius(int center[2], double& radius);
277
279
283 virtual std::string GetStatusText();
285
287
288 double Heading;
289 double Tilt;
290 double Distance;
291
292private:
294 void operator=(const vtkCompassRepresentation&) = delete;
295};
296
297VTK_ABI_NAMESPACE_END
298#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
object to represent cell connectivity
provide a compass and distance, tilt sliders
virtual void TiltWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
double GetMaximumDistance()
Get/Set the distance range.
virtual double GetDistance()
Get/Set the distance.
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
virtual double GetHeading()
Get/Set the heading in degrees.
double GetMaximumTiltAngle()
Get/Set the tilt range.
int RenderOverlay(vtkViewport *viewPort) override
Methods supporting the rendering process.
virtual void SetDistance(double distance)
Get/Set the distance.
virtual std::string GetStatusText()
Return the text used for the status label.
virtual void EndDistance()
void GetCenterAndUnitRadius(int center[2], double &radius)
void SetMaximumTiltAngle(double angle)
Get/Set the tilt range.
virtual void UpdateTilt(double deltaTilt=0)
Update the tilt by the given delta in degrees.
void WidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
void ReleaseGraphicsResources(vtkWindow *window) override
Methods supporting the rendering process.
void SetMinimumDistance(double distance)
Get/Set the distance range.
~vtkCompassRepresentation() override
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to interface with the vtkSliderWidget.
virtual void SetHeading(double heading)
Get/Set the heading in degrees.
virtual void SetTilt(double tilt)
Get/Set the tilt in degrees.
static vtkCompassRepresentation * New()
Instantiate the class.
void GetActors(vtkPropCollection *propCollection) override
Methods supporting the rendering process.
virtual void EndTilt()
void Highlight(int) override
Methods to interface with the vtkSliderWidget.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkTransformPolyDataFilter * RingXForm
virtual void DistanceWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
virtual double GetTilt()
Get/Set the tilt in degrees.
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
void SetRenderer(vtkRenderer *renderer) override
Subclasses of vtkWidgetRepresentation must implement these methods.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
void SetMaximumDistance(double distance)
Get/Set the distance range.
double GetMinimumDistance()
Get/Set the distance range.
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
virtual void UpdateDistance(double deltaDistance=0)
Update the distance by the given delta.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
double GetMinimumTiltAngle()
Get/Set the tilt range.
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkPolyDataMapper2D * BackdropMapper
void SetMinimumTiltAngle(double angle)
Get/Set the tilt range.
provide the representation for a continuous value
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:139
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
an ordered list of Props
represent surface properties of a 2D image
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
An actor that displays text.
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_MARSHALAUTO