Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
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 More...
bool | isIdentity () const
| returns true if the matrix is an identity matrix More...
void | checkIdentity () const
| check if a matrix is the identity matrix More...
MWAWVec3f const & | operator[] (int c) const
| the two extremum points which defined the box More...
MWAWVec2f | operator* (MWAWVec2f const &pt) const
| operator* for vec2f More...
MWAWVec2f | multiplyDirection (MWAWVec2f const &dir) const
| operator* for direction More...
MWAWBox2f | operator* (MWAWBox2f const &box) const
| operator* for box2f More...
MWAWTransformation | operator* (MWAWTransformation const &mat) const
| operator* for transform More...
MWAWTransformation & | operator*= (MWAWTransformation const &mat)
| operator*= More...
bool | operator== (MWAWTransformation const &mat) const
| operator== More...
bool | operator!= (MWAWTransformation const &mat) const
| operator!= More...
bool | operator< (MWAWTransformation const &mat) const
| operator< More...
bool | operator<= (MWAWTransformation const &mat) const
| operator<= More...
bool | operator> (MWAWTransformation const &mat) const
| operator> More...
bool | operator>= (MWAWTransformation const &mat) const
| operator>= More...
bool | decompose (float &rotation, MWAWVec2f &shearing, MWAWTransformation &transform, MWAWVec2f const &center) const
| try to decompose the matrix in a rotation + scaling/translation matrix. More...

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

## Protected Attributes
std::pair< MWAWVec3f, MWAWVec3f > | m_data
| the data More...
bool | m_isIdentity
| flag to know if this matrix is an identity matrix More...

## 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)`
| ) |  |
| inline explicit

constructor

## Member Function Documentation

## ◆ checkIdentity()

void MWAWTransformation::checkIdentity | ( |  | ) | const
| inline

check if a matrix is the identity matrix

Referenced by 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(), CricketDrawParser::sendBitmap(), and MWAWGraphicShape::transform().

## ◆ isIdentity()

bool MWAWTransformation::isIdentity | ( |  | ) | const
| inline

returns true if the matrix is an identity matrix

Referenced by FreeHandParser::decomposeMatrix(), and MWAWGraphicShape::transform().

## ◆ multiplyDirection()

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

operator* for direction

## ◆ operator!=()

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

operator!=

## ◆ operator*() [1/3]

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

operator* for vec2f

## ◆ operator*() [2/3]

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

operator* for box2f

## ◆ operator*() [3/3]

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

operator* for transform

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

  c | 0 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 | ) |
| inline static

returns a scaling transformation

Referenced by FreeHandParser::checkHeader().

## ◆ shear()

static MWAWTransformation MWAWTransformation::shear | ( | MWAWVec2f | s,
|  | MWAWVec2f const & | center = `MWAWVec2f(0,0)`
| ) |  |
| inline static

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 | ) |
| inline static

returns a translation transformation

Referenced by FreeHandParser::checkHeader(), CricketDrawParserInternal::Shape::getTransformation(), and CricketDrawParser::sendAll().

## Member Data Documentation

## ◆ m_data

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

the data

Referenced by operator!=(), operator*(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

## ◆ m_isIdentity

bool MWAWTransformation::m_isIdentity
| mutable protected

flag to know if this matrix is an identity matrix

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

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

- libmwaw_internal.hxx
- libmwaw_internal.cxx