VTK  9.0.1
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 "vtkCenteredSliderRepresentation.h" // to use in a SP
34 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
35 #include "vtkGeovisCoreModule.h" // For export macro
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 
54 {
55 public:
60 
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
78 
88 
90 
94  vtkGetObjectMacro(RingProperty, vtkProperty2D);
96 
98 
102  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
104 
106 
109  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
111 
113 
118  void PlaceWidget(double bounds[6]) override;
119  void BuildRepresentation() override;
120  void StartWidgetInteraction(double eventPos[2]) override;
121  void WidgetInteraction(double eventPos[2]) override;
122  virtual void TiltWidgetInteraction(double eventPos[2]);
123  virtual void DistanceWidgetInteraction(double eventPos[2]);
124  int ComputeInteractionState(int X, int Y, int modify = 0) override;
125  void Highlight(int) override;
127 
129 
132  void GetActors(vtkPropCollection*) override;
134  int RenderOverlay(vtkViewport*) override;
137 
138  virtual void SetHeading(double value);
139  virtual double GetHeading();
140  virtual void SetTilt(double value);
141  virtual double GetTilt();
142  virtual void UpdateTilt(double time);
143  virtual void EndTilt();
144  virtual void SetDistance(double value);
145  virtual double GetDistance();
146  virtual void UpdateDistance(double time);
147  virtual void EndDistance();
148  void SetRenderer(vtkRenderer* ren) override;
149 
150  // Enums are used to describe what is selected
152  {
153  Outside = 0,
161  DistanceAdjusting
162  };
163 
164 protected:
167 
168  // Positioning the widget
171 
172  // radius values
173  double InnerRadius;
174  double OuterRadius;
175 
176  // tilt and distance rep
177 
180 
181  // Define the geometry. It is constructed in canaonical position
182  // along the x-axis and then rotated into position.
185 
191 
194 
199 
201 
202  // build the tube geometry
203  void BuildRing();
205 
206  // used for positioning etc
207  void GetCenterAndUnitRadius(int center[2], double& radius);
208 
210 
211  double Heading;
212  double Tilt;
213  double Distance;
214 
215 private:
217  void operator=(const vtkCompassRepresentation&) = delete;
218 };
219 
220 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkCompassRepresentation::TiltAdjusting
@ TiltAdjusting
Definition: vtkCompassRepresentation.h:158
vtkCompassRepresentation::_InteractionState
_InteractionState
Definition: vtkCompassRepresentation.h:152
vtkCompassRepresentation::Distance
double Distance
Definition: vtkCompassRepresentation.h:213
vtkCompassRepresentation::SetRenderer
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:45
vtkCompassRepresentation::StatusActor
vtkTextActor * StatusActor
Definition: vtkCompassRepresentation.h:198
vtkCompassRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double eventPos[2]) override
vtkCompassRepresentation::UpdateTilt
virtual void UpdateTilt(double time)
vtkCompassRepresentation::GetActors
void GetActors(vtkPropCollection *) override
Methods supporting the rendering process.
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkCompassRepresentation::New
static vtkCompassRepresentation * New()
Instantiate the class.
vtkCompassRepresentation::~vtkCompassRepresentation
~vtkCompassRepresentation() override
vtkCompassRepresentation::BuildRing
void BuildRing()
vtkCompassRepresentation::Highlight
void Highlight(int) override
vtkCompassRepresentation::SetHeading
virtual void SetHeading(double value)
vtkCompassRepresentation::SetTilt
virtual void SetTilt(double value)
vtkCompassRepresentation::SelectedProperty
vtkProperty2D * SelectedProperty
Definition: vtkCompassRepresentation.h:200
vtkCompassRepresentation::EndTilt
virtual void EndTilt()
vtkCenteredSliderRepresentation.h
vtkSmartPointer< vtkCenteredSliderRepresentation >
vtkCompassRepresentation::GetPoint2Coordinate
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
vtkCompassRepresentation::DistanceWidgetInteraction
virtual void DistanceWidgetInteraction(double eventPos[2])
vtkCompassRepresentation::BuildRepresentation
void BuildRepresentation() override
vtkX3D::center
@ center
Definition: vtkX3D.h:236
vtkCompassRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
vtkCompassRepresentation::TiltRepresentation
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
Definition: vtkCompassRepresentation.h:178
vtkX3D::time
@ time
Definition: vtkX3D.h:503
vtkCompassRepresentation::InnerRadius
double InnerRadius
Definition: vtkCompassRepresentation.h:173
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
vtkCompassRepresentation::WidgetInteraction
void WidgetInteraction(double eventPos[2]) override
vtkCompassRepresentation::RingMapper
vtkPolyDataMapper2D * RingMapper
Definition: vtkCompassRepresentation.h:188
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkCompassRepresentation::RingActor
vtkActor2D * RingActor
Definition: vtkCompassRepresentation.h:189
vtkCompassRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *) override
vtkCompassRepresentation::RingProperty
vtkProperty2D * RingProperty
Definition: vtkCompassRepresentation.h:190
vtkCompassRepresentation::HighlightState
int HighlightState
Definition: vtkCompassRepresentation.h:209
vtkCompassRepresentation::DistanceRepresentation
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
Definition: vtkCompassRepresentation.h:179
vtkContinuousValueWidgetRepresentation
provide the representation for a continuous value
Definition: vtkContinuousValueWidgetRepresentation.h:38
vtkCompassRepresentation::DistanceIn
@ DistanceIn
Definition: vtkCompassRepresentation.h:160
vtkCompassRepresentation::Backdrop
vtkActor2D * Backdrop
Definition: vtkCompassRepresentation.h:193
vtkCompassRepresentation::Heading
double Heading
Definition: vtkCompassRepresentation.h:211
vtkCompassRepresentation::Point2Coordinate
vtkCoordinate * Point2Coordinate
Definition: vtkCompassRepresentation.h:170
vtkTextActor
An actor that displays text.
Definition: vtkTextActor.h:51
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkCompassRepresentation::GetDistance
virtual double GetDistance()
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
vtkCompassRepresentation::Point1Coordinate
vtkCoordinate * Point1Coordinate
Definition: vtkCompassRepresentation.h:169
vtkSmartPointer.h
vtkCompassRepresentation::Inside
@ Inside
Definition: vtkCompassRepresentation.h:154
vtkCompassRepresentation::EndDistance
virtual void EndDistance()
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
vtkCompassRepresentation::BackdropMapper
vtkPolyDataMapper2D * BackdropMapper
Definition: vtkCompassRepresentation.h:192
vtkCompassRepresentation::UpdateDistance
virtual void UpdateDistance(double time)
vtkContinuousValueWidgetRepresentation.h
vtkCompassRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:46
vtkCompassRepresentation::Tilt
double Tilt
Definition: vtkCompassRepresentation.h:212
vtkCompassRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:45
vtkCoordinate.h
vtkCompassRepresentation::DistanceOut
@ DistanceOut
Definition: vtkCompassRepresentation.h:159
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:34
vtkCompassRepresentation::TiltUp
@ TiltUp
Definition: vtkCompassRepresentation.h:157
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:38
vtkCompassRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkCompassRepresentation::Adjusting
@ Adjusting
Definition: vtkCompassRepresentation.h:155
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:40
vtkCompassRepresentation::PlaceWidget
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkCompassRepresentation::LabelActor
vtkTextActor * LabelActor
Definition: vtkCompassRepresentation.h:196
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkCompassRepresentation::Ring
vtkPolyData * Ring
Definition: vtkCompassRepresentation.h:186
vtkCompassRepresentation::TiltWidgetInteraction
virtual void TiltWidgetInteraction(double eventPos[2])
vtkCompassRepresentation::vtkCompassRepresentation
vtkCompassRepresentation()
vtkCompassRepresentation
provide a compass
Definition: vtkCompassRepresentation.h:54
vtkCompassRepresentation::GetHeading
virtual double GetHeading()
vtkCompassRepresentation::Points
vtkPoints * Points
Definition: vtkCompassRepresentation.h:184
vtkCompassRepresentation::LabelProperty
vtkTextProperty * LabelProperty
Definition: vtkCompassRepresentation.h:195
vtkCompassRepresentation::RingXForm
vtkTransformPolyDataFilter * RingXForm
Definition: vtkCompassRepresentation.h:187
vtkCompassRepresentation::XForm
vtkTransform * XForm
Definition: vtkCompassRepresentation.h:183
vtkCompassRepresentation::TiltDown
@ TiltDown
Definition: vtkCompassRepresentation.h:156
vtkCompassRepresentation::GetPoint1Coordinate
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:36
vtkX3D::radius
@ radius
Definition: vtkX3D.h:258
vtkCompassRepresentation::OuterRadius
double OuterRadius
Definition: vtkCompassRepresentation.h:174
vtkCompassRepresentation::GetTilt
virtual double GetTilt()
vtkCompassRepresentation::StatusProperty
vtkTextProperty * StatusProperty
Definition: vtkCompassRepresentation.h:197
vtkCompassRepresentation::SetDistance
virtual void SetDistance(double value)
vtkCompassRepresentation::GetCenterAndUnitRadius
void GetCenterAndUnitRadius(int center[2], double &radius)
vtkCompassRepresentation::BuildBackdrop
void BuildBackdrop()