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 #ifndef TRANSFORMATION_MATRIX_HH
00026 #define TRANSFORMATION_MATRIX_HH
00027
00028 #include "math-extension.hh"
00029 #include "vertex.hh"
00030 #include "inline-macro.hh"
00031
00032 #include <iostream>
00033
00034
00035 class CVector;
00036
00043 class CTransformationMatrix
00044 {
00045 private:
00046 TCoordinate FElements[4][4];
00047
00048 public:
00049
00050
00051
00055 typedef enum { NullMatrix, IdentityMatrix, AnyMatrix } TMatrixType;
00056
00057
00058
00059
00060
00069 CTransformationMatrix(TMatrixType AType = IdentityMatrix);
00070
00079 CTransformationMatrix(const CTransformationMatrix& AMatrix);
00080
00089 CTransformationMatrix(TCoordinate A00, TCoordinate A01,
00090 TCoordinate A02, TCoordinate A03,
00091
00092 TCoordinate A10, TCoordinate A11,
00093 TCoordinate A12, TCoordinate A13,
00094
00095 TCoordinate A20, TCoordinate A21,
00096 TCoordinate A22, TCoordinate A23,
00097
00098 TCoordinate A30, TCoordinate A31,
00099 TCoordinate A32, TCoordinate A33);
00100
00113 CTransformationMatrix(const CVertex& ALine1,
00114 const CVertex& ALine2,
00115 const CVertex& ALine3);
00116
00120 ~CTransformationMatrix();
00121
00122
00123
00124
00125
00134 void setToNull();
00135
00144 void setToIdentity();
00145
00152 CTransformationMatrix& operator=(const CTransformationMatrix& AMatrix);
00153
00154
00155
00156
00157
00165 TCoordinate* operator[](int ARow) const;
00166
00167
00168
00169
00170
00179 CTransformationMatrix operator*(const CTransformationMatrix& AMatrix) const;
00180
00189 CVector operator*(const CVector& AVector) const;
00190
00191
00192
00193
00194
00201 void translate(const CVertex& AVector);
00202
00213 void rotate(const CVertex& AAxeDirection, TCoordinate AAngle);
00214
00227 void rotate(const CVertex& AAxeVertex,
00228 const CVertex& AAxeDirection, TCoordinate AAngle);
00229
00244 void rotate(const CVertex& AAngles);
00245
00255 void rotate180(const CVertex& AAxeDirection);
00256
00264 void scale(TCoordinate ACoef);
00265
00273 void scale(const CVertex& ACoef);
00274
00282 void scale(const CVertex& ACenter, TCoordinate ACoef);
00283
00292 void scale(const CVertex& ACenter, const CVertex& ACoef);
00293
00304 void axialScale(const CVertex& AAxeDirection, TCoordinate ACoef);
00305
00317 void axialScale(const CVertex& AAxeVertex,
00318 const CVertex& AAxeDirection, TCoordinate ACoef);
00319
00330 void planarScale(const CVertex& APlaneNormal, TCoordinate ACoef);
00331
00343 void planarScale(const CVertex& APlaneVertex,
00344 const CVertex& APlaneNormal, TCoordinate ACoef);
00345
00358 void orientate(const CVertex& AVector1, const CVertex& AVector2);
00359
00374 void orientate(const CVertex& ACenter,
00375 const CVertex& AVector1, const CVertex& AVector2);
00376
00396 void orientate(const CVertex& AVectorU1, const CVertex& AVectorV1,
00397 const CVertex& AVectorU2, const CVertex& AVectorV2);
00398
00413 void transform(const CVertex& AOrigin1 ,
00414 const CVertex& AVectorU1, const CVertex& AVectorV1,
00415 const CVertex& AOrigin2 ,
00416 const CVertex& AVectorU2, const CVertex& AVectorV2,
00417 const CVertex& ACoef = CVertex(1,1,1));
00418
00419
00420
00421
00422
00426 void applyOn(CVertex& AVertex) const;
00427
00432 void applyOn(const CVertex& AVertex, CVertex& AResult) const;
00433
00434
00435 };
00436
00437
00438
00439
00440 extern const CTransformationMatrix COONS ;
00441 extern const CTransformationMatrix HERMITE ;
00442 extern const CTransformationMatrix BEZIER ;
00443 extern const CTransformationMatrix OVERHAUSER;
00444 extern const CTransformationMatrix SPLINE ;
00445
00446
00447
00448
00449
00455 std::ostream& operator<<(std::ostream& AStream,
00456 const CTransformationMatrix& AMatrix);
00457
00458
00459
00460 #include INCLUDE_INLINE("transformation-matrix.icc")
00461
00462 #endif // TRANSFORMATION_MATRIX_HH
00463