VTK  9.3.0
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
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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
28#include "vtkInteractionWidgetsModule.h" // For export macro
29#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
30#include "vtkSmartPointer.h" // used for SmartPointers
31
32VTK_ABI_NAMESPACE_BEGIN
33class vtkActor2D;
34class vtkPoints;
35class vtkCellArray;
36class vtkPolyData;
38class vtkCoordinate;
39class vtkProperty2D;
41class vtkWindow;
42class vtkViewport;
43class vtkTransform;
45class vtkTextProperty;
46class vtkTextActor;
47
48class VTKINTERACTIONWIDGETS_EXPORT vtkCompassRepresentation
50{
51public:
56
58
62 void PrintSelf(ostream& os, vtkIndent indent) override;
64
74
84
86
90 vtkGetObjectMacro(RingProperty, vtkProperty2D);
92
94
98 vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
100
102
105 vtkGetObjectMacro(LabelProperty, vtkTextProperty);
107
109
114 void PlaceWidget(double bounds[6]) override;
115 void BuildRepresentation() override;
116 void StartWidgetInteraction(double eventPos[2]) override;
117 void WidgetInteraction(double eventPos[2]) override;
118 virtual void TiltWidgetInteraction(double eventPos[2]);
119 virtual void DistanceWidgetInteraction(double eventPos[2]);
120 int ComputeInteractionState(int X, int Y, int modify = 0) override;
121 void Highlight(int) override;
123
125
128 void GetActors(vtkPropCollection* propCollection) override;
129 void ReleaseGraphicsResources(vtkWindow* window) override;
130 int RenderOverlay(vtkViewport* viewPort) override;
133
135
139 virtual void SetHeading(double heading);
140 virtual double GetHeading();
142
144
148 virtual void SetTilt(double tilt);
149 virtual double GetTilt();
151
153
156 void SetMaximumTiltAngle(double angle);
158 void SetMinimumTiltAngle(double angle);
161
163
166 virtual void UpdateTilt(double deltaTilt = 0);
168
169 virtual void EndTilt();
170
172
176 virtual void SetDistance(double distance);
177 virtual double GetDistance();
179
181
184 void SetMaximumDistance(double distance);
186 void SetMinimumDistance(double distance);
189
191
194 virtual void UpdateDistance(double deltaDistance = 0);
196
197 virtual void EndDistance();
198
199 void SetRenderer(vtkRenderer* renderer) override;
200
201 // Enums are used to describe what is selected
203 {
204 Outside = 0,
212 DistanceAdjusting
213 };
214#if !defined(VTK_LEGACY_REMOVE)
215 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
217#endif
218
219protected:
222
223 // Positioning the widget
226
227 // radius values
230
231 // tilt and distance rep
232
235
236 // Define the geometry. It is constructed in canaonical position
237 // along the x-axis and then rotated into position.
240
246
249
254
256
257 // build the tube geometry
258 void BuildRing();
260
261 // used for positioning etc
262 void GetCenterAndUnitRadius(int center[2], double& radius);
263
265
269 virtual std::string GetStatusText();
271
273
274 double Heading;
275 double Tilt;
276 double Distance;
277
278private:
280 void operator=(const vtkCompassRepresentation&) = delete;
281};
282
283VTK_ABI_NAMESPACE_END
284#endif
a actor that draws 2D data
Definition vtkActor2D.h:35
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:29
represent and manipulate 3D points
Definition vtkPoints.h:29
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:80
an ordered list of Props
represent surface properties of a 2D image
abstract specification for renderers
Definition vtkRenderer.h:59
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:45
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
#define VTK_DEPRECATED_IN_9_2_0(reason)