CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OdGeMatrix2d Class Reference

#include <GeMatrix2d.h>

Public Member Functions

 OdGeMatrix2d ()
 
OdGeMatrix2dsetToIdentity ()
 
OdGeMatrix2d operator* (const OdGeMatrix2d &matrix) const
 
OdGeMatrix2doperator*= (const OdGeMatrix2d &matrix)
 
OdGeMatrix2dpreMultBy (const OdGeMatrix2d &leftSide)
 
OdGeMatrix2dpostMultBy (const OdGeMatrix2d &rightSide)
 
OdGeMatrix2dsetToProduct (const OdGeMatrix2d &matrix1, const OdGeMatrix2d &matrix2)
 
OdGeMatrix2dinvert ()
 
OdGeMatrix2d inverse () const
 
bool isSingular (const OdGeTol &tol=OdGeContext::gTol) const
 
OdGeMatrix2dtransposeIt ()
 
OdGeMatrix2d transpose () const
 
bool operator== (const OdGeMatrix2d &matrix) const
 
bool operator!= (const OdGeMatrix2d &matrix) const
 
bool isEqualTo (const OdGeMatrix2d &matrix, const OdGeTol &tol=OdGeContext::gTol) const
 
bool isUniScaledOrtho (const OdGeTol &tol=OdGeContext::gTol) const
 
bool isScaledOrtho (const OdGeTol &tol=OdGeContext::gTol) const
 
double scale () const
 
double det () const
 
OdGeMatrix2dsetTranslation (const OdGeVector2d &vect)
 
OdGeVector2d translation () const
 
bool isConformal (double &scale, double &angle, bool &isMirror, OdGeVector2d &reflex) const
 
OdGeMatrix2dsetCoordSystem (const OdGePoint2d &origin, const OdGeVector2d &xAxis, const OdGeVector2d &yAxis)
 
void getCoordSystem (OdGePoint2d &origin, OdGeVector2d &xAxis, OdGeVector2d &yAxis) const
 
OdGeMatrix2dsetToTranslation (const OdGeVector2d &vect)
 
OdGeMatrix2dsetToRotation (double angle, const OdGePoint2d &center=OdGePoint2d::kOrigin)
 
