00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00033 #ifndef __vtkMatrix4x4_h
00034 #define __vtkMatrix4x4_h
00035
00036 #include "vtkObject.h"
00037
00038 class VTK_COMMON_EXPORT vtkMatrix4x4 : public vtkObject
00039 {
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 public:
00050 double Element[4][4];
00051
00053 static vtkMatrix4x4 *New();
00054
00055 vtkTypeRevisionMacro(vtkMatrix4x4,vtkObject);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00059
00061 void DeepCopy(vtkMatrix4x4 *source)
00062 {vtkMatrix4x4::DeepCopy(*this->Element,source); this->Modified(); }
00064
00065 static void DeepCopy(double Elements[16], vtkMatrix4x4 *source)
00066 {vtkMatrix4x4::DeepCopy(Elements,*source->Element); }
00067 static void DeepCopy(double Elements[16], const double newElements[16]);
00068
00069
00071
00072 void DeepCopy(const double Elements[16])
00073 { this->DeepCopy(*this->Element,Elements); this->Modified(); }
00075
00077
00078 void Zero()
00079 { vtkMatrix4x4::Zero(*this->Element); this->Modified(); }
00081
00082 static void Zero(double Elements[16]);
00083
00084
00086
00087 void Identity()
00088 { vtkMatrix4x4::Identity(*this->Element); this->Modified();}
00090
00091 static void Identity(double Elements[16]);
00092
00093
00095
00097 static void Invert(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00098 {vtkMatrix4x4::Invert(*in->Element,*out->Element); out->Modified(); }
00099 void Invert()
00100 { vtkMatrix4x4::Invert(this,this); }
00102
00103 static void Invert(const double inElements[16], double outElements[16]);
00104
00105
00106
00108
00109 static void Transpose(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00110 {vtkMatrix4x4::Transpose(*in->Element,*out->Element); out->Modified(); }
00111 void Transpose()
00112 { vtkMatrix4x4::Transpose(this,this); }
00114
00115 static void Transpose(const double inElements[16], double outElements[16]);
00116
00117
00119
00121 void MultiplyPoint(const float in[4], float out[4])
00122 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00123 void MultiplyPoint(const double in[4], double out[4])
00124 {vtkMatrix4x4::MultiplyPoint(*this->Element,in,out); }
00126
00127
00128 static void MultiplyPoint(const double Elements[16],
00129 const float in[4], float out[4]);
00130 static void MultiplyPoint(const double Elements[16],
00131 const double in[4], double out[4]);
00132
00133
00135
00137 float *MultiplyPoint(const float in[4])
00138 {return this->MultiplyFloatPoint(in); }
00139 float *MultiplyFloatPoint(const float in[4])
00140 {this->MultiplyPoint(in,this->FloatPoint); return this->FloatPoint; }
00141 double *MultiplyDoublePoint(const double in[4])
00142 {this->MultiplyPoint(in,this->DoublePoint); return this->DoublePoint; }
00144
00146
00147 static void Multiply4x4(vtkMatrix4x4 *a, vtkMatrix4x4 *b, vtkMatrix4x4 *c) {
00148 vtkMatrix4x4::Multiply4x4(*a->Element,*b->Element,*c->Element); };
00150
00151 static void Multiply4x4(const double a[16], const double b[16],
00152 double c[16]);
00153
00154
00156
00157 void Adjoint(vtkMatrix4x4 *in, vtkMatrix4x4 *out)
00158 {vtkMatrix4x4::Adjoint(*in->Element,*out->Element);}
00160
00161 static void Adjoint(const double inElements[16], double outElements[16]);
00162
00163
00165 double Determinant() {return vtkMatrix4x4::Determinant(*this->Element);}
00166
00167 static double Determinant(const double Elements[16]);
00168
00169
00171 void SetElement(int i, int j, double value);
00172
00174
00175 double GetElement(int i, int j) const
00176 {return this->Element[i][j];}
00178
00179
00180 double *operator[](const unsigned int i)
00181 {return &(this->Element[i][0]);}
00182 const double *operator[](unsigned int i) const
00183 { return &(this->Element[i][0]); }
00184 void Adjoint(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00185 {this->Adjoint(&in,&out);}
00186 double Determinant(vtkMatrix4x4 &in)
00187 {return this->Determinant(&in);}
00188 double Determinant(vtkMatrix4x4 *in)
00189 {return vtkMatrix4x4::Determinant(*in->Element);}
00190 void Invert(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00191 {this->Invert(&in,&out);}
00192 void Transpose(vtkMatrix4x4 &in,vtkMatrix4x4 &out)
00193 {this->Transpose(&in,&out);}
00194 static void PointMultiply(const double Elements[16],
00195 const float in[4], float out[4]);
00196 static void PointMultiply(const double Elements[16],
00197 const double in[4], double out[4]);
00198
00199
00200 protected:
00201 vtkMatrix4x4() { vtkMatrix4x4::Identity(*this->Element); };
00202 ~vtkMatrix4x4() {};
00203
00204 float FloatPoint[4];
00205 double DoublePoint[4];
00206 private:
00207 vtkMatrix4x4(const vtkMatrix4x4&);
00208 void operator= (const vtkMatrix4x4&);
00209 };
00210
00211 inline void vtkMatrix4x4::SetElement(int i, int j, double value)
00212 {
00213 if (this->Element[i][j] != value)
00214 {
00215 this->Element[i][j] = value;
00216 this->Modified();
00217 }
00218 }
00219
00220 #endif
00221