VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
41 class vtkPolyDataMapper2D;
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 
53 class VTKGEOVISCORE_EXPORT vtkCompassRepresentation :
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
155  vtkCoordinate *Point1Coordinate;
156  vtkCoordinate *Point2Coordinate;
157 
158  // radius values
159  double InnerRadius;
160  double OuterRadius;
161 
162  // tilt and distance rep
163  //BTX
164  vtkSmartPointer<vtkCenteredSliderRepresentation> TiltRepresentation;
165  vtkSmartPointer<vtkCenteredSliderRepresentation> DistanceRepresentation;
166  //ETX
167 
168  // Define the geometry. It is constructed in canaonical position
169  // along the x-axis and then rotated into position.
171  vtkPoints *Points;
172 
175  vtkPolyDataMapper2D *RingMapper;
176  vtkActor2D *RingActor;
177  vtkProperty2D *RingProperty;
178 
179  vtkPolyDataMapper2D *BackdropMapper;
180  vtkActor2D *Backdrop;
181 
182  vtkTextProperty *LabelProperty;
183  vtkTextActor *LabelActor;
184  vtkTextProperty *StatusProperty;
185  vtkTextActor *StatusActor;
186 
187  vtkProperty2D *SelectedProperty;
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)
vtkPolyDataMapper2D * RingMapper
virtual void SetRenderer(vtkRenderer *ren)
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:82
virtual void ReleaseGraphicsResources(vtkWindow *)
provide the representation for a continuous value
virtual void GetActors(vtkPropCollection *)
virtual void PlaceWidget(double bounds[6])
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
virtual void WidgetInteraction(double eventPos[2])=0
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation