VTK  9.1.0
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 
48 #ifndef vtkCompassRepresentation_h
49 #define vtkCompassRepresentation_h
50 
51 #include "vtkCenteredSliderRepresentation.h" // to use in a SP
53 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
54 #include "vtkGeovisCoreModule.h" // For export macro
55 #include "vtkSmartPointer.h" // used for SmartPointers
56 
57 class vtkActor2D;
58 class vtkPoints;
59 class vtkCellArray;
60 class vtkPolyData;
62 class vtkCoordinate;
63 class vtkProperty2D;
64 class vtkPropCollection;
65 class vtkWindow;
66 class vtkViewport;
67 class vtkTransform;
69 class vtkTextProperty;
70 class vtkTextActor;
71 
73 {
74 public:
79 
81 
85  void PrintSelf(ostream& os, vtkIndent indent) override;
87 
97 
107 
109 
113  vtkGetObjectMacro(RingProperty, vtkProperty2D);
115 
117 
121  vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
123 
125 
128  vtkGetObjectMacro(LabelProperty, vtkTextProperty);
130 
132 
137  void PlaceWidget(double bounds[6]) override;
138  void BuildRepresentation() override;
139  void StartWidgetInteraction(double eventPos[2]) override;
140  void WidgetInteraction(double eventPos[2]) override;
141  virtual void TiltWidgetInteraction(double eventPos[2]);
142  virtual void DistanceWidgetInteraction(double eventPos[2]);
143  int ComputeInteractionState(int X, int Y, int modify = 0) override;
144  void Highlight(int) override;
146 
148 
151  void GetActors(vtkPropCollection*) override;
153  int RenderOverlay(vtkViewport*) override;
156 
157  virtual void SetHeading(double value);
158  virtual double GetHeading();
159  virtual void SetTilt(double value);
160  virtual double GetTilt();
161  virtual void UpdateTilt(double time);
162  virtual void EndTilt();
163  virtual void SetDistance(double value);
164  virtual double GetDistance();
165  virtual void UpdateDistance(double time);
166  virtual void EndDistance();
167  void SetRenderer(vtkRenderer* ren) override;
168 
169  // Enums are used to describe what is selected
171  {
172  Outside = 0,
180  DistanceAdjusting
181  };
182 
183 protected:
186 
187  // Positioning the widget
190 
191  // radius values
192  double InnerRadius;
193  double OuterRadius;
194 
195  // tilt and distance rep
196 
199 
200  // Define the geometry. It is constructed in canaonical position
201  // along the x-axis and then rotated into position.
204 
210 
213 
218 
220 
221  // build the tube geometry
222  void BuildRing();
224 
225  // used for positioning etc
226  void GetCenterAndUnitRadius(int center[2], double& radius);
227 
229 
230  double Heading;
231  double Tilt;
232  double Distance;
233 
234 private:
236  void operator=(const vtkCompassRepresentation&) = delete;
237 };
238 
239 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkCompassRepresentation::TiltAdjusting
@ TiltAdjusting
Definition: vtkCompassRepresentation.h:177
vtkCompassRepresentation::_InteractionState
_InteractionState
Definition: vtkCompassRepresentation.h:171
vtkCompassRepresentation::Distance
double Distance
Definition: vtkCompassRepresentation.h:232
vtkCompassRepresentation::SetRenderer
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:154
vtkCompassRepresentation::StatusActor
vtkTextActor * StatusActor
Definition: vtkCompassRepresentation.h:217
vtkCompassRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
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
Methods to interface with the vtkSliderWidget.
vtkCompassRepresentation::SetHeading
virtual void SetHeading(double value)
vtkCompassRepresentation::SetTilt
virtual void SetTilt(double value)
vtkCompassRepresentation::SelectedProperty
vtkProperty2D * SelectedProperty
Definition: vtkCompassRepresentation.h:219
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])
Methods to interface with the vtkSliderWidget.
vtkCompassRepresentation::BuildRepresentation
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
vtkX3D::center
@ center
Definition: vtkX3D.h:236
vtkCompassRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to interface with the vtkSliderWidget.
vtkCompassRepresentation::TiltRepresentation
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
Definition: vtkCompassRepresentation.h:197
vtkX3D::time
@ time
Definition: vtkX3D.h:503
vtkCompassRepresentation::InnerRadius
double InnerRadius
Definition: vtkCompassRepresentation.h:192
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:164
vtkCompassRepresentation::WidgetInteraction
void WidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
vtkCompassRepresentation::RingMapper
vtkPolyDataMapper2D * RingMapper
Definition: vtkCompassRepresentation.h:207
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkCompassRepresentation::RingActor
vtkActor2D * RingActor
Definition: vtkCompassRepresentation.h:208
vtkCompassRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *) override
Methods supporting the rendering process.
vtkCompassRepresentation::RingProperty
vtkProperty2D * RingProperty
Definition: vtkCompassRepresentation.h:209
vtkCompassRepresentation::HighlightState
int HighlightState
Definition: vtkCompassRepresentation.h:228
vtkCompassRepresentation::DistanceRepresentation
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
Definition: vtkCompassRepresentation.h:198
vtkContinuousValueWidgetRepresentation
provide the representation for a continuous value
Definition: vtkContinuousValueWidgetRepresentation.h:38
vtkCompassRepresentation::DistanceIn
@ DistanceIn
Definition: vtkCompassRepresentation.h:179
vtkCompassRepresentation::Backdrop
vtkActor2D * Backdrop
Definition: vtkCompassRepresentation.h:212
vtkCompassRepresentation::Heading
double Heading
Definition: vtkCompassRepresentation.h:230
vtkCompassRepresentation::Point2Coordinate
vtkCoordinate * Point2Coordinate
Definition: vtkCompassRepresentation.h:189
vtkTextActor
An actor that displays text.
Definition: vtkTextActor.h:160
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkCompassRepresentation::GetDistance
virtual double GetDistance()
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:290
vtkCompassRepresentation::Point1Coordinate
vtkCoordinate * Point1Coordinate
Definition: vtkCompassRepresentation.h:188
vtkSmartPointer.h
vtkCompassRepresentation::Inside
@ Inside
Definition: vtkCompassRepresentation.h:173
vtkCompassRepresentation::EndDistance
virtual void EndDistance()
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:186
vtkCompassRepresentation::BackdropMapper
vtkPolyDataMapper2D * BackdropMapper
Definition: vtkCompassRepresentation.h:211
vtkCompassRepresentation::UpdateDistance
virtual void UpdateDistance(double time)
vtkContinuousValueWidgetRepresentation.h
vtkCompassRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:155
vtkCompassRepresentation::Tilt
double Tilt
Definition: vtkCompassRepresentation.h:231
vtkCompassRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkCoordinate.h
vtkCompassRepresentation::DistanceOut
@ DistanceOut
Definition: vtkCompassRepresentation.h:178
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:143
vtkCompassRepresentation::TiltUp
@ TiltUp
Definition: vtkCompassRepresentation.h:176
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:147
vtkCompassRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
vtkCompassRepresentation::Adjusting
@ Adjusting
Definition: vtkCompassRepresentation.h:174
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:149
vtkCompassRepresentation::PlaceWidget
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkCompassRepresentation::LabelActor
vtkTextActor * LabelActor
Definition: vtkCompassRepresentation.h:215
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkCompassRepresentation::Ring
vtkPolyData * Ring
Definition: vtkCompassRepresentation.h:205
vtkCompassRepresentation::TiltWidgetInteraction
virtual void TiltWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
vtkCompassRepresentation::vtkCompassRepresentation
vtkCompassRepresentation()
vtkCompassRepresentation
provide a compass
Definition: vtkCompassRepresentation.h:73
vtkCompassRepresentation::GetHeading
virtual double GetHeading()
vtkCompassRepresentation::Points
vtkPoints * Points
Definition: vtkCompassRepresentation.h:203
vtkCompassRepresentation::LabelProperty
vtkTextProperty * LabelProperty
Definition: vtkCompassRepresentation.h:214
vtkCompassRepresentation::RingXForm
vtkTransformPolyDataFilter * RingXForm
Definition: vtkCompassRepresentation.h:206
vtkCompassRepresentation::XForm
vtkTransform * XForm
Definition: vtkCompassRepresentation.h:202
vtkCompassRepresentation::TiltDown
@ TiltDown
Definition: vtkCompassRepresentation.h:175
vtkCompassRepresentation::GetPoint1Coordinate
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkX3D::radius
@ radius
Definition: vtkX3D.h:258
vtkCompassRepresentation::OuterRadius
double OuterRadius
Definition: vtkCompassRepresentation.h:193
vtkCompassRepresentation::GetTilt
virtual double GetTilt()
vtkCompassRepresentation::StatusProperty
vtkTextProperty * StatusProperty
Definition: vtkCompassRepresentation.h:216
vtkCompassRepresentation::SetDistance
virtual void SetDistance(double value)
vtkCompassRepresentation::GetCenterAndUnitRadius
void GetCenterAndUnitRadius(int center[2], double &radius)
vtkCompassRepresentation::BuildBackdrop
void BuildBackdrop()