00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00047 #ifndef __vtkMatrix4x4_h
00048 #define __vtkMatrix4x4_h
00049
00050 #include "vtkObject.h"
00051
00052 class VTK_COMMON_EXPORT vtkMatrix4x4 : public vtkObject
00053 {
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 public:
00064 double Element[4][4];
00065
00067 static vtkMatrix4x4 *New();
00068
00069 vtkTypeRevisionMacro(vtkMatrix4x4,vtkObject);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00073
00075 void DeepCopy(vtkMatrix4x4 *source)
00076 {vtkMatrix4x4::DeepCopy(*this->Element,source); this->Modified(); }
00078
00079 static void DeepCopy(double Elements[16], vtkMatrix4x4 *source)
00080 {vtkMatrix4x4::DeepCopy(Elements,*source->Element); }
00081 static void DeepCopy(double Elements[16], const double newElements[16]);
00082
00083
00085
00086 void DeepCopy(const double Elements[16])
00087 { this->DeepCopy(*this->Element,Elements); this->Modified(); }
00089
00091
00092 void Zero()
00093 { vtkMatrix4x4::Zero(*this->Element); this->Modified(); }
00095
00096 static void Zero(double Elements[16]);
00097
00098
00100
00101 void Identity()
00102 { vtkMatrix4x4::Identity(*this->Element); this->Modified();}
00104
00105 static void Identity(double Elements[16]);
00106
00107
00109
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); }
00116
00117 static void Invert(const double inElements[16], double outElements[16]);
00118
00119
00120
00122
00123 static void Transpose(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00124 {vtkMatrix4x4::Transpose(*in->Element,*out->Element); out->Modified(); }
00125 void Transpose()
00126 { vtkMatrix4x4::Transpose(this,this); }
00128
00129 static void Transpose(const double inElements[16], double outElements[16]);
00130
00131
00133
00135 void MultiplyPoint(const float in[4], float out[4])
00136 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00137 void MultiplyPoint(const double in[4], double out[4])
00138 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00140
00141
00142 static void MultiplyPoint(const double Elements[16],
00143 const float in[4], float out[4]);
00144 static void MultiplyPoint(const double Elements[16],
00145 const double in[4], double out[4]);
00146
00147
00149
00151 float *MultiplyPoint(const float in[4])
00152 {return this->MultiplyFloatPoint(in); }
00153 float *MultiplyFloatPoint(const float in[4])
00154 {this->MultiplyPoint(in,this->FloatPoint); return this->FloatPoint; }
00155 double *MultiplyDoublePoint(const double in[4])
00156 {this->MultiplyPoint(in,this->DoublePoint); return this->DoublePoint; }
00158
00160
00161 static void Multiply4x4(vtkMatrix4x4 *a, vtkMatrix4x4 *b, vtkMatrix4x4 *c) {
00162 vtkMatrix4x4::Multiply4x4(*a->Element,*b->Element,*c->Element); };
00164
00165 static void Multiply4x4(const double a[16], const double b[16],
00166 double c[16]);
00167
00168
00170
00171 void Adjoint(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00172 {vtkMatrix4x4::Adjoint(*in->Element,*out->Element);}
00174
00175 static void Adjoint(const double inElements[16], double outElements[16]);
00176
00177
00179 double Determinant() {return vtkMatrix4x4::Determinant(*this->Element);}
00180
00181 static double Determinant(const double Elements[16]);
00182
00183
00185 void SetElement(int i, int j, double value);
00186
00188
00189 double GetElement(int i, int j) const
00190 {return this->Element[i][j];}
00192
00193
00194 double *operator[](const unsigned int i)
00195 {return &(this->Element[i][0]);}
00196 const double *operator[](unsigned int i) const
00197 { return &(this->Element[i][0]); }
00198 void Adjoint(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00199 {this->Adjoint(&in,&out);}
00200 double Determinant(vtkMatrix4x4 &in)
00201 {return this->Determinant(&in);}
00202 double Determinant(vtkMatrix4x4 *in)
00203 {return vtkMatrix4x4::Determinant(*in->Element);}
00204 void Invert(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00205 {this->Invert(&in,&out);}
00206 void Transpose(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00207 {this->Transpose(&in,&out);}
00208 static void PointMultiply(const double Elements[16],
00209 const float in[4], float out[4]);
00210 static void PointMultiply(const double Elements[16],
00211 const double in[4], double out[4]);
00212
00213
00214 protected:
00215 vtkMatrix4x4() { vtkMatrix4x4::Identity(*this->Element); };
00216 ~vtkMatrix4x4() {};
00217
00218 float FloatPoint[4];
00219 double DoublePoint[4];
00220 private:
00221 vtkMatrix4x4(const vtkMatrix4x4&);
00222 void operator= (const vtkMatrix4x4&);
00223 };
00224
00225 inline void vtkMatrix4x4::SetElement(int i, int j, double value)
00226 {
00227 if (this->Element[i][j] != value)
00228 {
00229 this->Element[i][j] = value;
00230 this->Modified();
00231 }
00232 }
00233
00234 #endif
00235