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 =========================================================================*/
46 #ifndef vtkAffineRepresentation2D_h
47 #define vtkAffineRepresentation2D_h
48 
49 #include "vtkInteractionWidgetsModule.h" // For export macro
51 
52 class vtkProperty2D;
53 class vtkActor2D;
55 class vtkPolyData;
56 class vtkPoints;
57 class vtkCellArray;
58 class vtkTextProperty;
59 class vtkLeaderActor2D;
60 class vtkTextMapper;
61 class vtkActor2D;
62 
63 
65 {
66 public:
69 
71 
73  void PrintSelf(ostream& os, vtkIndent indent);
75 
77 
82  vtkSetClampMacro(BoxWidth,int,10,VTK_INT_MAX);
83  vtkGetMacro(BoxWidth,int);
84  vtkSetClampMacro(CircleWidth,int,10,VTK_INT_MAX);
85  vtkGetMacro(CircleWidth,int);
86  vtkSetClampMacro(AxesWidth,int,10,VTK_INT_MAX);
87  vtkGetMacro(AxesWidth,int);
89 
91 
94  void SetOrigin(const double o[3]) {this->SetOrigin(o[0],o[1],o[2]);}
95  void SetOrigin(double ox, double oy, double oz);
96  vtkGetVector3Macro(Origin,double);
98 
105  virtual void GetTransform(vtkTransform *t);
106 
108 
113  vtkGetObjectMacro(SelectedProperty,vtkProperty2D);
116 
118 
122  vtkSetMacro(DisplayText,int);
123  vtkGetMacro(DisplayText,int);
124  vtkBooleanMacro(DisplayText,int);
126 
128 
133  virtual void PlaceWidget(double bounds[6]);
134  virtual void StartWidgetInteraction(double eventPos[2]);
135  virtual void WidgetInteraction(double eventPos[2]);
136  virtual void EndWidgetInteraction(double eventPos[2]);
137  virtual int ComputeInteractionState(int X, int Y, int modify=0);
138  virtual void BuildRepresentation();
140 
142 
143  virtual void ShallowCopy(vtkProp *prop);
146  virtual int RenderOverlay(vtkViewport *viewport);
148 
149 protected:
152 
153  // Methods to manipulate the cursor
154  void Translate(double eventPos[2]);
155  void Scale(double eventPos[2]);
156  void Rotate(double eventPos[2]);
157  void Shear(double eventPos[2]);
158  void Highlight(int highlight);
159  void UpdateText(const char *text, double eventPos[2]);
160 
161  // The width of the widget in normalized viewport coordinates.
162  int BoxWidth;
165 
166  // Display text
168 
169  // Internal variables for bookkeeping (in display coordinates unless noted)
170  double CurrentWidth;
173 
174  // The internal transformation matrix
178  double Origin[4]; //the current origin in world coordinates
179  double DisplayOrigin[3]; //the current origin in display coordinates
180  double CurrentTranslation[3]; //translation this movement
181  double StartWorldPosition[4]; //Start event position converted to world
182  double StartAngle; //The starting angle (always positive)
183  double CurrentAngle;
184  double CurrentScale[2];
185  double CurrentShear[2];
186  void ApplyShear(); //helper method to apply shear to matrix
187 
188  // Properties used to control the appearance of selected objects and
189  // the manipulator in general.
194  double Opacity;
196 
197  // Support picking
198  double LastEventPosition[2];
199 
200  // These are the classes that form the geometric representation -----------
201  // The label
204 
205  // The outer box
211 
217 
218  // The circle
224 
230 
231  // The translation axes
236 
237 private:
238  vtkAffineRepresentation2D(const vtkAffineRepresentation2D&); //Not implemented
239  void operator=(const vtkAffineRepresentation2D&); //Not implemented
240 };
241 
242 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkAffineRepresentation2D::CircleMapper
vtkPolyDataMapper2D * CircleMapper
Definition: vtkAffineRepresentation2D.h:222
vtkAffineRepresentation2D::Box
vtkPolyData * Box
Definition: vtkAffineRepresentation2D.h:208
vtkAffineRepresentation2D::Property
vtkProperty2D * Property
Definition: vtkAffineRepresentation2D.h:190
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:132
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkAffineRepresentation2D::BoxActor
vtkActor2D * BoxActor
Definition: vtkAffineRepresentation2D.h:210
vtkAffineRepresentation2D::HXAxis
vtkLeaderActor2D * HXAxis
Definition: vtkAffineRepresentation2D.h:234
vtkAffineRepresentation2D::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
vtkAffineRepresentation2D::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkAffineRepresentation2D::AxesWidth
int AxesWidth
Definition: vtkAffineRepresentation2D.h:164
vtkAffineRepresentation2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkAffineRepresentation2D::DisplayText
int DisplayText
Definition: vtkAffineRepresentation2D.h:167
vtkAffineRepresentation2D::CircleActor
vtkActor2D * CircleActor
Definition: vtkAffineRepresentation2D.h:223
vtkAffineRepresentation2D::Translate
void Translate(double eventPos[2])
vtkAffineRepresentation2D::New
static vtkAffineRepresentation2D * New()
vtkAffineRepresentation2D::SetSelectedProperty
void SetSelectedProperty(vtkProperty2D *)
vtkAffineRepresentation2D::CreateDefaultProperties
void CreateDefaultProperties()
vtkAffineRepresentation2D::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkAffineRepresentation2D::BoxMapper
vtkPolyDataMapper2D * BoxMapper
Definition: vtkAffineRepresentation2D.h:209
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkAffineRepresentation2D::HBoxMapper
vtkPolyDataMapper2D * HBoxMapper
Definition: vtkAffineRepresentation2D.h:215
vtkAffineRepresentation2D::TempTransform
vtkTransform * TempTransform
Definition: vtkAffineRepresentation2D.h:177
vtkAffineRepresentation2D::UpdateText
void UpdateText(const char *text, double eventPos[2])
vtkAffineRepresentation2D::CircleCellArray
vtkCellArray * CircleCellArray
Definition: vtkAffineRepresentation2D.h:220
vtkInteractionWidgetsModule.h
vtkAffineRepresentation2D::CurrentWidth
double CurrentWidth
Definition: vtkAffineRepresentation2D.h:170
vtkAffineRepresentation2D::SetOrigin
void SetOrigin(const double o[3])
Definition: vtkAffineRepresentation2D.h:94
vtkAffineRepresentation2D::TextProperty
vtkTextProperty * TextProperty
Definition: vtkAffineRepresentation2D.h:192
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkAffineRepresentation2D::BuildRepresentation
virtual void BuildRepresentation()
vtkAffineRepresentation2D::HCircleCellArray
vtkCellArray * HCircleCellArray
Definition: vtkAffineRepresentation2D.h:226
vtkAffineRepresentation2D::TextMapper
vtkTextMapper * TextMapper
Definition: vtkAffineRepresentation2D.h:202
vtkAffineRepresentation2D::HCirclePoints
vtkPoints * HCirclePoints
Definition: vtkAffineRepresentation2D.h:225
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkAffineRepresentation2D::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
vtkAffineRepresentation2D::TotalTransform
vtkTransform * TotalTransform
Definition: vtkAffineRepresentation2D.h:176
vtkAffineRepresentation2D::vtkAffineRepresentation2D
vtkAffineRepresentation2D()
vtkAffineRepresentation2D::SelectedProperty
vtkProperty2D * SelectedProperty
Definition: vtkAffineRepresentation2D.h:191
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkAffineRepresentation2D::HBoxActor
vtkActor2D * HBoxActor
Definition: vtkAffineRepresentation2D.h:216
vtkAffineRepresentation2D::HBoxPoints
vtkPoints * HBoxPoints
Definition: vtkAffineRepresentation2D.h:212
vtkAffineRepresentation.h
vtkAffineRepresentation
abstract class for representing affine transformation widgets
Definition: vtkAffineRepresentation.h:47
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkAffineRepresentation2D::XAxis
vtkLeaderActor2D * XAxis
Definition: vtkAffineRepresentation2D.h:232
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkAffineRepresentation2D::CircleWidth
int CircleWidth
Definition: vtkAffineRepresentation2D.h:163
vtkAffineRepresentation2D::RenderOverlay
virtual int RenderOverlay(vtkViewport *viewport)
vtkAffineRepresentation2D::Shear
void Shear(double eventPos[2])
vtkAffineRepresentation2D::~vtkAffineRepresentation2D
~vtkAffineRepresentation2D()
vtkAffineRepresentation2D::Circle
vtkPolyData * Circle
Definition: vtkAffineRepresentation2D.h:221
vtkAffineRepresentation2D::ShallowCopy
virtual void ShallowCopy(vtkProp *prop)
vtkAffineRepresentation2D::HCircleActor
vtkActor2D * HCircleActor
Definition: vtkAffineRepresentation2D.h:229
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkAffineRepresentation2D::BoxCellArray
vtkCellArray * BoxCellArray
Definition: vtkAffineRepresentation2D.h:207
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkAffineRepresentation2D::SelectedOpacity
double SelectedOpacity
Definition: vtkAffineRepresentation2D.h:195
vtkAffineRepresentation2D::HCircle
vtkPolyData * HCircle
Definition: vtkAffineRepresentation2D.h:227
vtkAffineRepresentation2D::GetTransform
virtual void GetTransform(vtkTransform *t)
vtkAffineRepresentation2D::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkAffineRepresentation2D::BoxWidth
int BoxWidth
Definition: vtkAffineRepresentation2D.h:162
vtkAffineRepresentation2D::SetOrigin
void SetOrigin(double ox, double oy, double oz)
vtkAffineRepresentation2D::BoxPoints
vtkPoints * BoxPoints
Definition: vtkAffineRepresentation2D.h:206
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkAffineRepresentation2D::Scale
void Scale(double eventPos[2])
vtkAffineRepresentation2D::TextActor
vtkActor2D * TextActor
Definition: vtkAffineRepresentation2D.h:203
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkAffineRepresentation2D::CirclePoints
vtkPoints * CirclePoints
Definition: vtkAffineRepresentation2D.h:219
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkAffineRepresentation2D::CurrentAngle
double CurrentAngle
Definition: vtkAffineRepresentation2D.h:183
vtkAffineRepresentation2D::EndWidgetInteraction
virtual void EndWidgetInteraction(double eventPos[2])
vtkAffineRepresentation2D::SetTextProperty
void SetTextProperty(vtkTextProperty *)
vtkAffineRepresentation2D::SetProperty
void SetProperty(vtkProperty2D *)
vtkAffineRepresentation2D::HYAxis
vtkLeaderActor2D * HYAxis
Definition: vtkAffineRepresentation2D.h:235
vtkAffineRepresentation2D::Opacity
double Opacity
Definition: vtkAffineRepresentation2D.h:194
vtkAffineRepresentation2D::HCircleMapper
vtkPolyDataMapper2D * HCircleMapper
Definition: vtkAffineRepresentation2D.h:228
vtkAffineRepresentation2D::CurrentTransform
vtkTransform * CurrentTransform
Definition: vtkAffineRepresentation2D.h:175
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkAffineRepresentation2D::YAxis
vtkLeaderActor2D * YAxis
Definition: vtkAffineRepresentation2D.h:233
vtkAffineRepresentation2D::HBoxCellArray
vtkCellArray * HBoxCellArray
Definition: vtkAffineRepresentation2D.h:213
vtkAffineRepresentation2D::HBox
vtkPolyData * HBox
Definition: vtkAffineRepresentation2D.h:214
vtkAffineRepresentation2D::StartAngle
double StartAngle
Definition: vtkAffineRepresentation2D.h:182
vtkAffineRepresentation2D
represent 2D affine transformations
Definition: vtkAffineRepresentation2D.h:65
vtkAffineRepresentation2D::Highlight
void Highlight(int highlight)
vtkAffineRepresentation2D::CurrentRadius
double CurrentRadius
Definition: vtkAffineRepresentation2D.h:171
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkAffineRepresentation2D::Rotate
void Rotate(double eventPos[2])
vtkAffineRepresentation2D::PlaceWidget
virtual void PlaceWidget(double bounds[6])
vtkLeaderActor2D
create a leader with optional label and arrows
Definition: vtkLeaderActor2D.h:59
vtkAffineRepresentation2D::ApplyShear
void ApplyShear()
vtkAffineRepresentation2D::CurrentAxesWidth
double CurrentAxesWidth
Definition: vtkAffineRepresentation2D.h:172