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
00057 #ifndef __vtkMatrix4x4_h
00058 #define __vtkMatrix4x4_h
00059
00060 #include "vtkObject.h"
00061
00062 class VTK_COMMON_EXPORT vtkMatrix4x4 : public vtkObject
00063 {
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 public:
00074 double Element[4][4];
00075
00077 static vtkMatrix4x4 *New();
00078
00079 vtkTypeMacro(vtkMatrix4x4,vtkObject);
00080 void PrintSelf(ostream& os, vtkIndent indent);
00081
00083
00085 void DeepCopy(vtkMatrix4x4 *source)
00086 {vtkMatrix4x4::DeepCopy(*this->Element,source); this->Modified(); }
00088
00089 static void DeepCopy(double Elements[16], vtkMatrix4x4 *source)
00090 {vtkMatrix4x4::DeepCopy(Elements,*source->Element); }
00091 static void DeepCopy(double Elements[16], const double newElements[16]);
00092
00093
00095
00096 void DeepCopy(const double Elements[16])
00097 { this->DeepCopy(*this->Element,Elements); this->Modified(); }
00099
00101
00102 void Zero()
00103 { vtkMatrix4x4::Zero(*this->Element); this->Modified(); }
00105
00106 static void Zero(double Elements[16]);
00107
00108
00110
00111 void Identity()
00112 { vtkMatrix4x4::Identity(*this->Element); this->Modified();}
00114
00115 static void Identity(double Elements[16]);
00116
00117
00119
00121 static void Invert(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00122 {vtkMatrix4x4::Invert(*in->Element,*out->Element); out->Modified(); }
00123 void Invert()
00124 { vtkMatrix4x4::Invert(this,this); }
00126
00127 static void Invert(const double inElements[16], double outElements[16]);
00128
00129
00130
00132
00133 static void Transpose(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00134 {vtkMatrix4x4::Transpose(*in->Element,*out->Element); out->Modified(); }
00135 void Transpose()
00136 { vtkMatrix4x4::Transpose(this,this); }
00138
00139 static void Transpose(const double inElements[16], double outElements[16]);
00140
00141
00143
00145 void MultiplyPoint(const float in[4], float out[4])
00146 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00147 void MultiplyPoint(const double in[4], double out[4])
00148 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00150
00151
00152 static void MultiplyPoint(const double Elements[16],
00153 const float in[4], float out[4]);
00154 static void MultiplyPoint(const double Elements[16],
00155 const double in[4], double out[4]);
00156
00157
00159
00161 float *MultiplyPoint(const float in[4])
00162 {return this->MultiplyFloatPoint(in); }
00163 float *MultiplyFloatPoint(const float in[4])
00164 {this->MultiplyPoint(in,this->FloatPoint); return this->FloatPoint; }
00165 double *MultiplyDoublePoint(const double in[4])
00166 {this->MultiplyPoint(in,this->DoublePoint); return this->DoublePoint; }
00168
00170
00171 static void Multiply4x4(vtkMatrix4x4 *a, vtkMatrix4x4 *b, vtkMatrix4x4 *c) {
00172 vtkMatrix4x4::Multiply4x4(*a->Element,*b->Element,*c->Element); };
00174
00175 static void Multiply4x4(const double a[16], const double b[16],
00176 double c[16]);
00177
00178
00180
00181 void Adjoint(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00182 {vtkMatrix4x4::Adjoint(*in->Element,*out->Element);}
00184
00185 static void Adjoint(const double inElements[16], double outElements[16]);
00186
00187
00189 double Determinant() {return vtkMatrix4x4::Determinant(*this->Element);}
00190
00191 static double Determinant(const double Elements[16]);
00192
00193
00195 void SetElement(int i, int j, double value);
00196
00198
00199 double GetElement(int i, int j) const
00200 {return this->Element[i][j];}
00202
00203
00204 double *operator[](const unsigned int i)
00205 {return &(this->Element[i][0]);}
00206 const double *operator[](unsigned int i) const
00207 { return &(this->Element[i][0]); }
00208 void operator= (double element);
00209 void Adjoint(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00210 {this->Adjoint(&in,&out);}
00211 double Determinant(vtkMatrix4x4 &in)
00212 {return this->Determinant(&in);}
00213 double Determinant(vtkMatrix4x4 *in)
00214 {return vtkMatrix4x4::Determinant(*in->Element);}
00215 void Invert(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00216 {this->Invert(&in,&out);}
00217 void Transpose(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00218 {this->Transpose(&in,&out);}
00219 static void PointMultiply(const double Elements[16],
00220 const float in[4], float out[4]);
00221 static void PointMultiply(const double Elements[16],
00222 const double in[4], double out[4]);
00223
00224
00225 protected:
00226 vtkMatrix4x4() { vtkMatrix4x4::Identity(*this->Element); };
00227 ~vtkMatrix4x4() {};
00228
00229 float FloatPoint[4];
00230 double DoublePoint[4];
00231 private:
00232 vtkMatrix4x4(const vtkMatrix4x4&);
00233 void operator= (const vtkMatrix4x4& source);
00234 };
00235
00236 inline void vtkMatrix4x4::SetElement(int i, int j, double value)
00237 {
00238 if (this->Element[i][j] != value)
00239 {
00240 this->Element[i][j] = value;
00241 this->Modified();
00242 }
00243 }
00244
00245 #endif
00246