VTK  9.7.1
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 "vtkInteractionWidgetsModule.h" // For export macro
28 #include "vtkSmartPointer.h" // used for SmartPointers
29 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkActor2D;
33 class vtkPoints;
34 class vtkCellArray;
35 class vtkPolyData;
37 class vtkCoordinate;
38 class vtkProperty2D;
39 class vtkPropCollection;
40 class vtkWindow;
41 class vtkViewport;
42 class vtkTransform;
43 class vtkTransformFilter;
44 class vtkTextProperty;
45 class vtkTextActor;
46 
47 class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkCompassRepresentation
49 {
50 public:
54  static vtkCompassRepresentation* New();
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
72  vtkCoordinate* GetPoint1Coordinate();
73 
82  vtkCoordinate* GetPoint2Coordinate();
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;
130  int RenderOpaqueGeometry(vtkViewport*) 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);
156  double GetMaximumTiltAngle();
157  void SetMinimumTiltAngle(double angle);
158  double GetMinimumTiltAngle();
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);
184  double GetMaximumDistance();
185  void SetMinimumDistance(double distance);
186  double GetMinimumDistance();
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
202  {
203  Outside = 0,
211  DistanceAdjusting
212  };
213 
214 protected:
216  ~vtkCompassRepresentation() override;
217 
218  // Positioning the widget
221 
222  // radius values
223  double InnerRadius;
224  double OuterRadius;
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();
254  void BuildBackdrop();
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 
273 private:
275  void operator=(const vtkCompassRepresentation&) = delete;
276 };
277 
278 VTK_ABI_NAMESPACE_END
279 #endif
void StartWidgetInteraction(double eventPos[2]) override=0
Methods to interface with the vtkSliderWidget.
vtkPolyDataMapper2D * BackdropMapper
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:46
vtkPolyDataMapper2D * RingMapper
a actor that draws 2D data
Definition: vtkActor2D.h:35
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
abstract specification for renderers
Definition: vtkRenderer.h:63
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:50
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
provide the representation for a continuous value
void WidgetInteraction(double eventPos[2]) override=0
Methods to interface with the vtkSliderWidget.
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
An actor that displays text.
Definition: vtkTextActor.h:48
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
a simple class to control print indentation
Definition: vtkIndent.h:28
int RenderOverlay(vtkViewport *viewport) override
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void Highlight(int highlightOn)
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
object to represent cell connectivity
Definition: vtkCellArray.h:177
transform points and associated normals and vectors
represent surface properties of a 2D image
Definition: vtkProperty2D.h:30
#define VTK_MARSHALAUTO
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:30
provide a compass and distance, tilt sliders
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.