OdGeMatrix2dsetToScaling (double scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
 
OdGeMatrix2dsetToScaling (const OdGeScale2d &scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
 
OdGeMatrix2dsetToMirroring (const OdGePoint2d &mirrorPoint)
 
OdGeMatrix2dsetToMirroring (const OdGeLine2d &mirrorLine)
 
OdGeMatrix2dsetToAlignCoordSys (const OdGePoint2d &fromOrigin, const OdGeVector2d &fromXAxis, const OdGeVector2d &fromYAxis, const OdGePoint2d &toOrigin, const OdGeVector2d &toXAxis, const OdGeVector2d &toYAxis)
 
const double * operator[] (int row) const
 
double * operator[] (int row)
 
double operator() (int row, int column) const
 
double & operator() (int row, int column)
 

Static Public Member Functions

static OdGeMatrix2d translation (const OdGeVector2d &vector)
 
static OdGeMatrix2d rotation (double angle, const OdGePoint2d &center=OdGePoint2d::kOrigin)
 
static OdGeMatrix2d scaling (double scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
 
static OdGeMatrix2d scaling (const OdGeScale2d &scale, const OdGePoint2d &center=OdGePoint2d::kOrigin)
 
static OdGeMatrix2d mirroring (const OdGePoint2d &mirrorPoint)
 
static OdGeMatrix2d mirroring (const OdGeLine2d &mirrorLine)
 
static OdGeMatrix2d alignCoordSys (const OdGePoint2d &fromOrigin, const OdGeVector2d &fromXAxis, const OdGeVector2d &fromYAxis, const OdGePoint2d &toOrigin, const OdGeVector2d &toXAxis, const OdGeVector2d &toYAxis)
 

Public Attributes

double entry [3][3]
 

Static Public Attributes

static GE_STATIC_EXPORT const OdGeMatrix2d kIdentity
 

Detailed Description

This class represents 2D transformation matrices that define affine ( translation, rotation, and/or scaling ) transformations.

Remarks
OdGeMatrix2d may be viewed as an array[3][3] of doubles.

An OdGeMatrix2d, M, can be expressed as a 3 x 3 matrix*, in the form

      <pre>
      a00   a01   t0
      a10   a11   t1
        0     0    1
      </pre>

The linear part of M is the matrix

      <pre>
      a00   a01
      a10   a11
      </pre>

The translational part of M is the column

      <pre>
      t0
      t1
      </pre>

The origin of the coordinate system of M is (t0, t1).

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

Definition at line 78 of file GeMatrix2d.h.

Constructor & Destructor Documentation

◆ OdGeMatrix2d()

OdGeMatrix2d::OdGeMatrix2d ( )

Default constructor for the OdGeMatrix2d class.

Remarks
Constructs a matrix for 2D transformation operations and sets it to the identity.

Member Function Documentation

◆ alignCoordSys()

static OdGeMatrix2d OdGeMatrix2d::alignCoordSys ( const OdGePoint2d fromOrigin,
const OdGeVector2d fromXAxis,
const OdGeVector2d fromYAxis,
const OdGePoint2d toOrigin,
const OdGeVector2d toXAxis,
const OdGeVector2d toYAxis 
)
static

Returns the matrix which maps the coordinate system defined by fromOrigin, fromXAxis, and fromYAxis, to the coordinate system defined by toOrigin, toXAxis, and toYAxis.

Parameters
fromOrigin[in] Origin of the initial coordinate system.
fromXAxis[in] X-axis of the initial coordinate system.
fromYAxis[in] Y-axis of the initial coordinate system.
toOrigin[in] Origin of the initial coordinate system.
toXAxis[in] X-axis of the initial coordinate system.
toYAxis[in] Y-axis of the initial coordinate system.

◆ det()

double OdGeMatrix2d::det ( ) const

Returns the determinant of this matrix.

◆ getCoordSystem()

void OdGeMatrix2d::getCoordSystem ( OdGePoint2d origin,
OdGeVector2d xAxis,
OdGeVector2d yAxis 
) const

Returns the origin, X-axis, and Y-axis of the coordinate system to which this matrix maps the WCS.

Parameters
origin[out] Receives the origin of the coordinate system.
xAxis[out] Receives the X-axis of the coordinate system.
yAxis[out] Receives the Y-axis of the coordinate system.

◆ inverse()

OdGeMatrix2d OdGeMatrix2d::inverse ( ) const

Returns the inverse of this matrix.

◆ invert()

OdGeMatrix2d & OdGeMatrix2d::invert ( )

Sets this matrix to its inverse, and returns a reference to this matrix.

◆ isConformal()

bool OdGeMatrix2d::isConformal ( double &  scale,
double &  angle,
bool &  isMirror,
OdGeVector2d reflex 
) const

Returns true if an only if this matrix is conformal (isUniScaledOrtho()), and returns the scale factor, angle of rotation, the presence of a mirror component to the matrix, and the direction of reflection.

Parameters
scale[out] Receives the scale factor.
angle[out] Receives the angle of rotation.
isMirror[out] Receives true if and only if the matrix has a mirror component.
reflex[in] Direction of reflection.
Remarks
reflex is valid if and only if isMirror is true.
Returns
true if this matrix is conformal, false otherwise.

◆ isEqualTo()

bool OdGeMatrix2d::isEqualTo ( const OdGeMatrix2d matrix,
const OdGeTol tol = OdGeContext::gTol 
) const

Returns true if and only if matrix is identical to this one, within the specified tolerance.

Parameters
matrix[in] Matrix to be compared.
tol[in] Geometric tolerance.

◆ isScaledOrtho()

bool OdGeMatrix2d::isScaledOrtho ( const OdGeTol tol = OdGeContext::gTol) const

Returns true if and only the column vectors of the linear part of this matrix are perpendicular to each other within the specified tolerance.

Parameters
tol[in] Geometric tolerance.

◆ isSingular()

bool OdGeMatrix2d::isSingular ( const OdGeTol tol = OdGeContext::gTol) const

Checks whether this matrix is singular.

Parameters
tol[in] Geometric tolerance.
Returns
true if this matrix is singular, false otherwise.
Remarks
A matrix is singular if and only if its determinant is zero within the specified tolerance. A singular matrix cannot be inverted.

◆ isUniScaledOrtho()

bool OdGeMatrix2d::isUniScaledOrtho ( const OdGeTol tol = OdGeContext::gTol) const

Returns true if and only the columns vectors of the linear part of this matrix are of equal length and perpendicular to each other within the specified tolerance.

Parameters
tol[in] Geometric tolerance.

◆ mirroring() [1/2]

static OdGeMatrix2d OdGeMatrix2d::mirroring ( const OdGeLine2d mirrorLine)
static

Returns the matrix which mirrors about the specified object.

Parameters
mirrorLine[in] Mirror line entity.

◆ mirroring() [2/2]

static OdGeMatrix2d OdGeMatrix2d::mirroring ( const OdGePoint2d mirrorPoint)
static

Returns the matrix which mirrors about the specified object.

Parameters
mirrorPoint[in] Mirror point.

◆ operator!=()

bool OdGeMatrix2d::operator!= ( const OdGeMatrix2d matrix) const

Inequality operator.

Parameters
matrix[in] Other matrix to compare.
Returns
A boolean value that indicates whether the input matrix is not identical to this matrix.

◆ operator()() [1/2]

double & OdGeMatrix2d::operator() ( int  row,
int  column 
)
inline

References matrix.entry[row][column] as matrix(row,column).

Parameters
row[in] Row.
column[in] Column.
Returns
Reference to the matrix element.

Definition at line 568 of file GeMatrix2d.h.

◆ operator()() [2/2]

double OdGeMatrix2d::operator() ( int  row,
int  column 
) const
inline

Returns matrix.entry[row][column] as matrix(row,column).

Parameters
row[in] Row.
column[in] Column.
Returns
Matrix element.

Definition at line 563 of file GeMatrix2d.h.

◆ operator*()

OdGeMatrix2d OdGeMatrix2d::operator* ( const OdGeMatrix2d matrix) const

Returns the product (this matrix) * matrix.

Parameters
matrix[in] Matrix to the right of the operand.
Returns
The resulting matrix.

◆ operator*=()

OdGeMatrix2d & OdGeMatrix2d::operator*= ( const OdGeMatrix2d matrix)
Remarks
Sets this matrix to the product (this matrix) * matrix, and returns a reference to this matrix.
Parameters
matrix[in] Matrix to the right of the operand.
Returns
A reference to this OdGeMatrix2d object.

◆ operator==()

bool OdGeMatrix2d::operator== ( const OdGeMatrix2d matrix) const

Equality operator.

Parameters
matrix[in] Other matrix to compare.
Returns
A boolean value that indicates whether the input matrix is identical to this matrix.

◆ operator[]() [1/2]

double * OdGeMatrix2d::operator[] ( int  row)
inline

References matrix.entry[row] as matrix[row].

Parameters
row[in] Row.
Returns
Pointer to the matrix row.

Definition at line 558 of file GeMatrix2d.h.

◆ operator[]() [2/2]

const double * OdGeMatrix2d::operator[] ( int  row) const
inline

Returns matrix.entry[row] as matrix[row].

Parameters
row[in] Row.
Returns
Pointer to the constant matrix row.

Definition at line 553 of file GeMatrix2d.h.

◆ postMultBy()

OdGeMatrix2d & OdGeMatrix2d::postMultBy ( const OdGeMatrix2d rightSide)

Sets this matrix to the product (this matrix) * rightSide, and returns a reference to this matrix.

Parameters
rightSide[in] 2D matrix that will be multiplied with this matrix.
Remarks
Note that when multiplying matrices, the order matters. This method provides different results than preMultBy even with the same parameters.

◆ preMultBy()

OdGeMatrix2d & OdGeMatrix2d::preMultBy ( const OdGeMatrix2d leftSide)

Sets this matrix to the product leftSide * (this matrix), and returns a reference to this matrix.

Parameters
leftSide[in] 2D matrix that will be multiplied with this matrix.
Remarks
Note that when multiplying matrices, the order matters. This method provides different results than postMultBy even with the same parameters.

◆ rotation()

static OdGeMatrix2d OdGeMatrix2d::rotation ( double  angle,
const OdGePoint2d center = OdGePoint2d::kOrigin 
)
static

Returns the matrix which rotates by angle about center.

Parameters
angle[in] Rotation angle.
center[in] Center of rotation.

◆ scale()

double OdGeMatrix2d::scale ( ) const

Returns the scale factor of this matrix.

Remarks
The scale factor is the square root of the longest column vector of the linear part of this matrix.

◆ scaling() [1/2]

static OdGeMatrix2d OdGeMatrix2d::scaling ( const OdGeScale2d scale,
const OdGePoint2d center = OdGePoint2d::kOrigin 
)
static

◆ scaling() [2/2]

static OdGeMatrix2d OdGeMatrix2d::scaling ( double  scale,
const OdGePoint2d center = OdGePoint2d::kOrigin 
)
static

Returns the matrix which scales by scale about center.

Parameters
scale[in] Scale factor.
center[in] Center of scaling.

◆ setCoordSystem()

OdGeMatrix2d & OdGeMatrix2d::setCoordSystem ( const OdGePoint2d origin,
const OdGeVector2d xAxis,
const OdGeVector2d yAxis 
)

Sets this matrix to the matrix which maps the WCS to the coordinate system defined by origin, X-axis, and Y-axis, and returns a reference to this matrix.

Parameters
origin[in] Origin of the coordinate system.
xAxis[in] X-axis of the coordinate system.
yAxis[in] Y-axis of the coordinate system.

◆ setToAlignCoordSys()

OdGeMatrix2d & OdGeMatrix2d::setToAlignCoordSys ( const OdGePoint2d fromOrigin,
const OdGeVector2d fromXAxis,
const OdGeVector2d fromYAxis,
const OdGePoint2d toOrigin,
const OdGeVector2d toXAxis,
const OdGeVector2d toYAxis 
)

Sets this matrix to the matrix which maps the coordinate system defined by fromOrigin, fromXAxis, and fromYAxis, to the coordinate system defined by toOrigin, toXAxis, and toYAxis, and returns a reference to this matrix.

Parameters
fromOrigin[in] Origin of the initial coordinate system.
fromXAxis[in] X-axis of the initial coordinate system.
fromYAxis[in] Y-axis of the initial coordinate system.
toOrigin[in] Origin of the initial coordinate system.
toXAxis[in] X-axis of the initial coordinate system.
toYAxis[in] Y-axis of the initial coordinate system.

◆ setToIdentity()

OdGeMatrix2d & OdGeMatrix2d::setToIdentity ( )

Sets this matrix to the identity matrix, and returns a reference to this matrix.

◆ setToMirroring() [1/2]

OdGeMatrix2d & OdGeMatrix2d::setToMirroring ( const OdGeLine2d mirrorLine)

Sets this matrix to the matrix which mirrors about the specified object, and returns a reference to this matrix.

Parameters
mirrorLine[in] Mirror line entity.

◆ setToMirroring() [2/2]

OdGeMatrix2d & OdGeMatrix2d::setToMirroring ( const OdGePoint2d mirrorPoint)

Sets this matrix to the matrix which mirrors about the specified object, and returns a reference to this matrix.

Parameters
mirrorPoint[in] Mirror point.

◆ setToProduct()

OdGeMatrix2d & OdGeMatrix2d::setToProduct ( const OdGeMatrix2d matrix1,
const OdGeMatrix2d matrix2 
)

Sets this matrix to the product matrix1 * matrix2, and returns a reference to this matrix.

Parameters
matrix1[in] First 2D matrix that is multiplied.
matrix2[in] Second 2D matrix that is multiplied.

◆ setToRotation()

OdGeMatrix2d & OdGeMatrix2d::setToRotation ( double  angle,
const OdGePoint2d center = OdGePoint2d::kOrigin 
)

Sets this matrix to the matrix which rotates by angle about center, and returns a reference to this matrix.

Parameters
angle[in] Rotation angle.
center[in] Center of rotation.

◆ setToScaling() [1/2]

OdGeMatrix2d & OdGeMatrix2d::setToScaling ( const OdGeScale2d scale,
const OdGePoint2d center = OdGePoint2d::kOrigin 
)

◆ setToScaling() [2/2]

OdGeMatrix2d & OdGeMatrix2d::setToScaling ( double  scale,
const OdGePoint2d center = OdGePoint2d::kOrigin 
)

Sets this matrix to the matrix which scales by scale about center, and returns a reference to this matrix.

Parameters
scale[in] Scale factor.
center[in] Center of scaling.

◆ setToTranslation()

OdGeMatrix2d & OdGeMatrix2d::setToTranslation ( const OdGeVector2d vect)

Sets this matrix to the matrix which translates by vect, and returns a reference to this matrix.

Parameters
vect[in] Translation vector.

◆ setTranslation()

OdGeMatrix2d & OdGeMatrix2d::setTranslation ( const OdGeVector2d vect)

Sets the translation part of the matrix to the specified vector.

Parameters
vect[in] Translation vector.

◆ translation() [1/2]

OdGeVector2d OdGeMatrix2d::translation ( ) const

Returns the translation vector of this matrix.

◆ translation() [2/2]

static OdGeMatrix2d OdGeMatrix2d::translation ( const OdGeVector2d vector)
static

Returns the matrix of the translation by vector.

Parameters
vector[in] Translation vector.

◆ transpose()

OdGeMatrix2d OdGeMatrix2d::transpose ( ) const

Returns the transpose of this matrix.

◆ transposeIt()

OdGeMatrix2d & OdGeMatrix2d::transposeIt ( )

Sets this matrix to its transpose, and returns a reference to this matrix.

Member Data Documentation

◆ entry

double OdGeMatrix2d::entry[3][3]

Matrix data by rows.

Definition at line 548 of file GeMatrix2d.h.

◆ kIdentity

GE_STATIC_EXPORT const OdGeMatrix2d OdGeMatrix2d::kIdentity
static

The identity matrix.

Definition at line 95 of file GeMatrix2d.h.


The documentation for this class was generated from the following file: