LibreOffice Module basegfx (master) 1
|
#include <b2dhommatrix.hxx>
Public Types | |
typedef o3tl::cow_wrapper< Impl2DHomMatrix > | ImplType |
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) |
B2DHomMatrix & | operator+= (const B2DHomMatrix &rMat) |
B2DHomMatrix & | operator-= (const B2DHomMatrix &rMat) |
bool | operator== (const B2DHomMatrix &rMat) const |
bool | operator!= (const B2DHomMatrix &rMat) const |
B2DHomMatrix & | operator*= (double fValue) |
B2DHomMatrix & | operator/= (double fValue) |
B2DHomMatrix & | operator*= (const B2DHomMatrix &rMat) |
B2DHomMatrix & | operator= (const B2DHomMatrix &rMat) |
B2DHomMatrix & | operator= (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 |
Definition at line 35 of file b2dhommatrix.hxx.
Definition at line 38 of file b2dhommatrix.hxx.
basegfx::B2DHomMatrix::B2DHomMatrix | ( | ) |
Definition at line 36 of file b2dhommatrix.cxx.
|
default |
|
default |
|
default |
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.
|
inline |
Definition at line 64 of file b2dhommatrix.hxx.
References get().
|
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.
|
inline |
Definition at line 66 of file b2dhommatrix.hxx.
References get().
|
inline |
Definition at line 68 of file b2dhommatrix.hxx.
References get().
|
inline |
Definition at line 70 of file b2dhommatrix.hxx.
References get().
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().
|
inline |
Definition at line 72 of file b2dhommatrix.hxx.
References get().
|
inline |
Definition at line 74 of file b2dhommatrix.hxx.
References get().
double basegfx::B2DHomMatrix::get | ( | sal_uInt16 | nRow, |
sal_uInt16 | nColumn | ||
) | const |
Definition at line 58 of file b2dhommatrix.cxx.
References o3tl::cow_wrapper< typename T, class MTPolicy >::get(), and mpImpl.
Referenced by decompose(), basegfx::utils::getColumn(), basegfx::B2DVector::operator*=(), basegfx::B2IVector::operator*=(), and basegfx::B2DSize::operator*=().
void basegfx::B2DHomMatrix::identity | ( | ) |
Definition at line 88 of file b2dhommatrix.cxx.
References mpImpl.
Referenced by basegfx::unotools::homMatrixFromAffineMatrix(), and basegfx::utils::number2PolyPolygon().
bool basegfx::B2DHomMatrix::invert | ( | ) |
Definition at line 98 of file b2dhommatrix.cxx.
References basegfx::internal::ImplHomMatrixTemplate< RowSize >::getEdgeLength(), isIdentity(), basegfx::internal::ImplHomMatrixTemplate< RowSize >::ludcmp(), and mpImpl.
bool basegfx::B2DHomMatrix::isIdentity | ( | ) | const |
Definition at line 83 of file b2dhommatrix.cxx.
References basegfx::DEFAULT, mpImpl, and o3tl::cow_wrapper< typename T, class MTPolicy >::same_object().
Referenced by invert(), operator*=(), basegfx::B2DRange::transform(), basegfx::B2DCubicBezier::transform(), basegfx::B2DPolygon::transform(), basegfx::B2DPolyPolygon::transform(), basegfx::B3DPolygon::transformTextureCoordinates(), and basegfx::B3DPolyPolygon::transformTextureCoordinates().
bool basegfx::B2DHomMatrix::isInvertible | ( | ) | const |
Definition at line 93 of file b2dhommatrix.cxx.
References mpImpl.
bool basegfx::B2DHomMatrix::isLastLineDefault | ( | ) | const |
Definition at line 78 of file b2dhommatrix.cxx.
References mpImpl.
bool basegfx::B2DHomMatrix::operator!= | ( | const B2DHomMatrix & | rMat | ) | const |
Definition at line 178 of file b2dhommatrix.cxx.
B2DHomMatrix & basegfx::B2DHomMatrix::operator*= | ( | const B2DHomMatrix & | rMat | ) |
Definition at line 150 of file b2dhommatrix.cxx.
References isIdentity(), and mpImpl.
B2DHomMatrix & basegfx::B2DHomMatrix::operator*= | ( | double | fValue | ) |
Definition at line 130 of file b2dhommatrix.cxx.
References basegfx::fTools::equal(), and mpImpl.
B2DHomMatrix & basegfx::B2DHomMatrix::operator+= | ( | const B2DHomMatrix & | rMat | ) |
Definition at line 118 of file b2dhommatrix.cxx.
References mpImpl.
B2DHomMatrix & basegfx::B2DHomMatrix::operator-= | ( | const B2DHomMatrix & | rMat | ) |
Definition at line 124 of file b2dhommatrix.cxx.
References mpImpl.
B2DHomMatrix & basegfx::B2DHomMatrix::operator/= | ( | double | fValue | ) |
Definition at line 140 of file b2dhommatrix.cxx.
References basegfx::fTools::equal(), and mpImpl.
|
default |
References decompose().
|
default |
bool basegfx::B2DHomMatrix::operator== | ( | const B2DHomMatrix & | rMat | ) | const |
Definition at line 170 of file b2dhommatrix.cxx.
References mpImpl, and o3tl::cow_wrapper< typename T, class MTPolicy >::same_object().
void basegfx::B2DHomMatrix::rotate | ( | double | fRadiant | ) |
Definition at line 183 of file b2dhommatrix.cxx.
References basegfx::utils::createSinCosOrthogonal(), basegfx::fTools::equalZero(), mpImpl, and basegfx::internal::ImplHomMatrixTemplate< RowSize >::set().
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), and basegfx::utils::importFromSvgD().
void basegfx::B2DHomMatrix::scale | ( | const B2DTuple & | rTuple | ) |
Definition at line 235 of file b2dhommatrix.cxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and scale().
void basegfx::B2DHomMatrix::scale | ( | double | fX, |
double | fY | ||
) |
Definition at line 220 of file b2dhommatrix.cxx.
References basegfx::fTools::equal(), mpImpl, and basegfx::internal::ImplHomMatrixTemplate< RowSize >::set().
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), basegfx::initRectGradientInfo(), and scale().
void basegfx::B2DHomMatrix::set | ( | sal_uInt16 | nRow, |
sal_uInt16 | nColumn, | ||
double | fValue | ||
) |
Definition at line 63 of file b2dhommatrix.cxx.
References mpImpl.
Referenced by basegfx::utils::createRotateB2DHomMatrix(), basegfx::utils::createScaleB2DHomMatrix(), basegfx::utils::createScaleTranslateB2DHomMatrix(), basegfx::utils::createShearXB2DHomMatrix(), basegfx::utils::createShearYB2DHomMatrix(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::utils::createTranslateB2DHomMatrix(), and basegfx::unotools::homMatrixFromAffineMatrix().
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().
void basegfx::B2DHomMatrix::shearX | ( | double | fSx | ) |
Definition at line 240 of file b2dhommatrix.cxx.
References basegfx::fTools::equalZero(), mpImpl, and basegfx::internal::ImplHomMatrixTemplate< RowSize >::set().
void basegfx::B2DHomMatrix::shearY | ( | double | fSy | ) |
Definition at line 253 of file b2dhommatrix.cxx.
References basegfx::fTools::equalZero(), mpImpl, and basegfx::internal::ImplHomMatrixTemplate< RowSize >::set().
void basegfx::B2DHomMatrix::translate | ( | const B2DTuple & | rTuple | ) |
Definition at line 215 of file b2dhommatrix.cxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), and translate().
void basegfx::B2DHomMatrix::translate | ( | double | fX, |
double | fY | ||
) |
Definition at line 202 of file b2dhommatrix.cxx.
References basegfx::fTools::equalZero(), mpImpl, and basegfx::internal::ImplHomMatrixTemplate< RowSize >::set().
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::utils::importFromSvgD(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), basegfx::initRectGradientInfo(), basegfx::utils::number2PolyPolygon(), and translate().
|
private |
Definition at line 41 of file b2dhommatrix.hxx.
Referenced by B2DHomMatrix(), decompose(), get(), identity(), invert(), isIdentity(), isInvertible(), isLastLineDefault(), operator*=(), operator+=(), operator-=(), operator/=(), operator==(), rotate(), scale(), set(), set3x2(), shearX(), shearY(), and translate().