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
38#ifndef vtkCompassRepresentation_h
39#define vtkCompassRepresentation_h
40
41#include "vtkCenteredSliderRepresentation.h" // to use in a SP
43#include "vtkCoordinate.h" // For vtkViewportCoordinateMacro
44#include "vtkGeovisCoreModule.h" // For export macro
45#include "vtkSmartPointer.h" // used for SmartPointers
46
47class vtkActor2D;
48class vtkPoints;
49class vtkCellArray;
50class vtkPolyData;
52class vtkCoordinate;
53class vtkProperty2D;
55class vtkWindow;
56class vtkViewport;
57class vtkTransform;
59class vtkTextProperty;
60class vtkTextActor;
61
63{
64public:
69
71
75 void PrintSelf(ostream& os, vtkIndent indent) override;
77
87
97
99
103 vtkGetObjectMacro(RingProperty, vtkProperty2D);
105
107
111 vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
113
115
118 vtkGetObjectMacro(LabelProperty, vtkTextProperty);
120
122
127 void PlaceWidget(double bounds[6]) override;
128 void BuildRepresentation() override;
129 void StartWidgetInteraction(double eventPos[2]) override;
130 void WidgetInteraction(double eventPos[2]) override;
131 virtual void TiltWidgetInteraction(double eventPos[2]);
132 virtual void DistanceWidgetInteraction(double eventPos[2]);
133 int ComputeInteractionState(int X, int Y, int modify = 0) override;
134 void Highlight(int) override;
136
138
146
147 virtual void SetHeading(double value);
148 virtual double GetHeading();
149 virtual void SetTilt(double value);
150 virtual double GetTilt();
151 virtual void UpdateTilt(double time);
152 virtual void EndTilt();
153 virtual void SetDistance(double value);
154 virtual double GetDistance();
155 virtual void UpdateDistance(double time);
156 virtual void EndDistance();
157 void SetRenderer(vtkRenderer* ren) override;
158
159 // Enums are used to describe what is selected
161 {
162 Outside = 0,
170 DistanceAdjusting
171 };
172
173protected:
176
177 // Positioning the widget
180
181 // radius values
184
185 // tilt and distance rep
186
189
190 // Define the geometry. It is constructed in canaonical position
191 // along the x-axis and then rotated into position.
194
200
203
208
210
211 // build the tube geometry
212 void BuildRing();
214
215 // used for positioning etc
216 void GetCenterAndUnitRadius(int center[2], double& radius);
217
219
220 double Heading;
221 double Tilt;
222 double Distance;
223
224private:
226 void operator=(const vtkCompassRepresentation&) = delete;
227};
228
229#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
object to represent cell connectivity
Definition: vtkCellArray.h:190
virtual void TiltWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
virtual void SetTilt(double value)
virtual double GetDistance()
vtkSmartPointer< vtkCenteredSliderRepresentation > TiltRepresentation
virtual void SetHeading(double value)
virtual void UpdateTilt(double time)
virtual double GetHeading()
vtkPolyDataMapper2D * RingMapper
virtual void EndDistance()
virtual void SetDistance(double value)
void GetCenterAndUnitRadius(int center[2], double &radius)
int RenderOverlay(vtkViewport *) override
Methods supporting the rendering process.
void WidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
~vtkCompassRepresentation() override
vtkCoordinate * GetPoint1Coordinate()
Position the first end point of the slider.
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to interface with the vtkSliderWidget.
static vtkCompassRepresentation * New()
Instantiate the class.
virtual void EndTilt()
void Highlight(int) override
Methods to interface with the vtkSliderWidget.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkTransformPolyDataFilter * RingXForm
virtual void DistanceWidgetInteraction(double eventPos[2])
Methods to interface with the vtkSliderWidget.
void BuildRepresentation() override
Methods to interface with the vtkSliderWidget.
virtual double GetTilt()
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
void GetActors(vtkPropCollection *) override
Methods supporting the rendering process.
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkSliderWidget.
vtkSmartPointer< vtkCenteredSliderRepresentation > DistanceRepresentation
virtual void UpdateDistance(double time)
vtkCoordinate * GetPoint2Coordinate()
Position the second end point of the slider.
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkSliderWidget.
vtkPolyDataMapper2D * BackdropMapper
provide the representation for a continuous value
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:86
a simple class to control print indentation
Definition: vtkIndent.h:43
represent and manipulate 3D points
Definition: vtkPoints.h:43
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:47
abstract specification for renderers
Definition: vtkRenderer.h:73
An actor that displays text.
Definition: vtkTextActor.h:60
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:64
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
@ value
Definition: vtkX3D.h:226
@ time
Definition: vtkX3D.h:503
@ center
Definition: vtkX3D.h:236
@ radius
Definition: vtkX3D.h:258