LibreOffice Module basegfx (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
basegfx::B2DHomMatrix Class Reference

#include <b2dhommatrix.hxx>

Collaboration diagram for basegfx::B2DHomMatrix:
[legend]

Public Types

typedef o3tl::cow_wrapper< Impl2DHomMatrixImplType
 

Public Member Functions

 B2DHomMatrix ()
 
 B2DHomMatrix (const B2DHomMatrix &rMat)
 
 B2DHomMatrix (B2DHomMatrix &&rMat)
 
 ~B2DHomMatrix ()
 
double a () const
 
double b () const
 
double c () const
 
double d () const
 
double e () const
 
double f () const
 
 B2DHomMatrix (double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2)
 constructor to allow setting all needed values for a 3x2 matrix at once. More...
 
double get (sal_uInt16 nRow, sal_uInt16 nColumn) const
 
void set (sal_uInt16 nRow, sal_uInt16 nColumn, double fValue)
 
void set3x2 (double f_0x0, double f_0x1, double f_0x2, double f_1x0, double f_1x1, double f_1x2)
 allow setting all needed values for a 3x2 matrix in one call. More...
 
bool isLastLineDefault () const
 
bool isIdentity () const
 
void identity ()
 
bool isInvertible () const
 
bool invert ()
 
void rotate (double fRadiant)
 
void translate (double fX, double fY)
 
void translate (const B2DTuple &rTuple)
 
void scale (double fX, double fY)
 
void scale (const B2DTuple &rTuple)
 
void shearX (double fSx)
 
void shearY (double fSy)
 
B2DHomMatrixoperator+= (const B2DHomMatrix &rMat)
 
B2DHomMatrixoperator-= (const B2DHomMatrix &rMat)
 
bool operator== (const B2DHomMatrix &rMat) const
 
bool operator!= (const B2DHomMatrix &rMat) const
 
B2DHomMatrixoperator*= (double fValue)
 
B2DHomMatrixoperator/= (double fValue)
 
B2DHomMatrixoperator*= (const B2DHomMatrix &rMat)
 
B2DHomMatrixoperator= (const B2DHomMatrix &rMat)
 
B2DHomMatrixoperator= (B2DHomMatrix &&rMat)
 
bool decompose (B2DTuple &rScale, B2DTuple &rTranslate, double &rRotate, double &rShearX) const
 Help routine to decompose given homogen 3x3 matrix to components. More...
 

Static Public Member Functions

static B2DHomMatrix abcdef (double da, double db, double dc, double dd, double de, double df)
 Convenience creator for declaration of the matrix that is commonly used by web standards (SVG, CSS, HTML). More...
 

Private Attributes

ImplType mpImpl
 

Detailed Description

Definition at line 35 of file b2dhommatrix.hxx.

Member Typedef Documentation

◆ ImplType

Definition at line 38 of file b2dhommatrix.hxx.

Constructor & Destructor Documentation

◆ B2DHomMatrix() [1/4]

basegfx::B2DHomMatrix::B2DHomMatrix ( )

Definition at line 36 of file b2dhommatrix.cxx.

◆ B2DHomMatrix() [2/4]

basegfx::B2DHomMatrix::B2DHomMatrix ( const B2DHomMatrix rMat)
default

◆ B2DHomMatrix() [3/4]

basegfx::B2DHomMatrix::B2DHomMatrix ( B2DHomMatrix &&  rMat)
default

◆ ~B2DHomMatrix()

basegfx::B2DHomMatrix::~B2DHomMatrix ( )
default

◆ B2DHomMatrix() [4/4]

basegfx::B2DHomMatrix::B2DHomMatrix ( double  f_0x0,
double  f_0x1,
double  f_0x2,
double  f_1x0,
double  f_1x1,
double  f_1x2 
)

constructor to allow setting all needed values for a 3x2 matrix at once.

The parameter f_0x1 e.g. is the same as using set(0, 1, f)

Definition at line 44 of file b2dhommatrix.cxx.

References mpImpl.

Member Function Documentation

◆ a()

double basegfx::B2DHomMatrix::a ( ) const
inline

Definition at line 64 of file b2dhommatrix.hxx.

References get().

◆ abcdef()

static B2DHomMatrix basegfx::B2DHomMatrix::abcdef ( double  da,
double  db,
double  dc,
double  dd,
double  de,
double  df 
)
inlinestatic

Convenience creator for declaration of the matrix that is commonly used by web standards (SVG, CSS, HTML).

Values a,b,c,d,e,f represent the following values in the matrix: [a,c,e] [a,c,e] [b,d,f] or [b,d,f] [0,0,1]

Definition at line 58 of file b2dhommatrix.hxx.

◆ b()

double basegfx::B2DHomMatrix::b ( ) const
inline

Definition at line 66 of file b2dhommatrix.hxx.

References get().

◆ c()

double basegfx::B2DHomMatrix::c ( ) const
inline

Definition at line 68 of file b2dhommatrix.hxx.

References get().

◆ d()

double basegfx::B2DHomMatrix::d ( ) const
inline

Definition at line 70 of file b2dhommatrix.hxx.

References get().

◆ decompose()

bool basegfx::B2DHomMatrix::decompose ( B2DTuple rScale,
B2DTuple rTranslate,
double &  rRotate,
double &  rShearX 
) const

Help routine to decompose given homogen 3x3 matrix to components.

Decomposition.

A correction of the components is done to avoid inaccuracies.

See basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix() for the opposite, to compose a homogen 3x3 matrix from components.

New, optimized version with local shearX detection. Old version (keeping below, is working well, too) used the 3D matrix decomposition when shear was used. Keeping old version as comment below since it may get necessary to add the determinant() test from there here, too.

Definition at line 273 of file b2dhommatrix.cxx.

References basegfx::B2DVector::cross(), basegfx::fTools::equalZero(), get(), basegfx::B2DVector::getLength(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), mpImpl, basegfx::B2DVector::scalar(), basegfx::Tuple2D< TYPE >::setX(), and basegfx::Tuple2D< TYPE >::setY().

Referenced by basegfx::utils::B2DHomMatrixBufferedOnDemandDecompose::impCheckDecompose().

◆ e()

double basegfx::B2DHomMatrix::e ( ) const
inline

Definition at line 72 of file b2dhommatrix.hxx.

References get().

◆ f()

double basegfx::B2DHomMatrix::f ( ) const
inline

Definition at line 74 of file b2dhommatrix.hxx.

References get().

◆ get()

double basegfx::B2DHomMatrix::get ( sal_uInt16  nRow,
sal_uInt16  nColumn 
) const

◆ identity()

void basegfx::B2DHomMatrix::identity ( )

◆ invert()

bool basegfx::B2DHomMatrix::invert ( )

◆ isIdentity()

bool basegfx::B2DHomMatrix::isIdentity ( ) const

◆ isInvertible()

bool basegfx::B2DHomMatrix::isInvertible ( ) const

Definition at line 93 of file b2dhommatrix.cxx.

References mpImpl.

◆ isLastLineDefault()

bool basegfx::B2DHomMatrix::isLastLineDefault ( ) const

Definition at line 78 of file b2dhommatrix.cxx.

References mpImpl.

◆ operator!=()

bool basegfx::B2DHomMatrix::operator!= ( const B2DHomMatrix rMat) const

Definition at line 178 of file b2dhommatrix.cxx.

◆ operator*=() [1/2]

B2DHomMatrix & basegfx::B2DHomMatrix::operator*= ( const B2DHomMatrix rMat)

Definition at line 150 of file b2dhommatrix.cxx.

References isIdentity(), and mpImpl.

◆ operator*=() [2/2]

B2DHomMatrix & basegfx::B2DHomMatrix::operator*= ( double  fValue)

Definition at line 130 of file b2dhommatrix.cxx.

References basegfx::fTools::equal(), and mpImpl.

◆ operator+=()

B2DHomMatrix & basegfx::B2DHomMatrix::operator+= ( const B2DHomMatrix rMat)

Definition at line 118 of file b2dhommatrix.cxx.

References mpImpl.

◆ operator-=()

B2DHomMatrix & basegfx::B2DHomMatrix::operator-= ( const B2DHomMatrix rMat)

Definition at line 124 of file b2dhommatrix.cxx.

References mpImpl.

◆ operator/=()

B2DHomMatrix & basegfx::B2DHomMatrix::operator/= ( double  fValue)

Definition at line 140 of file b2dhommatrix.cxx.

References basegfx::fTools::equal(), and mpImpl.

◆ operator=() [1/2]

B2DHomMatrix & basegfx::B2DHomMatrix::operator= ( B2DHomMatrix &&  rMat)
default

References decompose().

◆ operator=() [2/2]

B2DHomMatrix & basegfx::B2DHomMatrix::operator= ( const B2DHomMatrix rMat)
default

◆ operator==()

bool basegfx::B2DHomMatrix::operator== ( const B2DHomMatrix rMat) const

◆ rotate()

void basegfx::B2DHomMatrix::rotate ( double  fRadiant)

◆ scale() [1/2]

void basegfx::B2DHomMatrix::scale ( const B2DTuple rTuple)

◆ scale() [2/2]

void basegfx::B2DHomMatrix::scale ( double  fX,
double  fY 
)

◆ set()

void basegfx::B2DHomMatrix::set ( sal_uInt16  nRow,
sal_uInt16  nColumn,
double  fValue 
)

◆ set3x2()

void basegfx::B2DHomMatrix::set3x2 ( double  f_0x0,
double  f_0x1,
double  f_0x2,
double  f_1x0,
double  f_1x1,
double  f_1x2 
)

allow setting all needed values for a 3x2 matrix in one call.

The parameter f_0x1 e.g. is the same as using set(0, 1, f)

Definition at line 68 of file b2dhommatrix.cxx.

References mpImpl.

Referenced by basegfx::utils::createRotateAroundPoint().

◆ shearX()

void basegfx::B2DHomMatrix::shearX ( double  fSx)

◆ shearY()

void basegfx::B2DHomMatrix::shearY ( double  fSy)

◆ translate() [1/2]

void basegfx::B2DHomMatrix::translate ( const B2DTuple rTuple)

◆ translate() [2/2]

void basegfx::B2DHomMatrix::translate ( double  fX,
double  fY 
)

Member Data Documentation

◆ mpImpl

ImplType basegfx::B2DHomMatrix::mpImpl
private

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