VTK
vtkAffineRepresentation2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAffineRepresentation2D.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=========================================================================*/
47#ifndef vtkAffineRepresentation2D_h
48#define vtkAffineRepresentation2D_h
49
50#include "vtkInteractionWidgetsModule.h" // For export macro
52
53class vtkProperty2D;
54class vtkActor2D;
56class vtkPolyData;
57class vtkPoints;
58class vtkCellArray;
59class vtkTextProperty;
61class vtkTextMapper;
62class vtkActor2D;
63
64
65class VTKINTERACTIONWIDGETS_EXPORT vtkAffineRepresentation2D : public vtkAffineRepresentation
66{
67public:
72
74
78 void PrintSelf(ostream& os, vtkIndent indent);
80
82
89 vtkSetClampMacro(BoxWidth,int,10,VTK_INT_MAX);
90 vtkGetMacro(BoxWidth,int);
91 vtkSetClampMacro(CircleWidth,int,10,VTK_INT_MAX);
92 vtkGetMacro(CircleWidth,int);
93 vtkSetClampMacro(AxesWidth,int,10,VTK_INT_MAX);
94 vtkGetMacro(AxesWidth,int);
96
98
103 void SetOrigin(const double o[3]) {this->SetOrigin(o[0],o[1],o[2]);}
104 void SetOrigin(double ox, double oy, double oz);
105 vtkGetVector3Macro(Origin,double);
107
116 virtual void GetTransform(vtkTransform *t);
117
119
125 vtkGetObjectMacro(Property,vtkProperty2D);
126 vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
127 vtkGetObjectMacro(TextProperty,vtkTextProperty);
129
131
136 vtkSetMacro(DisplayText,int);
137 vtkGetMacro(DisplayText,int);
138 vtkBooleanMacro(DisplayText,int);
140
142
149 virtual void PlaceWidget(double bounds[6]);
150 virtual void StartWidgetInteraction(double eventPos[2]);
151 virtual void WidgetInteraction(double eventPos[2]);
152 virtual void EndWidgetInteraction(double eventPos[2]);
153 virtual int ComputeInteractionState(int X, int Y, int modify=0);
154 virtual void BuildRepresentation();
156
158
161 virtual void ShallowCopy(vtkProp *prop);
164 virtual int RenderOverlay(vtkViewport *viewport);
166
167protected:
170
171 // Methods to manipulate the cursor
172 void Translate(double eventPos[2]);
173 void Scale(double eventPos[2]);
174 void Rotate(double eventPos[2]);
175 void Shear(double eventPos[2]);
176 void Highlight(int highlight);
177 void UpdateText(const char *text, double eventPos[2]);
178
179 // The width of the widget in normalized viewport coordinates.
183
184 // Display text
186
187 // Internal variables for bookkeeping (in display coordinates unless noted)
191
192 // The internal transformation matrix
196 double Origin[4]; //the current origin in world coordinates
197 double DisplayOrigin[3]; //the current origin in display coordinates
198 double CurrentTranslation[3]; //translation this movement
199 double StartWorldPosition[4]; //Start event position converted to world
200 double StartAngle; //The starting angle (always positive)
202 double CurrentScale[2];
203 double CurrentShear[2];
204 void ApplyShear(); //helper method to apply shear to matrix
205
206 // Properties used to control the appearance of selected objects and
207 // the manipulator in general.
212 double Opacity;
214
215 // Support picking
216 double LastEventPosition[2];
217
218 // These are the classes that form the geometric representation -----------
219 // The label
222
223 // The outer box
229
235
236 // The circle
242
248
249 // The translation axes
254
255private:
256 vtkAffineRepresentation2D(const vtkAffineRepresentation2D&) VTK_DELETE_FUNCTION;
257 void operator=(const vtkAffineRepresentation2D&) VTK_DELETE_FUNCTION;
258};
259
260#endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
represent 2D affine transformations
virtual int ComputeInteractionState(int X, int Y, int modify=0)
virtual void WidgetInteraction(double eventPos[2])
virtual void EndWidgetInteraction(double eventPos[2])
void Shear(double eventPos[2])
virtual void GetTransform(vtkTransform *t)
Retrieve a linear transform characterizing the affine transformation generated by this widget.
virtual void GetActors2D(vtkPropCollection *)
void UpdateText(const char *text, double eventPos[2])
void Highlight(int highlight)
static vtkAffineRepresentation2D * New()
Instantiate this class.
void Translate(double eventPos[2])
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
void SetOrigin(const double o[3])
Specify the origin of the widget (in world coordinates).
virtual void StartWidgetInteraction(double eventPos[2])
void SetSelectedProperty(vtkProperty2D *)
virtual int RenderOverlay(vtkViewport *viewport)
virtual void ShallowCopy(vtkProp *prop)
Methods to make this class behave as a vtkProp.
void SetOrigin(double ox, double oy, double oz)
void Scale(double eventPos[2])
virtual void PlaceWidget(double bounds[6])
Subclasses of vtkAffineRepresentation2D must implement these methods.
void Rotate(double eventPos[2])
virtual void BuildRepresentation()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetTextProperty(vtkTextProperty *)
void SetProperty(vtkProperty2D *)
Set/Get the properties when unselected and selected.
abstract class for representing affine transformation widgets
object to represent cell connectivity
Definition: vtkCellArray.h:51
a simple class to control print indentation
Definition: vtkIndent.h:40
create a leader with optional label and arrows
represent and manipulate 3D points
Definition: vtkPoints.h:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
a list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
2D text annotation
Definition: vtkTextMapper.h:54
represent text properties.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_INT_MAX
Definition: vtkType.h:153