00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00033 #ifndef __vtkTransform2D_h
00034 #define __vtkTransform2D_h
00035
00036 #include "vtkObject.h"
00037
00038 #include "vtkMatrix3x3.h"
00039
00040 class vtkPoints2D;
00041
00042 class VTK_COMMON_EXPORT vtkTransform2D : public vtkObject
00043 {
00044 public:
00045 static vtkTransform2D *New();
00046 vtkTypeRevisionMacro(vtkTransform2D,vtkObject);
00047 void PrintSelf(ostream& os, vtkIndent indent);
00048
00050 void Identity();
00051
00053 void Inverse();
00054
00056
00058 void Translate(double x, double y);
00059 void Translate(const double x[2]) { this->Translate(x[0], x[1]); }
00060 void Translate(const float x[2]) { this->Translate(x[0], x[1]); }
00062
00065 void Rotate(double angle);
00066
00068
00070 void Scale(double x, double y);
00071 void Scale(const double s[2]) { this->Scale(s[0], s[1]); }
00072 void Scale(const float s[2]) { this->Scale(s[0], s[1]); }
00074
00076
00077 void SetMatrix(vtkMatrix3x3 *matrix) {
00078 this->SetMatrix(matrix->GetData()); }
00079 void SetMatrix(const double elements[9]);
00081
00083
00084 vtkGetObjectMacro(Matrix, vtkMatrix3x3);
00085 void GetMatrix(vtkMatrix3x3 *matrix);
00087
00089
00092 void GetPosition(double pos[2]);
00093 void GetPosition(float pos[2]) {
00094 double temp[2];
00095 this->GetPosition(temp);
00096 pos[0] = static_cast<float>(temp[0]);
00097 pos[1] = static_cast<float>(temp[1]); }
00099
00102 void GetInverse(vtkMatrix3x3 *inverse);
00103
00107 void GetTranspose(vtkMatrix3x3 *transpose);
00108
00110 unsigned long GetMTime();
00111
00115 void TransformPoints(const float *inPts, float *outPts, int n);
00116
00120 void TransformPoints(const double *inPts, double *outPts, int n);
00121
00124 void TransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts);
00125
00129 void InverseTransformPoints(const float *inPts, float *outPts, int n);
00130
00134 void InverseTransformPoints(const double *inPts, double *outPts, int n);
00135
00138 void InverseTransformPoints(vtkPoints2D *inPts, vtkPoints2D *outPts);
00139
00141
00144 void MultiplyPoint(const float in[3], float out[3]) {
00145 this->GetMatrix()->MultiplyPoint(in,out);};
00146 void MultiplyPoint(const double in[3], double out[3]) {
00147 this->GetMatrix()->MultiplyPoint(in,out);};
00149
00150 protected:
00151 vtkTransform2D ();
00152 ~vtkTransform2D ();
00153
00154 void InternalDeepCopy(vtkTransform2D *t);
00155
00156 vtkMatrix3x3 *Matrix;
00157 vtkMatrix3x3 *InverseMatrix;
00158
00159 private:
00160 vtkTransform2D (const vtkTransform2D&);
00161 void operator=(const vtkTransform2D&);
00162 };
00163
00164 #endif