VTK  9.2.6
vtkCompassRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCompassRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 /*-------------------------------------------------------------------------
17  Copyright 2008 Sandia Corporation.
18  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
19  the U.S. Government retains certain rights in this software.
20 -------------------------------------------------------------------------*/
21 
38 #ifndef vtkCompassRepresentation_h
39 #define vtkCompassRepresentation_h
40 
41 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
43 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
44 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
45 #include "vtkGeovisCoreModule.h" // For export macro
46 #include "vtkSmartPointer.h" // used for SmartPointers
47 
48 class vtkActor2D;
49 class vtkPoints;
50 class vtkCellArray;
51 class vtkPolyData;
53 class vtkCoordinate;
54 class vtkProperty2D;
55 class vtkPropCollection;
56 class vtkWindow;
57 class vtkViewport;
58 class vtkTransform;
60 class vtkTextProperty;
61 class vtkTextActor;
62 
64 {
65 public:
70 
72 
76  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
88 
98 
100 
104  vtkGetObjectMacro(RingProperty, vtkProperty2D);
106 
108 
112  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
114 
116 
119  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
121 
123 
128  void PlaceWidget(double bounds[6]) override;
129  void BuildRepresentation() override;
130  void StartWidgetInteraction(double eventPos[2]) override;
131  void WidgetInteraction(double eventPos[2]) override;
132  virtual void TiltWidgetInteraction(double eventPos[2]);
133  virtual void DistanceWidgetInteraction(double eventPos[2]);
134  int ComputeInteractionState(int X, int Y, int modify = 0) override;
135  void Highlight(int) override;
137 
139 
142  void GetActors(vtkPropCollection*) override;
144  int RenderOverlay(vtkViewport*) override;
147 
148  virtual void SetHeading(double value);
149  virtual double GetHeading();
150  virtual void SetTilt(double value);
151  virtual double GetTilt();
152  virtual void UpdateTilt(double time);
153  virtual void EndTilt();
154  virtual void SetDistance(double value);
155  virtual double GetDistance();
156  virtual void UpdateDistance(double time);
157  virtual void EndDistance();
158  void SetRenderer(vtkRenderer* ren) override;
159 
160  // Enums are used to describe what is selected
162  {
163  Outside = 0,
171  DistanceAdjusting
172  };
173 #if !defined(VTK_LEGACY_REMOVE)
174  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
176 #endif
177 
178 protected:
181 
182  // Positioning the widget
185 
186  // radius values
187  double InnerRadius;
188  double OuterRadius;
189 
190  // tilt and distance rep
191 
194 
195  // Define the geometry. It is constructed in canaonical position
196  // along the x-axis and then rotated into position.
199 
205 
208 
213 
215 
216  // build the tube geometry
217  void BuildRing();
219 
220  // used for positioning etc
221  void GetCenterAndUnitRadius(int center[2], double& radius);
222 
224 
225  double Heading;
226  double Tilt;
227  double Distance;
228 
229 private:
231  void operator=(const vtkCompassRepresentation&) = delete;
232 };
233 
234 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:55
object to represent cell connectivity
Definition: vtkCellArray.h:196
virtual void TiltWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
virtual void SetTilt(double value)
static vtkCompassRepresentation * New()
Instantiate the class.
virtual double GetDistance()
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
virtual void SetHeading(double value)
virtual void UpdateTilt(double time)
virtual double GetHeading()
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
vtkPolyDataMapper2D * RingMapper
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
virtual void EndDistance()
virtual void SetDistance(double value)
void GetCenterAndUnitRadius(int center[2], double &radius)
int RenderOverlay(vtkViewport *) override
Methods supporting the rendering process.
void WidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
~vtkCompassRepresentation() override
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to interface with the vtkSliderWidget.
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.
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkWidgetRepresentation must implement these methods.
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()
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
void GetActors(vtkPropCollection *) override
Methods supporting the rendering process.
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
virtual void UpdateDistance(double time)
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkPolyDataMapper2D * BackdropMapper
provide the representation for a continuous value
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:89
a simple class to control print indentation
Definition: vtkIndent.h:49
represent and manipulate 3D points
Definition: vtkPoints.h:49
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:100
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:50
abstract specification for renderers
Definition: vtkRenderer.h:82
An actor that displays text.
Definition: vtkTextActor.h:66
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:70
abstract specification for Viewports
Definition: vtkViewport.h:65
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
@ value
Definition: vtkX3D.h:226
@ time
Definition: vtkX3D.h:503
@ center
Definition: vtkX3D.h:236
@ radius
Definition: vtkX3D.h:258
#define VTK_DEPRECATED_IN_9_2_0(reason)