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
57class vtkActor2D;
58class vtkPoints;
59class vtkCellArray;
60class vtkPolyData;
62class vtkCoordinate;
63class vtkProperty2D;
65class vtkWindow;
66class vtkViewport;
67class vtkTransform;
69class vtkTextProperty;
70class vtkTextActor;
71
73{
74public:
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
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
183protected:
186
187 // Positioning the widget
190
191 // radius values
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
234private:
236 void operator=(const vtkCompassRepresentation&) = delete;
237};
238
239#endif
a actor that draws 2D data
Definition: vtkActor2D.h:149
object to represent cell connectivity
Definition: vtkCellArray.h:290
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
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate 3D points
Definition: vtkPoints.h:143
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
an ordered list of Props
represent surface properties of a 2D image
abstract specification for renderers
Definition: vtkRenderer.h:182
Hold a reference to a vtkObjectBase instance.
An actor that displays text.
Definition: vtkTextActor.h:160
represent text properties.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:164
abstract specification for Viewports
Definition: vtkViewport.h:47
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39