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 
29 #ifndef vtkCompassRepresentation_h
30 #define vtkCompassRepresentation_h
31 
32 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
34 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
35 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
36 #include "vtkGeovisCoreModule.h" // For export macro
37 #include "vtkSmartPointer.h" // used for SmartPointers
38 
39 class vtkActor2D;
40 class vtkPoints;
41 class vtkCellArray;
42 class vtkPolyData;
44 class vtkCoordinate;
45 class vtkProperty2D;
46 class vtkPropCollection;
47 class vtkWindow;
48 class vtkViewport;
49 class vtkTransform;
51 class vtkTextProperty;
52 class vtkTextActor;
53 
55 {
56 public:
60  static vtkCompassRepresentation* New();
61 
63 
67  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
78  vtkCoordinate* GetPoint1Coordinate();
79 
88  vtkCoordinate* GetPoint2Coordinate();
89 
91 
95  vtkGetObjectMacro(RingProperty, vtkProperty2D);
97 
99 
103  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
105 
107 
110  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
112 
114 
119  void PlaceWidget(double bounds[6]) override;
120  void BuildRepresentation() override;
121  void StartWidgetInteraction(double eventPos[2]) override;
122  void WidgetInteraction(double eventPos[2]) override;
123  virtual void TiltWidgetInteraction(double eventPos[2]);
124  virtual void DistanceWidgetInteraction(double eventPos[2]);
125  int ComputeInteractionState(int X, int Y, int modify = 0) override;
126  void Highlight(int) override;
128 
130 
133  void GetActors(vtkPropCollection*) override;
134  void ReleaseGraphicsResources(vtkWindow*) override;
135  int RenderOverlay(vtkViewport*) override;
136  int RenderOpaqueGeometry(vtkViewport*) override;
138 
139  virtual void SetHeading(double value);
140  virtual double GetHeading();
141  virtual void SetTilt(double value);
142  virtual double GetTilt();
143  virtual void UpdateTilt(double time);
144  virtual void EndTilt();
145  virtual void SetDistance(double value);
146  virtual double GetDistance();
147  virtual void UpdateDistance(double time);
148  virtual void EndDistance();
149  void SetRenderer(vtkRenderer* ren) override;
150 
151  // Enums are used to describe what is selected
153  {
154  Outside = 0,
162  DistanceAdjusting
163  };
164 #if !defined(VTK_LEGACY_REMOVE)
165  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
167 #endif
168 
169 protected:
171  ~vtkCompassRepresentation() override;
172 
173  // Positioning the widget
176 
177  // radius values
178  double InnerRadius;
179  double OuterRadius;
180 
181  // tilt and distance rep
182 
185 
186  // Define the geometry. It is constructed in canaonical position
187  // along the x-axis and then rotated into position.
190 
196 
199 
204 
206 
207  // build the tube geometry
208  void BuildRing();
209  void BuildBackdrop();
210 
211  // used for positioning etc
212  void GetCenterAndUnitRadius(int center[2], double& radius);
213 
215 
216  double Heading;
217  double Tilt;
218  double Distance;
219 
220 private:
222  void operator=(const vtkCompassRepresentation&) = delete;
223 };
224 
225 #endif
void StartWidgetInteraction(double eventPos[2]) override=0
Methods to interface with the vtkSliderWidget.
vtkPolyDataMapper2D * BackdropMapper
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
vtkTransformPolyDataFilter * RingXForm
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:55
vtkPolyDataMapper2D * RingMapper
#define VTK_DEPRECATED_IN_9_2_0(reason)
a actor that draws 2D data
Definition: vtkActor2D.h:45
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
abstract specification for renderers
Definition: vtkRenderer.h:72
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
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:38
An actor that displays text.
Definition: vtkTextActor.h:56
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
a simple class to control print indentation
Definition: vtkIndent.h:39
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...
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
represent text properties.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:79
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
object to represent cell connectivity
Definition: vtkCellArray.h:186
virtual void Highlight(int vtkNotUsed(highlightOn))
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
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:39
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.