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);
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  virtual void PlaceWidget(double bounds[6]);
122  virtual void BuildRepresentation();
123  virtual void StartWidgetInteraction(double eventPos[2]);
124  virtual void WidgetInteraction(double eventPos[2]);
125  virtual void TiltWidgetInteraction(double eventPos[2]);
126  virtual void DistanceWidgetInteraction(double eventPos[2]);
127  virtual int ComputeInteractionState(int X, int Y, int modify=0);
128  virtual void Highlight(int);
130 
132 
135  virtual void GetActors(vtkPropCollection*);
136  virtual void ReleaseGraphicsResources(vtkWindow*);
137  virtual int RenderOverlay(vtkViewport*);
138  virtual int RenderOpaqueGeometry(vtkViewport*);
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  virtual void SetRenderer(vtkRenderer *ren);
152 
153  // Enums are used to describe what is selected
155  {
156  Outside=0,
164  DistanceAdjusting
165  };
166 
167 protected:
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:
219  vtkCompassRepresentation(const vtkCompassRepresentation&) VTK_DELETE_FUNCTION;
220  void operator=(const vtkCompassRepresentation&) VTK_DELETE_FUNCTION;
221 };
222 
223 #endif
vtkPolyDataMapper2D * BackdropMapper
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
void PrintSelf(ostream &os, vtkIndent indent)
Standard methods for the class.
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
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
provide the representation for a continuous value
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
An actor that displays text.
Definition: vtkTextActor.h:56
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
represent text properties.
virtual void PlaceWidget(double bounds[6])
Methods to interface with the vtkSliderWidget.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:70
object to represent cell connectivity
Definition: vtkCellArray.h:50
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void BuildRepresentation()
Methods to interface with the vtkSliderWidget.
virtual void Highlight(int vtkNotUsed(highlightOn))
virtual void StartWidgetInteraction(double eventPos[2])=0
Methods to interface with the vtkSliderWidget.
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
virtual void WidgetInteraction(double eventPos[2])=0
Methods to interface with the vtkSliderWidget.
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