VTK  9.2.6
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=========================================================================*/
44#ifndef vtkAffineRepresentation2D_h
45#define vtkAffineRepresentation2D_h
46
48#include "vtkInteractionWidgetsModule.h" // For export macro
49
50class vtkProperty2D;
51class vtkActor2D;
53class vtkPolyData;
54class vtkPoints;
55class vtkCellArray;
56class vtkTextProperty;
58class vtkTextMapper;
59class vtkActor2D;
60
61class VTKINTERACTIONWIDGETS_EXPORT vtkAffineRepresentation2D : public vtkAffineRepresentation
62{
63public:
68
70
74 void PrintSelf(ostream& os, vtkIndent indent) override;
76
78
85 vtkSetClampMacro(BoxWidth, int, 10, VTK_INT_MAX);
86 vtkGetMacro(BoxWidth, int);
87 vtkSetClampMacro(CircleWidth, int, 10, VTK_INT_MAX);
88 vtkGetMacro(CircleWidth, int);
89 vtkSetClampMacro(AxesWidth, int, 10, VTK_INT_MAX);
90 vtkGetMacro(AxesWidth, int);
92
94
99 void SetOrigin(const double o[3]) { this->SetOrigin(o[0], o[1], o[2]); }
100 void SetOrigin(double ox, double oy, double oz);
101 vtkGetVector3Macro(Origin, double);
103
112 void GetTransform(vtkTransform* t) override;
113
115
121 vtkGetObjectMacro(Property, vtkProperty2D);
122 vtkGetObjectMacro(SelectedProperty, vtkProperty2D);
123 vtkGetObjectMacro(TextProperty, vtkTextProperty);
125
127
132 vtkSetMacro(DisplayText, vtkTypeBool);
133 vtkGetMacro(DisplayText, vtkTypeBool);
134 vtkBooleanMacro(DisplayText, vtkTypeBool);
136
138
145 void PlaceWidget(double bounds[6]) override;
146 void StartWidgetInteraction(double eventPos[2]) override;
147 void WidgetInteraction(double eventPos[2]) override;
148 void EndWidgetInteraction(double eventPos[2]) override;
149 int ComputeInteractionState(int X, int Y, int modify = 0) override;
150 void BuildRepresentation() override;
152
154
157 void ShallowCopy(vtkProp* prop) override;
160 int RenderOverlay(vtkViewport* viewport) override;
162
163protected:
166
167 // Methods to manipulate the cursor
168 void Translate(double eventPos[2]);
169 void Scale(double eventPos[2]);
170 void Rotate(double eventPos[2]);
171 void Shear(double eventPos[2]);
172 void Highlight(int highlight) override;
173 void UpdateText(const char* text, double eventPos[2]);
174
175 // The width of the widget in normalized viewport coordinates.
179
180 // Display text
182
183 // Internal variables for bookkeeping (in display coordinates unless noted)
187
188 // The internal transformation matrix
191 double Origin[4]; // the current origin in world coordinates
192 double DisplayOrigin[3]; // the current origin in display coordinates
193 double CurrentTranslation[3]; // translation this movement
194 double StartWorldPosition[4]; // Start event position converted to world
195 double StartAngle; // The starting angle (always positive)
197 double CurrentScale[2];
198 double CurrentShear[2];
199 void ApplyShear(); // helper method to apply shear to matrix
200
201 // Properties used to control the appearance of selected objects and
202 // the manipulator in general.
207 double Opacity;
209
210 // Support picking
211 double LastEventPosition[2];
212
213 // These are the classes that form the geometric representation -----------
214 // The label
217
218 // The outer box
224
230
231 // The circle
237
243
244 // The translation axes
249
250private:
252 void operator=(const vtkAffineRepresentation2D&) = delete;
253};
254
255#endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
represent 2D affine transformations
void EndWidgetInteraction(double eventPos[2]) override
Subclasses of vtkAffineRepresentation2D must implement these methods.
void GetTransform(vtkTransform *t) override
Retrieve a linear transform characterizing the affine transformation generated by this widget.
void PlaceWidget(double bounds[6]) override
Subclasses of vtkAffineRepresentation2D must implement these methods.
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
void WidgetInteraction(double eventPos[2]) override
Subclasses of vtkAffineRepresentation2D must implement these methods.
void Shear(double eventPos[2])
int RenderOverlay(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
void UpdateText(const char *text, double eventPos[2])
void Highlight(int highlight) override
void ShallowCopy(vtkProp *prop) override
Methods to make this class behave as a vtkProp.
void BuildRepresentation() override
Subclasses of vtkAffineRepresentation2D must implement these methods.
void StartWidgetInteraction(double eventPos[2]) override
Subclasses of vtkAffineRepresentation2D must implement these methods.
static vtkAffineRepresentation2D * New()
Instantiate this class.
void GetActors2D(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void Translate(double eventPos[2])
void SetOrigin(const double o[3])
Specify the origin of the widget (in world coordinates).
int ComputeInteractionState(int X, int Y, int modify=0) override
Subclasses of vtkAffineRepresentation2D must implement these methods.
void SetSelectedProperty(vtkProperty2D *)
Set/Get the properties when unselected and selected.
void SetOrigin(double ox, double oy, double oz)
Specify the origin of the widget (in world coordinates).
void Scale(double eventPos[2])
void Rotate(double eventPos[2])
void SetTextProperty(vtkTextProperty *)
Set/Get the properties when unselected and selected.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
void SetProperty(vtkProperty2D *)
Set/Get the properties when unselected and selected.
~vtkAffineRepresentation2D() override
abstract class for representing affine transformation widgets
object to represent cell connectivity
Definition: vtkCellArray.h:187
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:91
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
2D text annotation
Definition: vtkTextMapper.h:51
represent text properties.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_INT_MAX
Definition: vtkType.h:155