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 "vtkObject.h"
40 
41 #include "vtkMatrix3x3.h" // Needed for inline methods
42 
43 class vtkPoints2D;
44 
46 {
47  public:
48  static vtkTransform2D *New();
49  vtkTypeMacro(vtkTransform2D,vtkObject);
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53  void Identity();
54 
56  void Inverse();
57 
59 
61  void Translate(double x, double y);
62  void Translate(const double x[2]) { this->Translate(x[0], x[1]); }
63  void Translate(const float x[2]) { this->Translate(x[0], x[1]); }
65 
68  void Rotate(double angle);
69 
71 
73  void Scale(double x, double y);
74  void Scale(const double s[2]) { this->Scale(s[0], s[1]); }
75  void Scale(const float s[2]) { this->Scale(s[0], s[1]); }
77 
79 
80  void SetMatrix(vtkMatrix3x3 *matrix) {
81  this->SetMatrix(matrix->GetData()); }
82  void SetMatrix(const double elements[9]);
84 
86 
87  vtkGetObjectMacro(Matrix, vtkMatrix3x3);
88  void GetMatrix(vtkMatrix3x3 *matrix);
90 
92 
95  void GetPosition(double pos[2]);
96  void GetPosition(float pos[2]) {
97  double temp[2];
98  this->GetPosition(temp);
99  pos[0] = static_cast<float>(temp[0]);
100  pos[1] = static_cast<float>(temp[1]); }
102 
105  void GetInverse(vtkMatrix3x3 *inverse);
106 
110  void GetTranspose(vtkMatrix3x3 *transpose);
111 
113  unsigned long GetMTime();
114 
118  void TransformPoints(const float *inPts, float *outPts, int n);
119 
123  void TransformPoints(const double *inPts, double *outPts, int n);
124 
127  void TransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts);
128 
132  void InverseTransformPoints(const float *inPts, float *outPts, int n);
133 
137  void InverseTransformPoints(const double *inPts, double *outPts, int n);
138 
141  void InverseTransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts);
142 
144 
147  void MultiplyPoint(const float in[3], float out[3]) {
148  this->GetMatrix()->MultiplyPoint(in,out);};
149  void MultiplyPoint(const double in[3], double out[3]) {
150  this->GetMatrix()->MultiplyPoint(in,out);};
152 
153 protected:
154  vtkTransform2D ();
155  ~vtkTransform2D ();
156 
157  void InternalDeepCopy(vtkTransform2D *t);
158 
161 
162 private:
163  vtkTransform2D (const vtkTransform2D&); // Not implemented
164  void operator=(const vtkTransform2D&); // Not implemented
165 };
166 
167 #endif
vtkMatrix3x3 * InverseMatrix
abstract base class for most VTK objects
Definition: vtkObject.h:60
void Translate(const double x[2])
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:37
represent and manipulate 2D points
Definition: vtkPoints2D.h:34
#define VTK_COMMON_EXPORT
describes linear transformations via a 3x3 matrix
double * GetData()
Definition: vtkMatrix3x3.h:192
void MultiplyPoint(const double in[3], double out[3])
vtkMatrix3x3 * Matrix
void GetPosition(float pos[2])
void Translate(const float x[2])
void SetMatrix(vtkMatrix3x3 *matrix)
static vtkObject * New()
represent and manipulate 3x3 transformation matrices
Definition: vtkMatrix3x3.h:34
void Scale(const double s[2])
void MultiplyPoint(const float in[3], float out[3])
void Scale(const float s[2])