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 
32 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
33 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
34 #include "vtkSmartPointer.h" // used for SmartPointers
35 
36 class vtkActor2D;
37 class vtkPoints;
38 class vtkCellArray;
39 class vtkPolyData;
41 class vtkCoordinate;
42 class vtkProperty2D;
43 class vtkPropCollection;
44 class vtkWindow;
45 class vtkViewport;
46 class vtkTransform;
48 class vtkTextProperty;
49 class vtkTextActor;
50 
51 
54 {
55 public:
57  static vtkCompassRepresentation *New();
58 
60 
61  vtkTypeMacro(vtkCompassRepresentation,
63  void PrintSelf(ostream& os, vtkIndent indent);
65 
72  vtkCoordinate *GetPoint1Coordinate();
73 
80  vtkCoordinate *GetPoint2Coordinate();
81 
83 
85  vtkGetObjectMacro(RingProperty,vtkProperty2D);
87 
89 
91  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
93 
95 
96  vtkGetObjectMacro(LabelProperty,vtkTextProperty);
98 
100 
103  virtual void PlaceWidget(double bounds[6]);
104  virtual void BuildRepresentation();
105  virtual void StartWidgetInteraction(double eventPos[2]);
106  virtual void WidgetInteraction(double eventPos[2]);
107  virtual void TiltWidgetInteraction(double eventPos[2]);
108  virtual void DistanceWidgetInteraction(double eventPos[2]);
109  virtual int ComputeInteractionState(int X, int Y, int modify=0);
110  virtual void Highlight(int);
112 
114 
115  virtual void GetActors(vtkPropCollection*);
116  virtual void ReleaseGraphicsResources(vtkWindow*);
117  virtual int RenderOverlay(vtkViewport*);
118  virtual int RenderOpaqueGeometry(vtkViewport*);
120 
121  virtual void SetHeading(double value);
122  virtual double GetHeading();
123  virtual void SetTilt(double value);
124  virtual double GetTilt();
125  virtual void UpdateTilt(double time);
126  virtual void EndTilt();
127  virtual void SetDistance(double value);
128  virtual double GetDistance();
129  virtual void UpdateDistance(double time);
130  virtual void EndDistance();
131  virtual void SetRenderer(vtkRenderer *ren);
132 
133 //BTX
134  // Enums are used to describe what is selected
136  {
137  Outside=0,
145  DistanceAdjusting
146  };
147 //ETX
148 
149 protected:
152 
153  // Positioning the widget
156 
157  // radius values
158  double InnerRadius;
159  double OuterRadius;
160 
161  // tilt and distance rep
162  //BTX
165  //ETX
166 
167  // Define the geometry. It is constructed in canaonical position
168  // along the x-axis and then rotated into position.
171 
177 
180 
185 
187 
188  // build the tube geometry
189  void BuildRing();
190  void BuildBackdrop();
191 
192  // used for positioning etc
193  void GetCenterAndUnitRadius(int center[2], double &radius);
194 
196 
197  double Heading;
198  double Tilt;
199  double Distance;
200 
201 private:
202  vtkCompassRepresentation(const vtkCompassRepresentation&); //Not implemented
203  void operator=(const vtkCompassRepresentation&); //Not implemented
204 };
205 
206 #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:45
vtkPolyDataMapper2D * RingMapper
a actor that draws 2D data
Definition: vtkActor2D.h:43
virtual void SetRenderer(vtkRenderer *ren)
abstract specification for renderers
Definition: vtkRenderer.h:69
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:81
virtual void ReleaseGraphicsResources(vtkWindow *)
provide the representation for a continuous value
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_GEOVIS_EXPORT
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:68
object to represent cell connectivity
Definition: vtkCellArray.h:48
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:38
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