CFx SDK Documentation  2020SP3
GeMatrix3d.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 #ifndef OD_GE_MATRIX_3D_H
26 #define OD_GE_MATRIX_3D_H
28 #include "Ge/GeGbl.h"
29 #include "Ge/GeMatrix2d.h"
30 #include "Ge/GePoint3d.h"
31 
32 class OdGeLine3d;
33 class OdGeVector3d;
34 class OdGePlane;
35 class OdGeTol;
36 class OdGeScale3d;
37 
38 #include "TD_PackPush.h"
39 
73 {
74 public:
76  //OdGeMatrix3d(const OdGeMatrix3d& src);
77  //OdGeMatrix3d& operator =(const OdGeMatrix3d& src);
78 
79  GE_STATIC_EXPORT static const OdGeMatrix3d kIdentity; // Multiplicative identity matrix.
80 
81  // Reset matrix.
82  //
83 
88 
93  const OdGeTol& tol = OdGeContext::gTol); // for correcting in case that Zero is corrupted
94 
95  // Multiplication.
96  //
97 
102  const OdGeMatrix3d& matrix) const;
103 
108  OdGeMatrix3d& operator *=(
109  const OdGeMatrix3d& matrix);
110 
118  const OdGeMatrix3d& leftSide);
119 
127  const OdGeMatrix3d& rightSide);
128 
137  const OdGeMatrix3d& matrix1,
138  const OdGeMatrix3d& matrix2);
139 
140  // Multiplicative inverse.
141  //
142 
148 
149 
152  const OdGeTol& tol) const;
153 
161  bool inverse(
162  OdGeMatrix3d& inverseMatrix,
163  double tol) const;
164 
173  const OdGeTol& tol = OdGeContext::gTol) const;
174 
180 
185 
190  const OdGeMatrix3d& matrix) const;
191 
196  const OdGeMatrix3d& matrix) const;
197 
205  bool isEqualTo(
206  const OdGeMatrix3d& matrix,
207  const OdGeTol& tol = OdGeContext::gTol) const;
208 
217  const OdGeTol& tol = OdGeContext::gTol) const;
218 
227  const OdGeTol& tol = OdGeContext::gTol) const;
228 
231  const OdGeTol& tol = OdGeContext::gTol) const;
232 
236  double det() const;
237 
244  const OdGeVector3d& vect);
245 
258  const OdGePoint3d& origin,
259  const OdGeVector3d& xAxis,
260  const OdGeVector3d& yAxis,
261  const OdGeVector3d& zAxis);
262 
273  OdGePoint3d& origin,
274  OdGeVector3d& xAxis,
275  OdGeVector3d& yAxis,
276  OdGeVector3d& zAxis) const;
277 
283 
289 
300 
309  const OdGeVector3d& vect);
310 
321  double angle,
322  const OdGeVector3d& axis,
323  const OdGePoint3d& center = OdGePoint3d::kOrigin);
324 
334  double scale,
335  const OdGePoint3d& center = OdGePoint3d::kOrigin);
336 
346  const OdGeScale3d& scale,
347  const OdGePoint3d& center = OdGePoint3d::kOrigin);
348 
357  const OdGePlane& mirrorPlane);
358 
367  const OdGePoint3d& mirrorPoint);
368 
377  const OdGeLine3d& mirrorLine);
378 
389  const OdGePlane& projectionPlane,
390  const OdGeVector3d& projectDir);
391 
409  const OdGePoint3d& fromOrigin,
410  const OdGeVector3d& fromXAxis,
411  const OdGeVector3d& fromYAxis,
412  const OdGeVector3d& fromZAxis,
413  const OdGePoint3d& toOrigin,
414  const OdGeVector3d& toXAxis,
415  const OdGeVector3d& toYAxis,
416  const OdGeVector3d& toZAxis);
417 
418 
429  const OdGeVector3d& normal);
430 
438  const OdGePlane& plane);
439 
450  const OdGeVector3d& normal);
451 
459  const OdGePlane& plane);
460 
467  const OdGeVector3d& vect);
468 
473 
484  double angle,
485  const OdGeVector3d& axis,
486  const OdGePoint3d& center = OdGePoint3d::kOrigin);
487 
497  double scale,
498  const OdGePoint3d& center = OdGePoint3d::kOrigin);
499 
509  const OdGeScale3d& scale,
510  const OdGePoint3d& center = OdGePoint3d::kOrigin);
511 
520  const OdGePlane& mirrorPlane);
521 
530  const OdGePoint3d& mirrorPoint);
531 
540  const OdGeLine3d& mirrorLine);
541 
551  const OdGePlane& projectionPlane,
552  const OdGeVector3d& projectDir);
553 
570  const OdGePoint3d& fromOrigin,
571  const OdGeVector3d& fromXAxis,
572  const OdGeVector3d& fromYAxis,
573  const OdGeVector3d& fromZAxis,
574  const OdGePoint3d& toOrigin,
575  const OdGeVector3d& toXAxis,
576  const OdGeVector3d& toYAxis,
577  const OdGeVector3d& toZAxis);
578 
589  const OdGeVector3d& normal);
590 
598  const OdGePlane&);
599 
610  const OdGeVector3d& normal);
611 
619  const OdGePlane&);
620 
628  double scale() const;
629 
633  double norm() const;
634 
646  OdGeVector3d& normal,
647  double& elevation) const;
648 
649  // For convenient access to the data.
650  //
651 
657  const double* operator [](
658  int row) const;
659  double* operator [](
660  int row);
661 
668  double operator ()(
669  int row,
670  int column) const;
671  double& operator ()(
672  int row,
673  int column);
674 
675  double entry[4][4];
676 };
677 
678 // these operations really decrease rendering performance in non-inline case
679 
680 inline const double* OdGeMatrix3d::operator [](int row) const
681 {
682  return entry[row];
683 }
684 
685 inline double* OdGeMatrix3d::operator [](int row)
686 {
687  return entry[row];
688 }
689 
690 inline double OdGeMatrix3d::operator ()(int row, int column) const
691 {
692  return entry[row][column];
693 }
694 
695 inline double& OdGeMatrix3d::operator ()(int row, int column)
696 {
697  return entry[row][column];
698 }
699 
700 #include "TD_PackPop.h"
701 
702 #endif // OD_GE_MATRIX_3D_H
OdGeLine3d
Definition: GeLine3d.h:43
OdGeMatrix3d::mirroring
static OdGeMatrix3d mirroring(const OdGeLine3d &mirrorLine)
OdGeMatrix3d::setCoordSystem
OdGeMatrix3d & setCoordSystem(const OdGePoint3d &origin, const OdGeVector3d &xAxis, const OdGeVector3d &yAxis, const OdGeVector3d &zAxis)
OdGePlane
Definition: GePlane.h:45
OdGeMatrix3d::scaling
static OdGeMatrix3d scaling(const OdGeScale3d &scale, const OdGePoint3d &center=OdGePoint3d::kOrigin)
OdGeMatrix3d::setToScaling
OdGeMatrix3d & setToScaling(const OdGeScale3d &scale, const OdGePoint3d &center=OdGePoint3d::kOrigin)
OdGeVector3d
Definition: GeVector3d.h:54
OdGeMatrix3d::mirroring
static OdGeMatrix3d mirroring(const OdGePoint3d &mirrorPoint)
OdGeMatrix3d::invert
OdGeMatrix3d & invert()
OdGeMatrix3d::isEqualTo
bool isEqualTo(const OdGeMatrix3d &matrix, const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix3d::setToRotation
OdGeMatrix3d & setToRotation(double angle, const OdGeVector3d &axis, const OdGePoint3d &center=OdGePoint3d::kOrigin)
scale
scale
Definition: DimVarDefs.h:1684
tol
tol
Definition: DimVarDefs.h:2287
OdGeMatrix3d::getCsZAxis
OdGeVector3d getCsZAxis() const
OdGeMatrix3d::setToWorldToPlane
OdGeMatrix3d & setToWorldToPlane(const OdGePlane &plane)
OdGeMatrix3d::setTranslation
OdGeMatrix3d & setTranslation(const OdGeVector3d &vect)
OdGeMatrix3d::projection
static OdGeMatrix3d projection(const OdGePlane &projectionPlane, const OdGeVector3d &projectDir)
OdGeMatrix3d::scale
double scale() const
OdGeScale3d
Definition: GeScale3d.h:47
OdGeMatrix3d::operator()
double operator()(int row, int column) const
Definition: GeMatrix3d.h:690
OdGeMatrix3d::isUniScaledOrtho
bool isUniScaledOrtho(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix3d::setToMirroring
OdGeMatrix3d & setToMirroring(const OdGeLine3d &mirrorLine)
TD_PackPop.h
OdGeMatrix3d::setToAlignCoordSys
OdGeMatrix3d & setToAlignCoordSys(const OdGePoint3d &fromOrigin, const OdGeVector3d &fromXAxis, const OdGeVector3d &fromYAxis, const OdGeVector3d &fromZAxis, const OdGePoint3d &toOrigin, const OdGeVector3d &toXAxis, const OdGeVector3d &toYAxis, const OdGeVector3d &toZAxis)
OdGeMatrix3d::getCsXAxis
OdGeVector3d getCsXAxis() const
OdGeMatrix3d::worldToPlane
static OdGeMatrix3d worldToPlane(const OdGePlane &)
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdGeMatrix3d::scaling
static OdGeMatrix3d scaling(double scale, const OdGePoint3d &center=OdGePoint3d::kOrigin)
OdGeMatrix3d::inverse
OdGeMatrix3d inverse(const OdGeTol &tol) const
OdGeMatrix3d::postMultBy
OdGeMatrix3d & postMultBy(const OdGeMatrix3d &rightSide)
operator*
GE_TOOLKIT_EXPORT OdGeVector3d operator*(const OdGeMatrix3d &matrix, const OdGeVector3d &vect)
OdGeMatrix3d::worldToPlane
static OdGeMatrix3d worldToPlane(const OdGeVector3d &normal)
OdGeMatrix3d::setToIdentity
OdGeMatrix3d & setToIdentity()
OdGeMatrix3d::setToMirroring
OdGeMatrix3d & setToMirroring(const OdGePlane &mirrorPlane)
OdGeMatrix3d::planeToWorld
static OdGeMatrix3d planeToWorld(const OdGePlane &)
OdGeMatrix3d::getCsOrigin
OdGePoint3d getCsOrigin() const
OdGeMatrix3d::getCoordSystem
void getCoordSystem(OdGePoint3d &origin, OdGeVector3d &xAxis, OdGeVector3d &yAxis, OdGeVector3d &zAxis) const
OdGePoint3d
Definition: GePoint3d.h:55
OdGeMatrix3d::operator[]
const double * operator[](int row) const
Definition: GeMatrix3d.h:680
OdDAI::operator!=
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
GeMatrix2d.h
OdGeMatrix3d::setToMirroring
OdGeMatrix3d & setToMirroring(const OdGePoint3d &mirrorPoint)
GePoint3d.h
OdGeMatrix3d::OdGeMatrix3d
OdGeMatrix3d()
OdGeMatrix3d::mirroring
static OdGeMatrix3d mirroring(const OdGePlane &mirrorPlane)
OdGeMatrix3d::setToProduct
OdGeMatrix3d & setToProduct(const OdGeMatrix3d &matrix1, const OdGeMatrix3d &matrix2)
OdGeMatrix3d::getCsYAxis
OdGeVector3d getCsYAxis() const
OdGeMatrix3d::preMultBy
OdGeMatrix3d & preMultBy(const OdGeMatrix3d &leftSide)
OdGeMatrix3d::isSingular
bool isSingular(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix3d::norm
double norm() const
OdGeMatrix3d::setToPlaneToWorld
OdGeMatrix3d & setToPlaneToWorld(const OdGeVector3d &normal)
OdGePoint3d::kOrigin
static GE_STATIC_EXPORT const OdGePoint3d kOrigin
Definition: GePoint3d.h:89
TD_PackPush.h
OdGeMatrix3d::inverse
OdGeMatrix3d inverse() const
OdGeMatrix3d::det
double det() const
OdGeMatrix3d::setToPlaneToWorld
OdGeMatrix3d & setToPlaneToWorld(const OdGePlane &plane)
OdGeMatrix3d::transposeIt
OdGeMatrix3d & transposeIt()
OdGeMatrix3d::isPerspective
bool isPerspective(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix3d::setToWorldToPlane
OdGeMatrix3d & setToWorldToPlane(const OdGeVector3d &normal)
OdGeMatrix3d::setToTranslation
OdGeMatrix3d & setToTranslation(const OdGeVector3d &vect)
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
GE_TOOLKIT_EXPORT
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
OdGeMatrix3d::rotation
static OdGeMatrix3d rotation(double angle, const OdGeVector3d &axis, const OdGePoint3d &center=OdGePoint3d::kOrigin)
OdGeMatrix2d
Definition: GeMatrix2d.h:73
OdGeMatrix3d::translation
static OdGeMatrix3d translation(const OdGeVector3d &vect)
OdDAI::operator==
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
OdGeMatrix3d::convertToLocal
OdGeMatrix2d convertToLocal(OdGeVector3d &normal, double &elevation) const
OdGeMatrix3d::alignCoordSys
static OdGeMatrix3d alignCoordSys(const OdGePoint3d &fromOrigin, const OdGeVector3d &fromXAxis, const OdGeVector3d &fromYAxis, const OdGeVector3d &fromZAxis, const OdGePoint3d &toOrigin, const OdGeVector3d &toXAxis, const OdGeVector3d &toYAxis, const OdGeVector3d &toZAxis)
OdGeMatrix3d::translation
OdGeVector3d translation() const
OdGeMatrix3d::setToScaling
OdGeMatrix3d & setToScaling(double scale, const OdGePoint3d &center=OdGePoint3d::kOrigin)
OdGeMatrix3d::entry
double entry[4][4]
Definition: GeMatrix3d.h:675
GE_STATIC_EXPORT
#define GE_STATIC_EXPORT
Definition: GeExport.h:53
OdGeMatrix3d::transpose
OdGeMatrix3d transpose() const
OdGeTol
Definition: GeTol.h:49
OdGeMatrix3d::isScaledOrtho
bool isScaledOrtho(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix3d::validateZero
void validateZero(const OdGeTol &tol=OdGeContext::gTol)
OdGeMatrix3d::planeToWorld
static OdGeMatrix3d planeToWorld(const OdGeVector3d &normal)
OdGeMatrix3d::kIdentity
static GE_STATIC_EXPORT const OdGeMatrix3d kIdentity
Definition: GeMatrix3d.h:79
OdGeMatrix3d::setToProjection
OdGeMatrix3d & setToProjection(const OdGePlane &projectionPlane, const OdGeVector3d &projectDir)
OdGeMatrix3d::inverse
bool inverse(OdGeMatrix3d &inverseMatrix, double tol) const