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 
30 #ifndef vtkCompassRepresentation_h
31 #define vtkCompassRepresentation_h
32 
33 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
35 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
36 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
37 #include "vtkInteractionWidgetsModule.h" // For export macro
38 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
39 #include "vtkSmartPointer.h" // used for SmartPointers
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkActor2D;
43 class vtkPoints;
44 class vtkCellArray;
45 class vtkPolyData;
47 class vtkCoordinate;
48 class vtkProperty2D;
49 class vtkPropCollection;
50 class vtkWindow;
51 class vtkViewport;
52 class vtkTransform;
54 class vtkTextProperty;
55 class vtkTextActor;
56 
57 class VTKINTERACTIONWIDGETS_EXPORT vtkCompassRepresentation
59 {
60 public:
65 
67 
71  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
83 
93 
95 
99  vtkGetObjectMacro(RingProperty, vtkProperty2D);
101 
103 
107  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
109 
111 
114  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
116 
118 
123  void PlaceWidget(double bounds[6]) override;
124  void BuildRepresentation() override;
125  void StartWidgetInteraction(double eventPos[2]) override;
126  void WidgetInteraction(double eventPos[2]) override;
127  virtual void TiltWidgetInteraction(double eventPos[2]);
128  virtual void DistanceWidgetInteraction(double eventPos[2]);
129  int ComputeInteractionState(int X, int Y, int modify = 0) override;
130  void Highlight(int) override;
132 
134 
137  void GetActors(vtkPropCollection* propCollection) override;
138  void ReleaseGraphicsResources(vtkWindow* window) override;
139  int RenderOverlay(vtkViewport* viewPort) override;
142 
144 
148  virtual void SetHeading(double heading);
149  virtual double GetHeading();
151 
153 
157  virtual void SetTilt(double tilt);
158  virtual double GetTilt();
160 
162 
165  void SetMaximumTiltAngle(double angle);
167  void SetMinimumTiltAngle(double angle);
170 
172 
175  virtual void UpdateTilt(double deltaTilt = 0);
177 
178  virtual void EndTilt();
179 
181 
185  virtual void SetDistance(double distance);
186  virtual double GetDistance();
188 
190 
193  void SetMaximumDistance(double distance);
195  void SetMinimumDistance(double distance);
198 
200 
203  virtual void UpdateDistance(double deltaDistance = 0);
205 
206  virtual void EndDistance();
207 
208  void SetRenderer(vtkRenderer* renderer) override;
209 
210  // Enums are used to describe what is selected
212  {
213  Outside = 0,
221  DistanceAdjusting
222  };
223 #if !defined(VTK_LEGACY_REMOVE)
224  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
226 #endif
227 
228 protected:
231 
232  // Positioning the widget
235 
236  // radius values
237  double InnerRadius;
238  double OuterRadius;
239 
240  // tilt and distance rep
241 
244 
245  // Define the geometry. It is constructed in canaonical position
246  // along the x-axis and then rotated into position.
249 
255 
258 
263 
265 
266  // build the tube geometry
267  void BuildRing();
269 
270  // used for positioning etc
271  void GetCenterAndUnitRadius(int center[2], double& radius);
272 
274 
280 
282 
283  double Heading;
284  double Tilt;
285  double Distance;
286 
287 private:
289  void operator=(const vtkCompassRepresentation&) = delete;
290 };
291 
292 VTK_ABI_NAMESPACE_END
293 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:44
object to represent cell connectivity
Definition: vtkCellArray.h:185
provide a compass and distance, tilt sliders
virtual void TiltWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
static vtkCompassRepresentation * New()
Instantiate the class.
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.
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
virtual void SetDistance(double distance)
Get/Set the distance.
vtkPolyDataMapper2D * RingMapper
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
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
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.
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.
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
Definition: vtkCoordinate.h:78
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:38
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
abstract specification for renderers
Definition: vtkRenderer.h:71
An actor that displays text.
Definition: vtkTextActor.h:55
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
abstract specification for Viewports
Definition: vtkViewport.h:54
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
@ center
Definition: vtkX3D.h:230
@ radius
Definition: vtkX3D.h:252
@ string
Definition: vtkX3D.h:490
#define VTK_DEPRECATED_IN_9_2_0(reason)