VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
homogeneousTransformMatrix.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1999 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 #ifndef homogeneousTransformMatrix_H_
6 #define homogeneousTransformMatrix_H_
7 
8 //forward declarations
9 class Dt4dPoint;
10 class DtPoint;
11 class DtChord;
12 class DtExtent;
13 
14 #include <matrix/vlVector.h>
16 #include "stdio.h"
17 
18 typedef unsigned DtMatrix4x4Sub;
19 
20 //
21 //
22 // class DtHomogeneousTransformMatrix
23 //
24 //
26 {
27  public:
29 
30  // Initializations.
31  void initToIdentityTransformation();
32  void initTranslation(const DtPoint& wc);
33  void initScale(double sx, double sy, double sz);
34  void initShear(double shx, double shy);
35  void initRotAboutX(double theta);
36  void initRotAboutY(double theta);
37  void initRotAboutZ(double theta);
38  void initPerspective(double distanceToProjectionPlane);
39  void initPerspectiveToParallel(double zmin);
40 
41  void setTranslation(const DtPoint& wc);
42  void setScale(double sx, double sy, double sz);
43  void setShear(double shx, double shy);
44  void setRotAboutX(double theta);
45  void setRotAboutY(double theta);
46  void setRotAboutZ(double theta);
47  void setPerspective(double distanceToProjectionPlane);
48  void setPerspectiveToParallel(double zmin);
49 
50  void setRow(int col, double sx, double sy, double sz, double sa);
51  void setColumn(int col, double sx, double sy, double sz, double sa);
52 
53  // Matrix operations.
54  void transpose();
55  void transposeInto(DtHomogeneousTransformMatrix& out) const;
56  void invert();
57  void invertInto(DtHomogeneousTransformMatrix& out) const;
58  void concatenate(const DtHomogeneousTransformMatrix& m1,
59  const DtHomogeneousTransformMatrix& m2);
60  // Safe to use on itself
61 
62  // Transformation operations.
63  void transformPoint(DtPoint& out, const DtPoint& in) const;
64  void transformPoint(DtPoint& inout) const;
65  void transformVector(DtVector& out, const DtVector& in) const;
66  void transformVector(DtVector& inout) const;
67  void transformChord(DtChord& out, const DtChord& in) const;
68  void transformChord(DtChord& inout) const;
69  void transformExtent(DtExtent& inout) const;
70 
71  // returns true if the matrix is identity
72  bool isIdentity() const;
73 
74  // I/O.
75  bool readFrom(FILE* fp);
76  bool writeTo(FILE* fp);
77  void dump(const char* label, int indentLevel) const;
78 
79 protected:
80 
81  // Homogeneous coordinates are needed for above transformations.
82  void transform(Dt4dPoint& out, const Dt4dPoint& in) const;
83  void swapRow(int row1, int row2);
84  void divideRow(int row, double divisor);
85 
86 protected:
87 
88  double myMatrix[4][4];
89 };
90 
91 #endif
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
#define DT_DLL_geometry
Definition: geometryDefines.h:23
unsigned DtMatrix4x4Sub
Definition: homogeneousTransformMatrix.h:12
Definition: homogeneousTransformMatrix.h:25
Definition: point.h:34

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)