CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GeMatrix2d.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
36class OdGeVector2d;
37class OdGeLine2d;
38class OdGeTol;
39
40#include "TD_PackPush.h"
41
79{
80public:
81
89 //OdGeMatrix2d(const OdGeMatrix2d& src);
90 //OdGeMatrix2d& operator =(const OdGeMatrix2d& src);
91
96
101
111 const OdGeMatrix2d& matrix) const;
112
122 OdGeMatrix2d& operator*= (
123 const OdGeMatrix2d& matrix);
124
135 const OdGeMatrix2d& leftSide);
136
147 const OdGeMatrix2d& rightSide);
148
157 const OdGeMatrix2d& matrix1,
158 const OdGeMatrix2d& matrix2);
159
160 // Multiplicative inverse.
161 //
162
168
173
186
192
197
207 const OdGeMatrix2d& matrix) const;
208
218 const OdGeMatrix2d& matrix) const;
219
228 const OdGeMatrix2d& matrix,
229 const OdGeTol& tol = OdGeContext::gTol) const;
230
240 const OdGeTol& tol = OdGeContext::gTol) const;
241
250 const OdGeTol& tol = OdGeContext::gTol) const;
251
259 double scale() const;
260
261 // Determinant
262 //
263
267 double det() const;
268
275 const OdGeVector2d& vect);
276
281
288 const OdGeVector2d& vector);
289
290 // Retrieve scaling, rotation, mirror components
291 //
292
311 double& scale,
312 double& angle,
313 bool& isMirror,
314 OdGeVector2d& reflex) const;
315
316
317 // Set/get coordinate system
318 //
319
331 const OdGePoint2d& origin,
332 const OdGeVector2d& xAxis,
333 const OdGeVector2d& yAxis);
343 OdGePoint2d& origin,
344 OdGeVector2d& xAxis,
345 OdGeVector2d& yAxis) const;
346
355 const OdGeVector2d& vect);
356
357
367 double angle,
368 const OdGePoint2d& center = OdGePoint2d::kOrigin);
369
379 double scale,
380 const OdGePoint2d& center = OdGePoint2d::kOrigin);
381
382// FELIX_CHANGE_BEGIN
384 const OdGeScale2d& scale,
385 const OdGePoint2d& center = OdGePoint2d::kOrigin);
386// FELIX_CHANGE_END
387
396 const OdGePoint2d& mirrorPoint);
397
406 const OdGeLine2d& mirrorLine);
407
423 const OdGePoint2d& fromOrigin,
424 const OdGeVector2d& fromXAxis,
425 const OdGeVector2d& fromYAxis,
426 const OdGePoint2d& toOrigin,
427 const OdGeVector2d& toXAxis,
428 const OdGeVector2d& toYAxis);
429
430// static OdGeMatrix2d translation (
431// const OdGeVector2d& vect);
432
441 double angle,
442 const OdGePoint2d& center = OdGePoint2d::kOrigin);
443
452 double scale,
453 const OdGePoint2d& center = OdGePoint2d::kOrigin);
454
455// FELIX_CHANGE_BEGIN
457 const OdGeScale2d& scale,
458 const OdGePoint2d& center = OdGePoint2d::kOrigin);
459 // FELIX_CHANGE_END
460
468 const OdGePoint2d& mirrorPoint);
469
477 const OdGeLine2d& mirrorLine);
478
493 const OdGePoint2d& fromOrigin,
494 const OdGeVector2d& fromXAxis,
495 const OdGeVector2d& fromYAxis,
496 const OdGePoint2d& toOrigin,
497 const OdGeVector2d& toXAxis,
498 const OdGeVector2d& toYAxis);
499
500 // For convenient access to the data.
501 //
502
510 const double* operator [](
511 int row) const;
519 double* operator [](
520 int row);
521
530 double operator ()(
531 int row,
532 int column) const;
541 double& operator ()(
542 int row,
543 int column);
544
548 double entry[3][3];
549};
550
551// these operations really decrease rendering performance in non-inline case :
552
553inline const double* OdGeMatrix2d::operator [](int row) const
554{
555 return entry[row];
556}
557
558inline double* OdGeMatrix2d::operator [](int row)
559{
560 return entry[row];
561}
562
563inline double OdGeMatrix2d::operator ()(int row, int column) const
564{
565 return entry[row][column];
566}
567
568inline double& OdGeMatrix2d::operator ()(int row, int column)
569{
570 return entry[row][column];
571}
572
573#include "TD_PackPop.h"
574
575#endif // OD_GE_MATRIX_2D_H
AECBASE_API OdGePoint3d operator*(const AECECS &matrix, const OdGePoint3d &point)
tol
Definition: DimVarDefs.h:2287
scale
Definition: DimVarDefs.h:1684
#define GE_TOOLKIT_EXPORT
Definition: GeExport.h:49
#define GE_STATIC_EXPORT
Definition: GeExport.h:52
bool operator!=(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:403
bool operator==(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:397
static GE_STATIC_EXPORT const OdGeMatrix2d kIdentity
Definition: GeMatrix2d.h:95
static OdGeMatrix2d rotation(double angle, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeMatrix2d & setToAlignCoordSys(const OdGePoint2d &fromOrigin, const OdGeVector2d &fromXAxis, const OdGeVector2d &fromYAxis, const OdGePoint2d &toOrigin, const OdGeVector2d &toXAxis, const OdGeVector2d &toYAxis)
OdGeMatrix2d & setToMirroring(const OdGePoint2d &mirrorPoint)
static OdGeMatrix2d scaling(double scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
double det() const
bool isConformal(double &scale, double &angle, bool &isMirror, OdGeVector2d &reflex) const
OdGeMatrix2d & setToProduct(const OdGeMatrix2d &matrix1, const OdGeMatrix2d &matrix2)
OdGeMatrix2d & setToIdentity()
const double * operator[](int row) const
Definition: GeMatrix2d.h:553
double entry[3][3]
Definition: GeMatrix2d.h:548
bool isSingular(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix2d & setToRotation(double angle, const OdGePoint2d &center=OdGePoint2d::kOrigin)
OdGeMatrix2d & postMultBy(const OdGeMatrix2d &rightSide)
double scale() const
bool isEqualTo(const OdGeMatrix2d &matrix, const OdGeTol &tol=OdGeContext::gTol) const
static OdGeMatrix2d mirroring(const OdGePoint2d &mirrorPoint)
OdGeMatrix2d & setToScaling(double scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
static OdGeMatrix2d scaling(const OdGeScale2d &scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
static OdGeMatrix2d mirroring(const OdGeLine2d &mirrorLine)
OdGeMatrix2d & setToTranslation(const OdGeVector2d &vect)
OdGeMatrix2d transpose() const
OdGeMatrix2d inverse() const
OdGeMatrix2d & setCoordSystem(const OdGePoint2d &origin, const OdGeVector2d &xAxis, const OdGeVector2d &yAxis)
OdGeMatrix2d & setTranslation(const OdGeVector2d &vect)
OdGeMatrix2d & setToScaling(const OdGeScale2d &scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
bool isUniScaledOrtho(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix2d & transposeIt()
OdGeMatrix2d & invert()
bool isScaledOrtho(const OdGeTol &tol=OdGeContext::gTol) const
OdGeMatrix2d & preMultBy(const OdGeMatrix2d &leftSide)
static OdGeMatrix2d alignCoordSys(const OdGePoint2d &fromOrigin, const OdGeVector2d &fromXAxis, const OdGeVector2d &fromYAxis, const OdGePoint2d &toOrigin, const OdGeVector2d &toXAxis, const OdGeVector2d &toYAxis)
static OdGeMatrix2d translation(const OdGeVector2d &vector)
void getCoordSystem(OdGePoint2d &origin, OdGeVector2d &xAxis, OdGeVector2d &yAxis) const
OdGeVector2d translation() const
double operator()(int row, int column) const
Definition: GeMatrix2d.h:563
OdGeMatrix2d & setToMirroring(const OdGeLine2d &mirrorLine)
static GE_STATIC_EXPORT const OdGePoint2d kOrigin
Definition: GePoint2d.h:93
Definition: GeTol.h:49
static GE_STATIC_EXPORT OdGeTol gTol
Definition: GeGbl.h:65