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 
28 #ifndef vtkCompassRepresentation_h
29 #define vtkCompassRepresentation_h
30 
31 #include "vtkGeovisCoreModule.h" // For export macro
33 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
34 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
35 #include "vtkSmartPointer.h" // used for SmartPointers
36 
37 class vtkActor2D;
38 class vtkPoints;
39 class vtkCellArray;
40 class vtkPolyData;
42 class vtkCoordinate;
43 class vtkProperty2D;
44 class vtkPropCollection;
45 class vtkWindow;
46 class vtkViewport;
47 class vtkTransform;
49 class vtkTextProperty;
50 class vtkTextActor;
51 
52 
55 {
56 public:
58  static vtkCompassRepresentation *New();
59 
61 
62  vtkTypeMacro(vtkCompassRepresentation,
64  void PrintSelf(ostream& os, vtkIndent indent);
66 
73  vtkCoordinate *GetPoint1Coordinate();
74 
81  vtkCoordinate *GetPoint2Coordinate();
82 
84 
86  vtkGetObjectMacro(RingProperty,vtkProperty2D);
88 
90 
92  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
94 
96 
97  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
99 
101 
104  virtual void PlaceWidget(double bounds[6]);
105  virtual void BuildRepresentation();
106  virtual void StartWidgetInteraction(double eventPos[2]);
107  virtual void WidgetInteraction(double eventPos[2]);
108  virtual void TiltWidgetInteraction(double eventPos[2]);
109  virtual void DistanceWidgetInteraction(double eventPos[2]);
110  virtual int ComputeInteractionState(int X, int Y, int modify=0);
111  virtual void Highlight(int);
113 
115 
116  virtual void GetActors(vtkPropCollection*);
117  virtual void ReleaseGraphicsResources(vtkWindow*);
118  virtual int RenderOverlay(vtkViewport*);
119  virtual int RenderOpaqueGeometry(vtkViewport*);
121 
122  virtual void SetHeading(double value);
123  virtual double GetHeading();
124  virtual void SetTilt(double value);
125  virtual double GetTilt();
126  virtual void UpdateTilt(double time);
127  virtual void EndTilt();
128  virtual void SetDistance(double value);
129  virtual double GetDistance();
130  virtual void UpdateDistance(double time);
131  virtual void EndDistance();
132  virtual void SetRenderer(vtkRenderer *ren);
133 
134 //BTX
135  // Enums are used to describe what is selected
137  {
138  Outside=0,
146  DistanceAdjusting
147  };
148 //ETX
149 
150 protected:
153 
154  // Positioning the widget
157 
158  // radius values
159  double InnerRadius;
160  double OuterRadius;
161 
162  // tilt and distance rep
163  //BTX
166  //ETX
167 
168  // Define the geometry. It is constructed in canaonical position
169  // along the x-axis and then rotated into position.
172 
178 
181 
186 
188 
189  // build the tube geometry
190  void BuildRing();
191  void BuildBackdrop();
192 
193  // used for positioning etc
194  void GetCenterAndUnitRadius(int center[2], double &radius);
195 
197 
198  double Heading;
199  double Tilt;
200  double Distance;
201 
202 private:
203  vtkCompassRepresentation(const vtkCompassRepresentation&); //Not implemented
204  void operator=(const vtkCompassRepresentation&); //Not implemented
205 };
206 
207 #endif
vtkPolyDataMapper2D * BackdropMapper
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
void PrintSelf(ostream &os, vtkIndent indent)
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
vtkTransformPolyDataFilter * RingXForm
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:44
virtual void SetRenderer(vtkRenderer *ren)
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:59
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
virtual void ReleaseGraphicsResources(vtkWindow *)
provide the representation for a continuous value
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void GetActors(vtkPropCollection *)
represent text properties.
virtual void PlaceWidget(double bounds[6])
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
#define VTKGEOVISCORE_EXPORT
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual void StartWidgetInteraction(double eventPos[2])=0
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
virtual void WidgetInteraction(double eventPos[2])=0
static vtkObject * New()
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:38