VTK
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 "vtkGeovisCoreModule.h" // For export macro
34 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
35 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
36 #include "vtkSmartPointer.h" // used for SmartPointers
37 
38 class vtkActor2D;
39 class vtkPoints;
40 class vtkCellArray;
41 class vtkPolyData;
43 class vtkCoordinate;
44 class vtkProperty2D;
45 class vtkPropCollection;
46 class vtkWindow;
47 class vtkViewport;
48 class vtkTransform;
50 class vtkTextProperty;
51 class vtkTextActor;
52 
53 
54 class VTKGEOVISCORE_EXPORT vtkCompassRepresentation :
56 {
57 public:
61  static vtkCompassRepresentation *New();
62 
64 
67  vtkTypeMacro(vtkCompassRepresentation,
69  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
80  vtkCoordinate *GetPoint1Coordinate();
81 
90  vtkCoordinate *GetPoint2Coordinate();
91 
93 
97  vtkGetObjectMacro(RingProperty,vtkProperty2D);
99 
101 
105  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
107 
109 
112  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
114 
116 
121  void PlaceWidget(double bounds[6]) override;
122  void BuildRepresentation() override;
123  void StartWidgetInteraction(double eventPos[2]) override;
124  void WidgetInteraction(double eventPos[2]) override;
125  virtual void TiltWidgetInteraction(double eventPos[2]);
126  virtual void DistanceWidgetInteraction(double eventPos[2]);
127  int ComputeInteractionState(int X, int Y, int modify=0) override;
128  void Highlight(int) override;
130 
132 
135  void GetActors(vtkPropCollection*) override;
136  void ReleaseGraphicsResources(vtkWindow*) override;
137  int RenderOverlay(vtkViewport*) override;
138  int RenderOpaqueGeometry(vtkViewport*) override;
140 
141  virtual void SetHeading(double value);
142  virtual double GetHeading();
143  virtual void SetTilt(double value);
144  virtual double GetTilt();
145  virtual void UpdateTilt(double time);
146  virtual void EndTilt();
147  virtual void SetDistance(double value);
148  virtual double GetDistance();
149  virtual void UpdateDistance(double time);
150  virtual void EndDistance();
151  void SetRenderer(vtkRenderer *ren) override;
152 
153  // Enums are used to describe what is selected
155  {
156  Outside=0,
164  DistanceAdjusting
165  };
166 
167 protected:
169  ~vtkCompassRepresentation() override;
170 
171  // Positioning the widget
174 
175  // radius values
176  double InnerRadius;
177  double OuterRadius;
178 
179  // tilt and distance rep
180 
183 
184  // Define the geometry. It is constructed in canaonical position
185  // along the x-axis and then rotated into position.
188 
194 
197 
202 
204 
205  // build the tube geometry
206  void BuildRing();
207  void BuildBackdrop();
208 
209  // used for positioning etc
210  void GetCenterAndUnitRadius(int center[2], double &radius);
211 
213 
214  double Heading;
215  double Tilt;
216  double Distance;
217 
218 private:
220  void operator=(const vtkCompassRepresentation&) = delete;
221 };
222 
223 #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:47
vtkPolyDataMapper2D * RingMapper
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:63
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:85
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:37
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:81
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
object to represent cell connectivity
Definition: vtkCellArray.h:50
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.