VTK
vtkTransform2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTransform2D.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 =========================================================================*/
15 
36 #ifndef vtkTransform2D_h
37 #define vtkTransform2D_h
38 
39 #include "vtkCommonTransformsModule.h" // For export macro
40 #include "vtkObject.h"
41 
42 #include "vtkMatrix3x3.h" // Needed for inline methods
43 
44 class vtkPoints2D;
45 
47 {
48  public:
49  static vtkTransform2D *New();
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54  void Identity();
55 
57  void Inverse();
58 
60 
62  void Translate(double x, double y);
63  void Translate(const double x[2]) { this->Translate(x[0], x[1]); }
64  void Translate(const float x[2]) { this->Translate(x[0], x[1]); }
66 
69  void Rotate(double angle);
70 
72 
74  void Scale(double x, double y);
75  void Scale(const double s[2]) { this->Scale(s[0], s[1]); }
76  void Scale(const float s[2]) { this->Scale(s[0], s[1]); }
78 
80 
82  this->SetMatrix(matrix->GetData()); }
83  void SetMatrix(const double elements[9]);
85 
87 
91 
93 
96  void GetPosition(double pos[2]);
97  void GetPosition(float pos[2]) {
98  double temp[2];
99  this->GetPosition(temp);
100  pos[0] = static_cast<float>(temp[0]);
101  pos[1] = static_cast<float>(temp[1]); }
103 
105 
108  void GetScale(double pos[2]);
109  void GetScale(float pos[2]) {
110  double temp[2];
111  this->GetScale(temp);
112  pos[0] = static_cast<float>(temp[0]);
113  pos[1] = static_cast<float>(temp[1]); }
115 
118  void GetInverse(vtkMatrix3x3 *inverse);
119 
124 
126  unsigned long GetMTime();
127 
131  void TransformPoints(const float *inPts, float *outPts, int n);
132 
136  void TransformPoints(const double *inPts, double *outPts, int n);
137 
140  void TransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts);
141 
145  void InverseTransformPoints(const float *inPts, float *outPts, int n);
146 
150  void InverseTransformPoints(const double *inPts, double *outPts, int n);
151 
155 
157 
160  void MultiplyPoint(const float in[3], float out[3]) {
161  this->GetMatrix()->MultiplyPoint(in,out);};
162  void MultiplyPoint(const double in[3], double out[3]) {
163  this->GetMatrix()->MultiplyPoint(in,out);};
165 
166 protected:
169 
171 
174 
175 private:
176  vtkTransform2D (const vtkTransform2D&); // Not implemented
177  void operator=(const vtkTransform2D&); // Not implemented
178 };
179 
180 #endif
vtkPoints2D
represent and manipulate 2D points
Definition: vtkPoints2D.h:36
vtkTransform2D::GetMatrix
void GetMatrix(vtkMatrix3x3 *matrix)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkTransform2D::GetScale
void GetScale(float pos[2])
Definition: vtkTransform2D.h:109
vtkMatrix3x3.h
vtkTransform2D
describes linear transformations via a 3x3 matrix
Definition: vtkTransform2D.h:47
vtkTransform2D::SetMatrix
void SetMatrix(const double elements[9])
vtkTransform2D::~vtkTransform2D
~vtkTransform2D()
vtkTransform2D::TransformPoints
void TransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts)
vtkgl::s
GLdouble s
Definition: vtkgl.h:11594
vtkTransform2D::InverseTransformPoints
void InverseTransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkTransform2D::GetTranspose
void GetTranspose(vtkMatrix3x3 *transpose)
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkTransform2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkTransform2D::InverseTransformPoints
void InverseTransformPoints(const float *inPts, float *outPts, int n)
vtkTransform2D::Scale
void Scale(const double s[2])
Definition: vtkTransform2D.h:75
vtkgl::transpose
GLsizei GLboolean transpose
Definition: vtkgl.h:12029
vtkgl::in
GLuint in
Definition: vtkgl.h:16905
vtkTransform2D::MultiplyPoint
void MultiplyPoint(const float in[3], float out[3])
Definition: vtkTransform2D.h:160
vtkTransform2D::GetPosition
void GetPosition(float pos[2])
Definition: vtkTransform2D.h:97
vtkMatrix3x3
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:36
vtkTransform2D::SetMatrix
void SetMatrix(vtkMatrix3x3 *matrix)
Definition: vtkTransform2D.h:81
vtkTransform2D::TransformPoints
void TransformPoints(const float *inPts, float *outPts, int n)
vtkTransform2D::Matrix
vtkMatrix3x3 * Matrix
Definition: vtkTransform2D.h:172
vtkTransform2D::TransformPoints
void TransformPoints(const double *inPts, double *outPts, int n)
vtkCommonTransformsModule.h
VTKCOMMONTRANSFORMS_EXPORT
#define VTKCOMMONTRANSFORMS_EXPORT
Definition: vtkCommonTransformsModule.h:15
vtkTransform2D::GetPosition
void GetPosition(double pos[2])
vtkTransform2D::Rotate
void Rotate(double angle)
vtkTransform2D::InternalDeepCopy
void InternalDeepCopy(vtkTransform2D *t)
vtkTransform2D::vtkTransform2D
vtkTransform2D()
vtkTransform2D::MultiplyPoint
void MultiplyPoint(const double in[3], double out[3])
Definition: vtkTransform2D.h:162
vtkTransform2D::Scale
void Scale(double x, double y)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTransform2D::Translate
void Translate(double x, double y)
vtkTransform2D::Inverse
void Inverse()
vtkTransform2D::GetMTime
unsigned long GetMTime()
vtkTransform2D::InverseTransformPoints
void InverseTransformPoints(const double *inPts, double *outPts, int n)
vtkObject.h
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkTransform2D::GetInverse
void GetInverse(vtkMatrix3x3 *inverse)
vtkTransform2D::Identity
void Identity()
vtkgl::matrix
GLuint GLenum matrix
Definition: vtkgl.h:16451
vtkgl::angle
GLfloat angle
Definition: vtkgl.h:18174
vtkTransform2D::Scale
void Scale(const float s[2])
Definition: vtkTransform2D.h:76
vtkTransform2D::Translate
void Translate(const float x[2])
Definition: vtkTransform2D.h:64
vtkTransform2D::Translate
void Translate(const double x[2])
Definition: vtkTransform2D.h:63
vtkTransform2D::New
static vtkTransform2D * New()
vtkTransform2D::InverseMatrix
vtkMatrix3x3 * InverseMatrix
Definition: vtkTransform2D.h:173
vtkTransform2D::GetScale
void GetScale(double pos[2])