VTK  9.4.20251007
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
20
21#ifndef vtkCompassRepresentation_h
22#define vtkCompassRepresentation_h
23
24#include "vtkCenteredSliderRepresentation.h" // to use in a SP
26#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
27#include "vtkInteractionWidgetsModule.h" // For export macro
28#include "vtkSmartPointer.h" // used for SmartPointers
29#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30
31VTK_ABI_NAMESPACE_BEGIN
32class vtkActor2D;
33class vtkPoints;
34class vtkCellArray;
35class vtkPolyData;
37class vtkCoordinate;
38class vtkProperty2D;
40class vtkWindow;
41class vtkViewport;
42class vtkTransform;
44class vtkTextProperty;
45class vtkTextActor;
46
47class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCompassRepresentation
49{
50public:
55
57
61 void PrintSelf(ostream& os, vtkIndent indent) override;
63
73
83
85
89 vtkGetObjectMacro(RingProperty, vtkProperty2D);
91
93
97 vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
99
101
104 vtkGetObjectMacro(LabelProperty, vtkTextProperty);
106
108
113 void PlaceWidget(double bounds[6]) override;
114 void BuildRepresentation() override;
115 void StartWidgetInteraction(double eventPos[2]) override;
116 void WidgetInteraction(double eventPos[2]) override;
117 virtual void TiltWidgetInteraction(double eventPos[2]);
118 virtual void DistanceWidgetInteraction(double eventPos[2]);
119 int ComputeInteractionState(int X, int Y, int modify = 0) override;
120 void Highlight(int) override;
122
124
127 void GetActors(vtkPropCollection* propCollection) override;
128 void ReleaseGraphicsResources(vtkWindow* window) override;
129 int RenderOverlay(vtkViewport* viewPort) override;
132
134
138 virtual void SetHeading(double heading);
139 virtual double GetHeading();
141
143
147 virtual void SetTilt(double tilt);
148 virtual double GetTilt();
150
152
155 void SetMaximumTiltAngle(double angle);
157 void SetMinimumTiltAngle(double angle);
160
162
165 virtual void UpdateTilt(double deltaTilt = 0);
167
168 virtual void EndTilt();
169
171
175 virtual void SetDistance(double distance);
176 virtual double GetDistance();
178
180
183 void SetMaximumDistance(double distance);
185 void SetMinimumDistance(double distance);
188
190
193 virtual void UpdateDistance(double deltaDistance = 0);
195
196 virtual void EndDistance();
197
198 void SetRenderer(vtkRenderer* renderer) override;
199
200 // Enums are used to describe what is selected
213
214protected:
217
218 // Positioning the widget
221
222 // radius values
225
226 // tilt and distance rep
227
230
231 // Define the geometry. It is constructed in canaonical position
232 // along the x-axis and then rotated into position.
235
241
244
249
251
252 // build the tube geometry
253 void BuildRing();
255
256 // used for positioning etc
257 void GetCenterAndUnitRadius(int center[2], double& radius);
258
260
264 virtual std::string GetStatusText();
266
268
269 double Heading;
270 double Tilt;
271 double Distance;
272
273private:
275 void operator=(const vtkCompassRepresentation&) = delete;
276};
277
278VTK_ABI_NAMESPACE_END
279#endif
a actor that draws 2D data
Definition vtkActor2D.h:36
object to represent cell connectivity
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.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
a simple class to control print indentation
Definition vtkIndent.h:29
represent and manipulate 3D points
Definition vtkPoints.h:30
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
an ordered list of Props
represent surface properties of a 2D image
abstract specification for renderers
Definition vtkRenderer.h:63
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:46
window superclass for vtkRenderWindow
Definition vtkWindow.h:29
#define VTK_MARSHALAUTO