forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkAffineRepresentation.h
107 lines (90 loc) · 3.59 KB
/
vtkAffineRepresentation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAffineRepresentation.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkAffineRepresentation
* @brief abstract class for representing affine transformation widgets
*
* This class defines an API for affine transformation widget
* representations. These representations interact with vtkAffineWidget. The
* basic functionality of the affine representation is to maintain a
* transformation matrix.
*
* This class may be subclassed so that alternative representations can
* be created. The class defines an API and a default implementation that
* the vtkAffineWidget interacts with to render itself in the scene.
*
* @warning
* The separation of the widget event handling and representation enables
* users and developers to create new appearances for the widget. It also
* facilitates parallel processing, where the client application handles
* events, and remote representations of the widget are slaves to the
* client (and do not handle events).
*
* @sa
* vtkAffineWidget vtkWidgetRepresentation vtkAbstractWidget
*/
#ifndef vtkAffineRepresentation_h
#define vtkAffineRepresentation_h
#include "vtkInteractionWidgetsModule.h" // For export macro
#include "vtkWidgetRepresentation.h"
class vtkTransform;
class VTKINTERACTIONWIDGETS_EXPORT vtkAffineRepresentation : public vtkWidgetRepresentation
{
public:
//@{
/**
* Standard methods for instances of this class.
*/
vtkTypeMacro(vtkAffineRepresentation,vtkWidgetRepresentation);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
//@}
/**
* Retrieve a linear transform characterizing the affine transformation
* generated by this widget. This method copies its internal transform into
* the transform provided. The transform is relative to the initial placement
* of the representation (i.e., when PlaceWidget() is invoked).
*/
virtual void GetTransform(vtkTransform *t) = 0;
//@{
/**
* The tolerance representing the distance to the widget (in pixels)
* in which the cursor is considered near enough to the widget to
* be active.
*/
vtkSetClampMacro(Tolerance,int,1,100);
vtkGetMacro(Tolerance,int);
//@}
// Enums define the state of the representation relative to the mouse pointer
// position. Used by ComputeInteractionState() to communicate with the
// widget.
enum _InteractionState
{
Outside=0, Rotate, Translate, TranslateX, TranslateY, ScaleWEdge, ScaleEEdge,
ScaleNEdge, ScaleSEdge, ScaleNE, ScaleSW, ScaleNW, ScaleSE,
ShearEEdge, ShearWEdge, ShearNEdge, ShearSEdge,
MoveOriginX, MoveOriginY, MoveOrigin
};
/**
* Methods to make this class properly act like a vtkWidgetRepresentation.
*/
void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
protected:
vtkAffineRepresentation();
~vtkAffineRepresentation() VTK_OVERRIDE;
// The tolerance for selecting different parts of the widget.
int Tolerance;
// The internal transformation matrix
vtkTransform *Transform;
private:
vtkAffineRepresentation(const vtkAffineRepresentation&) VTK_DELETE_FUNCTION;
void operator=(const vtkAffineRepresentation&) VTK_DELETE_FUNCTION;
};
#endif