MWAWTransformation Class Reference

a transformation which stored the first row of a 3x3 perspective matrix More...

#include <libmwaw_internal.hxx>

Public Member Functions

 MWAWTransformation (MWAWVec3f const &xRow=MWAWVec3f(1, 0, 0), MWAWVec3f const &yRow=MWAWVec3f(0, 1, 0))
 constructor
 
bool isIdentity () const
 returns true if the matrix is an identity matrix
 
void checkIdentity () const
 check if a matrix is the identity matrix
 
MWAWVec3f const & operator[] (int c) const
 the two extremum points which defined the box
 
MWAWVec2f operator* (MWAWVec2f const &pt) const
 operator* for vec2f
 
MWAWVec2f multiplyDirection (MWAWVec2f const &dir) const
 operator* for direction
 
MWAWBox2f operator* (MWAWBox2f const &box) const
 operator* for box2f
 
MWAWTransformation operator* (MWAWTransformation const &mat) const
 operator* for transform
 
MWAWTransformationoperator*= (MWAWTransformation const &mat)
 operator*=
 
bool operator== (MWAWTransformation const &mat) const
 operator==
 
bool operator!= (MWAWTransformation const &mat) const
 operator!=
 
bool operator< (MWAWTransformation const &mat) const
 operator<
 
bool operator<= (MWAWTransformation const &mat) const
 operator<=
 
bool operator> (MWAWTransformation const &mat) const
 operator>
 
bool operator>= (MWAWTransformation const &mat) const
 operator>=
 
bool decompose (float &rotation, MWAWVec2f &shearing, MWAWTransformation &transform, MWAWVec2f const &center) const
 try to decompose the matrix in a rotation + scaling/translation matrix.
 

Static Public Member Functions

static MWAWTransformation translation (MWAWVec2f const &trans)
 returns a translation transformation
 
static MWAWTransformation scale (MWAWVec2f const &trans)
 returns a scaling transformation
 
static MWAWTransformation rotation (float angle, MWAWVec2f const &center=MWAWVec2f(0, 0))
 returns a rotation transformation around center.
 
static MWAWTransformation shear (MWAWVec2f s, MWAWVec2f const &center=MWAWVec2f(0, 0))
 returns a shear transformation letting center invariant, ie.
 

Protected Attributes

std::pair< MWAWVec3f, MWAWVec3fm_data
 the data
 
bool m_isIdentity
 flag to know if this matrix is an identity matrix
 

Detailed Description

a transformation which stored the first row of a 3x3 perspective matrix

Constructor & Destructor Documentation

◆ MWAWTransformation()

MWAWTransformation::MWAWTransformation ( MWAWVec3f const &  xRow = MWAWVec3f(1,0,0),
MWAWVec3f const &  yRow = MWAWVec3f(0,1,0) 
)
inlineexplicit

constructor

Member Function Documentation

◆ checkIdentity()

void MWAWTransformation::checkIdentity ( ) const
inline

check if a matrix is the identity matrix

Referenced by MWAWTransformation(), and operator*().

◆ decompose()

bool MWAWTransformation::decompose ( float &  rotation,
MWAWVec2f shearing,
MWAWTransformation transform,
MWAWVec2f const &  center 
) const

try to decompose the matrix in a rotation + scaling/translation matrix.

Note: the center of rotation is given before applying the transformation(this)

Referenced by CricketDrawParser::send(), Canvas5Graph::send(), CricketDrawParser::sendBitmap(), Canvas5Graph::sendCurveText(), Canvas5Graph::sendGIF(), Canvas5Graph::sendSpecial(), and MWAWGraphicShape::transform().

◆ isIdentity()

bool MWAWTransformation::isIdentity ( ) const
inline

◆ multiplyDirection()

MWAWVec2f MWAWTransformation::multiplyDirection ( MWAWVec2f const &  dir) const
inline

operator* for direction

Referenced by operator*().

◆ operator!=()

bool MWAWTransformation::operator!= ( MWAWTransformation const &  mat) const
inline

operator!=

◆ operator*() [1/3]

MWAWBox2f MWAWTransformation::operator* ( MWAWBox2f const &  box) const
inline

operator* for box2f

◆ operator*() [2/3]

MWAWTransformation MWAWTransformation::operator* ( MWAWTransformation const &  mat) const
inline

operator* for transform

◆ operator*() [3/3]

MWAWVec2f MWAWTransformation::operator* ( MWAWVec2f const &  pt) const
inline

operator* for vec2f

◆ operator*=()

MWAWTransformation & MWAWTransformation::operator*= ( MWAWTransformation const &  mat)
inline

operator*=

◆ operator<()

bool MWAWTransformation::operator< ( MWAWTransformation const &  mat) const
inline

operator<

◆ operator<=()

bool MWAWTransformation::operator<= ( MWAWTransformation const &  mat) const
inline

operator<=

◆ operator==()

bool MWAWTransformation::operator== ( MWAWTransformation const &  mat) const
inline

operator==

◆ operator>()

bool MWAWTransformation::operator> ( MWAWTransformation const &  mat) const
inline

operator>

◆ operator>=()

bool MWAWTransformation::operator>= ( MWAWTransformation const &  mat) const
inline

operator>=

◆ operator[]()

MWAWVec3f const & MWAWTransformation::operator[] ( int  c) const
inline

the two extremum points which defined the box

Parameters
c0 means the minimum and 1 the maximum

◆ rotation()

MWAWTransformation MWAWTransformation::rotation ( float  angle,
MWAWVec2f const &  center = MWAWVec2f(0,0) 
)
static

returns a rotation transformation around center.

Note
angle must be given in degree

Referenced by decompose(), FreeHandParser::decomposeMatrix(), and CricketDrawParserInternal::Shape::getTransformation().

◆ scale()

static MWAWTransformation MWAWTransformation::scale ( MWAWVec2f const &  trans)
inlinestatic

returns a scaling transformation

Referenced by FreeHandParser::checkHeader().

◆ shear()

static MWAWTransformation MWAWTransformation::shear ( MWAWVec2f  s,
MWAWVec2f const &  center = MWAWVec2f(0,0) 
)
inlinestatic

returns a shear transformation letting center invariant, ie.

a matrix ( 1 s[0] -s[0]*center[1], s[1] 1 -s[1]*center[0], 0 0 1)

Referenced by decompose().

◆ translation()

static MWAWTransformation MWAWTransformation::translation ( MWAWVec2f const &  trans)
inlinestatic

Member Data Documentation

◆ m_data

std::pair<MWAWVec3f, MWAWVec3f > MWAWTransformation::m_data
protected

◆ m_isIdentity

bool MWAWTransformation::m_isIdentity
mutableprotected

flag to know if this matrix is an identity matrix

Referenced by checkIdentity(), decompose(), isIdentity(), multiplyDirection(), operator*(), and operator*=().


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

Generated on Wed May 3 2023 07:18:29 for libmwaw by doxygen 1.9.6