VTK
vtkOrientationMarkerWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOrientationMarkerWidget.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=========================================================================*/
75#ifndef vtkOrientationMarkerWidget_h
76#define vtkOrientationMarkerWidget_h
77
78#include "vtkInteractionWidgetsModule.h" // For export macro
80
81class vtkActor2D;
82class vtkPolyData;
83class vtkProp;
84class vtkOrientationMarkerWidgetObserver;
85class vtkRenderer;
86
87class VTKINTERACTIONWIDGETS_EXPORT vtkOrientationMarkerWidget : public vtkInteractorObserver
88{
89public:
92 void PrintSelf(ostream& os, vtkIndent indent);
93
95
98 virtual void SetOrientationMarker(vtkProp *prop);
99 vtkGetObjectMacro(OrientationMarker, vtkProp);
101
105 virtual void SetEnabled(int);
106
111 void ExecuteCameraUpdateEvent(vtkObject *o, unsigned long event, void *calldata);
112
114
118 void SetInteractive(int state);
119 vtkGetMacro(Interactive, int);
120 vtkBooleanMacro(Interactive, int);
122
124
129 void SetOutlineColor(double r, double g, double b);
132
134
146 vtkSetVector4Macro(Viewport, double);
147 vtkGetVector4Macro(Viewport, double);
149
151
156 vtkSetClampMacro(Tolerance,int,1,10);
157 vtkGetMacro(Tolerance,int);
159
160protected:
163
168
169 unsigned long StartEventObserverId;
170
171 static void ProcessEvents(vtkObject *object, unsigned long event,
172 void *clientdata, void *calldata);
173
174 // ProcessEvents() dispatches to these methods.
178
179 // observer to update the renderer's camera
180 vtkOrientationMarkerWidgetObserver *Observer;
181
185
186 // viewport to position/size this widget
187 double Viewport[4];
188
189 // used to compute relative movements
190 int StartPosition[2];
191
192 // Manage the state of the widget
193 int State;
195 {
196 Outside = 0,
202 AdjustingP4
203 };
204
205
206 // use to determine what state the mouse is over, edge1 p1, etc.
207 // returns a state from the WidgetState enum above
208 int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2);
209
210 // set the cursor to the correct shape based on State argument
211 void SetCursor(int state);
212
213 // adjust the viewport depending on state
214 void MoveWidget(int X, int Y);
215 void ResizeTopLeft(int X, int Y);
216 void ResizeTopRight(int X, int Y);
217 void ResizeBottomLeft(int X, int Y);
218 void ResizeBottomRight(int X, int Y);
219
223
224private:
225 vtkOrientationMarkerWidget(const vtkOrientationMarkerWidget&) VTK_DELETE_FUNCTION;
226 void operator=(const vtkOrientationMarkerWidget&) VTK_DELETE_FUNCTION;
227};
228
229#endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
abstract base class for most VTK objects
Definition: vtkObject.h:60
2D widget for manipulating a marker prop
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
void ResizeBottomLeft(int X, int Y)
virtual void SetEnabled(int)
Enable/disable the widget.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkOrientationMarkerWidgetObserver * Observer
void SetOutlineColor(double r, double g, double b)
Set/get the color of the outline of this widget.
void ResizeTopLeft(int X, int Y)
void ResizeBottomRight(int X, int Y)
void ResizeTopRight(int X, int Y)
int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2)
void SetInteractive(int state)
Set/get whether to allow this widget to be interactively moved/scaled.
void SetCursor(int state)
void ExecuteCameraUpdateEvent(vtkObject *o, unsigned long event, void *calldata)
Callback to keep the camera for the orientation marker up to date with the camera in the parent rende...
virtual void SetOrientationMarker(vtkProp *prop)
Set/get the orientation marker to be displayed in this widget.
void MoveWidget(int X, int Y)
static vtkOrientationMarkerWidget * New()
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.