CFx SDK Documentation  2020SP3
GeMatrix2d.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 
26 
27 #ifndef OD_GE_MATRIX_2D_H
28 #define OD_GE_MATRIX_2D_H
30 #include "Ge/GeGbl.h"
31 #include "Ge/GePoint2d.h"
32 // FELIX_CHANGE_BEGIN
33 #include "Ge/GeScale2d.h"
34 // FELIX_CHANGE_END
35 
36 class OdGeVector2d;
37 class OdGeLine2d;
38 class OdGeTol;
39 
40 #include "TD_PackPush.h"
41 
73 {
74 public:
76  //OdGeMatrix2d(const OdGeMatrix2d& src);
77  //OdGeMatrix2d& operator =(const OdGeMatrix2d& src);
78 
83 
88 
93  const OdGeMatrix2d& matrix) const;
94 
99  OdGeMatrix2d& operator*= (
100  const OdGeMatrix2d& matrix);
101 
109  const OdGeMatrix2d& leftSide);
110 
118  const OdGeMatrix2d& rightSide);
119 
128  const OdGeMatrix2d& matrix1,
129  const OdGeMatrix2d& matrix2);
130 
131  // Multiplicative inverse.
132  //
133 
139 
144 
152  bool isSingular(const OdGeTol& tol = OdGeContext::gTol) const;
153 
159 
164 
169  const OdGeMatrix2d& matrix) const;
170 
175  const OdGeMatrix2d& matrix) const;
176 
184  bool isEqualTo(
185  const OdGeMatrix2d& matrix,
186  const OdGeTol& tol = OdGeContext::gTol) const;
187 
197  const OdGeTol& tol = OdGeContext::gTol) const;
198 
207  const OdGeTol& tol = OdGeContext::gTol) const;
208 
216  double scale() const;
217 
218  // Determinant
219  //
220 
224  double det() const;
225 
232  const OdGeVector2d& vect);
233 
238 
245  const OdGeVector2d& vector);
246 
247  // Retrieve scaling, rotation, mirror components
248  //
249 
265  double& scale,
266  double& angle,
267  bool& isMirror,
268  OdGeVector2d& reflex) const;
269 
270 
271  // Set/get coordinate system
272  //
273 
285  const OdGePoint2d& origin,
286  const OdGeVector2d& xAxis,
287  const OdGeVector2d& yAxis);
297  OdGePoint2d& origin,
298  OdGeVector2d& xAxis,
299  OdGeVector2d& yAxis) const;
300 
309  const OdGeVector2d& vect);
310 
311 
321  double angle,
322  const OdGePoint2d& center = OdGePoint2d::kOrigin);
323 
333  double scale,
334  const OdGePoint2d& center = OdGePoint2d::kOrigin);
335 // FELIX_CHANGE_BEGIN
337  const OdGeScale2d& scale,
338  const OdGePoint2d& center = OdGePoint2d::kOrigin);
339 // FELIX_CHANGE_END
349  const OdGePoint2d& mirrorPoint);
350 
359  const OdGeLine2d& mirrorLine);
360 
376  const OdGePoint2d& fromOrigin,
377  const OdGeVector2d& fromXAxis,
378  const OdGeVector2d& fromYAxis,
379  const OdGePoint2d& toOrigin,
380  const OdGeVector2d& toXAxis,
381  const OdGeVector2d& toYAxis);
382 
383 // static OdGeMatrix2d translation (
384 // const OdGeVector2d& vect);
385 
394  double angle,
395  const OdGePoint2d& center = OdGePoint2d::kOrigin);
396 
405  double scale,
406  const OdGePoint2d& center = OdGePoint2d::kOrigin);
407  // FELIX_CHANGE_BEGIN
409  const OdGeScale2d& scale,
410  const OdGePoint2d& center = OdGePoint2d::kOrigin);
411  // FELIX_CHANGE_END
412 
420  const OdGePoint2d& mirrorPoint);
421 
429  const OdGeLine2d& mirrorLine);
430 
445  const OdGePoint2d& fromOrigin,
446  const OdGeVector2d& fromXAxis,
447  const OdGeVector2d& fromYAxis,
448  const OdGePoint2d& toOrigin,
449  const OdGeVector2d& toXAxis,
450  const OdGeVector2d& toYAxis);
451 
452  // For convenient access to the data.
453  //
454 
460  const double* operator [](
461  int row) const;
462  double* operator [](
463  int row);
464 
471  double operator ()(
472  int row,
473  int column) const;
474  double& operator ()(
475  int row,
476  int column);
477 
478  // [row][column]
479  double entry[3][3];
480 };
481 
482 // these operations really decrease rendering performance in non-inline case :
483 
484 inline const double* OdGeMatrix2d::operator [](int row) const
485 {
486  return entry[row];
487 }
488 
489 inline double* OdGeMatrix2d::operator [](int row)
490 {
491  return entry[row];
492 }
493 
494 inline double OdGeMatrix2d::operator ()(int row, int column) const
495 {
496  return entry[row][column];
497 }
498 
499 inline double& OdGeMatrix2d::operator ()(int row, int column)
500 {
501  return entry[row][column];
502 }
503 
504 #include "TD_PackPop.h"
505 
506 #endif // OD_GE_MATRIX_2D_H
OdGeMatrix2d::isSingular
bool isSingular(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix2d::scale
double scale() const
OdGeMatrix2d::postMultBy
OdGeMatrix2d & postMultBy(const OdGeMatrix2d &rightSide)
OdGeMatrix2d::transpose
OdGeMatrix2d transpose() const
scale
scale
Definition: DimVarDefs.h:1684
OdGeMatrix2d::setToTranslation
OdGeMatrix2d & setToTranslation(const OdGeVector2d &vect)
tol
tol
Definition: DimVarDefs.h:2287
OdGeMatrix2d::setToRotation
OdGeMatrix2d & setToRotation(double angle, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeMatrix2d::alignCoordSys
static OdGeMatrix2d alignCoordSys(const OdGePoint2d &fromOrigin, const OdGeVector2d &fromXAxis, const OdGeVector2d &fromYAxis, const OdGePoint2d &toOrigin, const OdGeVector2d &toXAxis, const OdGeVector2d &toYAxis)
OdGeMatrix2d::OdGeMatrix2d
OdGeMatrix2d()
OdGeMatrix2d::isEqualTo
bool isEqualTo(const OdGeMatrix2d &matrix, const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix2d::setToProduct
OdGeMatrix2d & setToProduct(const OdGeMatrix2d &matrix1, const OdGeMatrix2d &matrix2)
OdGeMatrix2d::setCoordSystem
OdGeMatrix2d & setCoordSystem(const OdGePoint2d &origin, const OdGeVector2d &xAxis, const OdGeVector2d &yAxis)
TD_PackPop.h
OdGeMatrix2d::mirroring
static OdGeMatrix2d mirroring(const OdGePoint2d &mirrorPoint)
OdGeMatrix2d::kIdentity
static GE_STATIC_EXPORT const OdGeMatrix2d kIdentity
Definition: GeMatrix2d.h:82
OdGeMatrix2d::mirroring
static OdGeMatrix2d mirroring(const OdGeLine2d &mirrorLine)
OdGeMatrix2d::translation
OdGeVector2d translation() const
OdGeMatrix2d::setToScaling
OdGeMatrix2d & setToScaling(const OdGeScale2d &scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeMatrix2d::setToAlignCoordSys
OdGeMatrix2d & setToAlignCoordSys(const OdGePoint2d &fromOrigin, const OdGeVector2d &fromXAxis, const OdGeVector2d &fromYAxis, const OdGePoint2d &toOrigin, const OdGeVector2d &toXAxis, const OdGeVector2d &toYAxis)
operator*
GE_TOOLKIT_EXPORT OdGeVector3d operator*(const OdGeMatrix3d &matrix, const OdGeVector3d &vect)
OdGeMatrix2d::invert
OdGeMatrix2d & invert()
OdGeMatrix2d::rotation
static OdGeMatrix2d rotation(double angle, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeMatrix2d::isScaledOrtho
bool isScaledOrtho(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix2d::translation
static OdGeMatrix2d translation(const OdGeVector2d &vector)
OdDAI::operator!=
bool DAI_EXPORT operator!=(const OdDAI::OdSelect &left, const OdDAI::OdSelect &right)
OdGeLine2d
Definition: GeLine2d.h:43
OdGeMatrix2d::entry
double entry[3][3]
Definition: GeMatrix2d.h:479
OdGeMatrix2d::getCoordSystem
void getCoordSystem(OdGePoint2d &origin, OdGeVector2d &xAxis, OdGeVector2d &yAxis) const
GeScale2d.h
OdGeVector2d
Definition: GeVector2d.h:51
OdGeMatrix2d::isUniScaledOrtho
bool isUniScaledOrtho(const OdGeTol &tol=OdGeContext::gTol) const
TD_PackPush.h
OdGeMatrix2d::isConformal
bool isConformal(double &scale, double &angle, bool &isMirror, OdGeVector2d &reflex) const
OdGeMatrix2d::operator[]
const double * operator[](int row) const
Definition: GeMatrix2d.h:484
OdGeMatrix2d::scaling
static OdGeMatrix2d scaling(double scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeScale2d
Definition: GeScale2d.h:47
OdGeContext::gTol
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:60
GE_TOOLKIT_EXPORT
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
OdGeMatrix2d
Definition: GeMatrix2d.h:73
OdGeMatrix2d::operator()
double operator()(int row, int column) const
Definition: GeMatrix2d.h:494
OdGeMatrix2d::setToIdentity
OdGeMatrix2d & setToIdentity()
OdDAI::operator==
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
OdGeMatrix2d::transposeIt
OdGeMatrix2d & transposeIt()
OdGeMatrix2d::setTranslation
OdGeMatrix2d & setTranslation(const OdGeVector2d &vect)
GE_STATIC_EXPORT
#define GE_STATIC_EXPORT
Definition: GeExport.h:53
OdGePoint2d::kOrigin
static GE_STATIC_EXPORT const OdGePoint2d kOrigin
Definition: GePoint2d.h:80
OdGeMatrix2d::inverse
OdGeMatrix2d inverse() const
OdGeMatrix2d::preMultBy
OdGeMatrix2d & preMultBy(const OdGeMatrix2d &leftSide)
OdGeTol
Definition: GeTol.h:49
OdGeMatrix2d::setToMirroring
OdGeMatrix2d & setToMirroring(const OdGeLine2d &mirrorLine)
OdGeMatrix2d::setToMirroring
OdGeMatrix2d & setToMirroring(const OdGePoint2d &mirrorPoint)
OdGeMatrix2d::setToScaling
OdGeMatrix2d & setToScaling(double scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
GePoint2d.h
OdGeMatrix2d::scaling
static OdGeMatrix2d scaling(const OdGeScale2d &scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeMatrix2d::det
double det() const
OdGePoint2d
Definition: GePoint2d.h:60