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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkCompassRepresentation::TiltAdjusting
Definition: vtkCompassRepresentation.h:161
vtkWidgetRepresentation::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
Definition: vtkWidgetRepresentation.h:217
vtkCompassRepresentation::_InteractionState
_InteractionState
Definition: vtkCompassRepresentation.h:154
vtkCompassRepresentation::Distance
double Distance
Definition: vtkCompassRepresentation.h:216
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkCompassRepresentation::StatusActor
vtkTextActor * StatusActor
Definition: vtkCompassRepresentation.h:201
vtkX3D::value
Definition: vtkX3D.h:220
vtkContinuousValueWidgetRepresentation::WidgetInteraction
void WidgetInteraction(double eventPos[2]) override=0
vtkWidgetRepresentation::SetRenderer
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkCompassRepresentation::SelectedProperty
vtkProperty2D * SelectedProperty
Definition: vtkCompassRepresentation.h:203
vtkCenteredSliderRepresentation.h
vtkSmartPointer< vtkCenteredSliderRepresentation >
vtkX3D::center
Definition: vtkX3D.h:230
vtkCompassRepresentation::TiltRepresentation
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
Definition: vtkCompassRepresentation.h:181
vtkContinuousValueWidgetRepresentation::BuildRepresentation
void BuildRepresentation() override
Definition: vtkContinuousValueWidgetRepresentation.h:56
vtkX3D::time
Definition: vtkX3D.h:497
vtkCompassRepresentation::InnerRadius
double InnerRadius
Definition: vtkCompassRepresentation.h:176
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkCompassRepresentation::RingMapper
vtkPolyDataMapper2D * RingMapper
Definition: vtkCompassRepresentation.h:191
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkCompassRepresentation::RingActor
vtkActor2D * RingActor
Definition: vtkCompassRepresentation.h:192
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:220
vtkCompassRepresentation::RingProperty
vtkProperty2D * RingProperty
Definition: vtkCompassRepresentation.h:193
vtkCompassRepresentation::HighlightState
int HighlightState
Definition: vtkCompassRepresentation.h:212
vtkCompassRepresentation::DistanceRepresentation
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
Definition: vtkCompassRepresentation.h:182
vtkContinuousValueWidgetRepresentation
provide the representation for a continuous value
Definition: vtkContinuousValueWidgetRepresentation.h:36
vtkCompassRepresentation::DistanceIn
Definition: vtkCompassRepresentation.h:163
vtkCompassRepresentation::Backdrop
vtkActor2D * Backdrop
Definition: vtkCompassRepresentation.h:196
vtkCompassRepresentation::Heading
double Heading
Definition: vtkCompassRepresentation.h:214
vtkCompassRepresentation::Point2Coordinate
vtkCoordinate * Point2Coordinate
Definition: vtkCompassRepresentation.h:173
vtkTextActor
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:56
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkCompassRepresentation::Point1Coordinate
vtkCoordinate * Point1Coordinate
Definition: vtkCompassRepresentation.h:172
vtkSmartPointer.h
vtkCompassRepresentation::Inside
Definition: vtkCompassRepresentation.h:157
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:81
vtkCompassRepresentation::BackdropMapper
vtkPolyDataMapper2D * BackdropMapper
Definition: vtkCompassRepresentation.h:195
vtkContinuousValueWidgetRepresentation.h
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkCompassRepresentation::Tilt
double Tilt
Definition: vtkCompassRepresentation.h:215
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkContinuousValueWidgetRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double eventPos[2]) override=0
vtkCoordinate.h
vtkCompassRepresentation::DistanceOut
Definition: vtkCompassRepresentation.h:162
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkCompassRepresentation::TiltUp
Definition: vtkCompassRepresentation.h:160
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkCompassRepresentation::Adjusting
Definition: vtkCompassRepresentation.h:158
vtkContinuousValueWidgetRepresentation::PlaceWidget
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkWidgetRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:221
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:222
vtkContinuousValueWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkCompassRepresentation::LabelActor
vtkTextActor * LabelActor
Definition: vtkCompassRepresentation.h:199
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkCompassRepresentation::Ring
vtkPolyData * Ring
Definition: vtkCompassRepresentation.h:189
vtkCompassRepresentation
provide a compass
Definition: vtkCompassRepresentation.h:54
vtkCompassRepresentation::Points
vtkPoints * Points
Definition: vtkCompassRepresentation.h:187
vtkCompassRepresentation::LabelProperty
vtkTextProperty * LabelProperty
Definition: vtkCompassRepresentation.h:198
vtkCompassRepresentation::RingXForm
vtkTransformPolyDataFilter * RingXForm
Definition: vtkCompassRepresentation.h:190
vtkCompassRepresentation::XForm
vtkTransform * XForm
Definition: vtkCompassRepresentation.h:186
vtkCompassRepresentation::TiltDown
Definition: vtkCompassRepresentation.h:159
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
vtkX3D::radius
Definition: vtkX3D.h:252
vtkCompassRepresentation::OuterRadius
double OuterRadius
Definition: vtkCompassRepresentation.h:177
vtkCompassRepresentation::StatusProperty
vtkTextProperty * StatusProperty
Definition: vtkCompassRepresentation.h:200
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkWidgetRepresentation::Highlight
virtual void Highlight(int vtkNotUsed(highlightOn))
Definition: vtkWidgetRepresentation.h:142