CFx SDK Documentation  2020SP3
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 3 matrix*, in the form

      a00   a01   t0
      a10   a11   t1
        0     0    1

The linear part of M is the matrix

      a00   a01
      a10   a11

The translational part of M is the column

      t0
      t1

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

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

Definition at line 72 of file GeMatrix2d.h.

Constructor & Destructor Documentation

◆ OdGeMatrix2d()

OdGeMatrix2d::OdGeMatrix2d ( )

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 andn only if the matrix has a mirror component.
reflex[in] Direction of reflection.
Remarks
reflex is valid if and only if isMirror is true.

◆ 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] Geomentric 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] Geomentric tolerance.

◆ isSingular()

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

Returns true if and only if this matrix is singular.

Remarks
A matrix is singular if and only if its determinant == 0. 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] Geomentric 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.

◆ operator()() [1/2]

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

Definition at line 499 of file GeMatrix2d.h.

◆ operator()() [2/2]

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

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

Parameters
row[in] Row.
column[in] Column.

Definition at line 494 of file GeMatrix2d.h.

◆ operator*()

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

Returns the product (this matrix) * 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.

◆ operator==()

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

Equality operator.

◆ operator[]() [1/2]

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

Definition at line 489 of file GeMatrix2d.h.

◆ operator[]() [2/2]

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

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

Parameters
row[in] Row.

Definition at line 484 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] Any 2D matrix

◆ 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] Any 2D matrix

◆ 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)

Description: 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] Any 2D matrix
matrix2[in] Any 2D matrix

◆ 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 tcenter, 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]

Definition at line 479 of file GeMatrix2d.h.

◆ kIdentity

GE_STATIC_EXPORT const OdGeMatrix2d OdGeMatrix2d::kIdentity
static

The identity matrix.

Definition at line 82 of file GeMatrix2d.h.


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