00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00056 #ifndef __vtkMatrix4x4_h
00057 #define __vtkMatrix4x4_h
00058
00059 #include "vtkObject.h"
00060
00061 class VTK_EXPORT vtkMatrix4x4 : public vtkObject
00062 {
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 public:
00073 double Element[4][4];
00074
00076 static vtkMatrix4x4 *New();
00077
00078 vtkTypeMacro(vtkMatrix4x4,vtkObject);
00079 void PrintSelf(ostream& os, vtkIndent indent);
00080
00083 void DeepCopy(vtkMatrix4x4 *source)
00084 {vtkMatrix4x4::DeepCopy(*this->Element,source); this->Modified(); }
00085
00086 static void DeepCopy(double Elements[16], vtkMatrix4x4 *source)
00087 {vtkMatrix4x4::DeepCopy(Elements,*source->Element); }
00088 static void DeepCopy(double Elements[16], const double newElements[16]);
00089
00090
00092 void DeepCopy(const double Elements[16])
00093 { this->DeepCopy(*this->Element,Elements); this->Modified(); }
00094
00096 void Zero()
00097 { vtkMatrix4x4::Zero(*this->Element); this->Modified(); }
00098
00099 static void Zero(double Elements[16]);
00100
00101
00103 void Identity()
00104 { vtkMatrix4x4::Identity(*this->Element); this->Modified();}
00105
00106 static void Identity(double Elements[16]);
00107
00108
00111 static void Invert(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00112 {vtkMatrix4x4::Invert(*in->Element,*out->Element); out->Modified(); }
00113 void Invert()
00114 { vtkMatrix4x4::Invert(this,this); }
00115
00116 static void Invert(const double inElements[16], double outElements[16]);
00117
00118
00119
00121 static void Transpose(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00122 {vtkMatrix4x4::Transpose(*in->Element,*out->Element); out->Modified(); }
00123 void Transpose()
00124 { vtkMatrix4x4::Transpose(this,this); }
00125
00126 static void Transpose(const double inElements[16], double outElements[16]);
00127
00128
00131 void MultiplyPoint(const float in[4], float out[4])
00132 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00133 void MultiplyPoint(const double in[4], double out[4])
00134 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00135
00136
00137 static void MultiplyPoint(const double Elements[16],
00138 const float in[4], float out[4]);
00139 static void MultiplyPoint(const double Elements[16],
00140 const double in[4], double out[4]);
00141
00142
00145 float *MultiplyPoint(const float in[4])
00146 {return this->MultiplyFloatPoint(in); }
00147 float *MultiplyFloatPoint(const float in[4])
00148 {this->MultiplyPoint(in,this->FloatPoint); return this->FloatPoint; }
00149 double *MultiplyDoublePoint(const double in[4])
00150 {this->MultiplyPoint(in,this->DoublePoint); return this->DoublePoint; }
00151
00153 static void Multiply4x4(vtkMatrix4x4 *a, vtkMatrix4x4 *b, vtkMatrix4x4 *c) {
00154 vtkMatrix4x4::Multiply4x4(*a->Element,*b->Element,*c->Element); };
00155
00156 static void Multiply4x4(const double a[16], const double b[16],
00157 double c[16]);
00158
00159
00161 void Adjoint(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00162 {vtkMatrix4x4::Adjoint(*in->Element,*out->Element);}
00163
00164 static void Adjoint(const double inElements[16], double outElements[16]);
00165
00166
00168 double Determinant() {return vtkMatrix4x4::Determinant(*this->Element);}
00169
00170 static double Determinant(const double Elements[16]);
00171
00172
00174 void SetElement(int i, int j, double value);
00175
00177 double GetElement(int i, int j) const
00178 {return this->Element[i][j];}
00179
00181 void PointMultiply(const float in[4], float out[4]);
00182 void PointMultiply(const double in[4], double out[4]);
00183
00184 double *operator[](const unsigned int i)
00185 {return &(this->Element[i][0]);}
00186 const double *operator[](unsigned int i) const
00187 { return &(this->Element[i][0]); }
00188 void operator= (double element);
00189 void Adjoint(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00190 {this->Adjoint(&in,&out);}
00191 double Determinant(vtkMatrix4x4 &in)
00192 {return this->Determinant(&in);}
00193 double Determinant(vtkMatrix4x4 *in)
00194 {return vtkMatrix4x4::Determinant(*in->Element);}
00195 void Invert(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00196 {this->Invert(&in,&out);}
00197 void Transpose(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00198 {this->Transpose(&in,&out);}
00199 static void PointMultiply(const double Elements[16],
00200 const float in[4], float out[4]);
00201 static void PointMultiply(const double Elements[16],
00202 const double in[4], double out[4]);
00203
00204
00205 protected:
00206 vtkMatrix4x4() { vtkMatrix4x4::Identity(*this->Element); };
00207 ~vtkMatrix4x4() {};
00208 vtkMatrix4x4(const vtkMatrix4x4&);
00209 void operator= (const vtkMatrix4x4& source);
00210
00211 float FloatPoint[4];
00212 double DoublePoint[4];
00213 };
00214
00215 inline void vtkMatrix4x4::SetElement(int i, int j, double value)
00216 {
00217 if (this->Element[i][j] != value)
00218 {
00219 this->Element[i][j] = value;
00220 this->Modified();
00221 }
00222 }
00223
00224 #endif
00225