WPSTransformation Class Reference

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

`#include <libwps_internal.h>`

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

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

## Protected Attributes
std::pair< WPSVec3f, WPSVec3f > | m_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

## ◆ WPSTransformation() [1/3]

WPSTransformation::WPSTransformation | ( | WPSVec3f const & | xRow = WPSVec3f(1,0,0),
|  | WPSVec3f const & | yRow = WPSVec3f(0,1,0) )
| inline explicit

constructor

Referenced by decompose(), operator!=(), operator*(), operator*=(), operator<(), operator<=(), operator=(), operator=(), operator==(), operator>(), operator>=(), rotation(), scale(), shear(), translation(), WPSTransformation(), and WPSTransformation().

## ◆ WPSTransformation() [2/3]

WPSTransformation::WPSTransformation | ( | WPSTransformation const & |  | ) |
| default

## ◆ WPSTransformation() [3/3]

WPSTransformation::WPSTransformation | ( | WPSTransformation && |  | ) |
| default

## Member Function Documentation

## ◆ checkIdentity()

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

check if a matrix is the identity matrix

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

## ◆ decompose()

bool WPSTransformation::decompose | ( | float & | rotation,
|  | Vec2f & | shearing,
|  | WPSTransformation & | transform,
|  | Vec2f 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 WPSGraphicShape::transform().

## ◆ isIdentity()

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

returns true if the matrix is an identity matrix

Referenced by LotusGraph::readGraphic(), LotusGraph::sendZone(), and WPSGraphicShape::transform().

## ◆ multiplyDirection()

Vec2f WPSTransformation::multiplyDirection | ( | Vec2f const & | dir | ) | const
| inline

operator* for direction

Referenced by operator*(), Quattro9Graph::sendShape(), and Quattro9Graph::sendShape().

## ◆ operator!=()

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

operator!=

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

Vec2f WPSTransformation::operator* | ( | Vec2f const & | pt | ) | const
| inline

operator* for vec2f

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

WPSBox2f WPSTransformation::operator* | ( | WPSBox2f const & | box | ) | const
| inline

operator* for box2f

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

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

operator* for transform

## ◆ operator*=()

WPSTransformation & WPSTransformation::operator*= | ( | WPSTransformation const & | mat | ) |
| inline

operator*=

## ◆ operator<()

bool WPSTransformation::operator< | ( | WPSTransformation const & | mat | ) | const
| inline

operator<

## ◆ operator<=()

bool WPSTransformation::operator<= | ( | WPSTransformation const & | mat | ) | const
| inline

operator<=

## ◆ operator=() [1/2]

WPSTransformation & WPSTransformation::operator= | ( | WPSTransformation && |  | ) |
| default

## ◆ operator=() [2/2]

WPSTransformation & WPSTransformation::operator= | ( | WPSTransformation const & |  | ) |
| default

## ◆ operator==()

bool WPSTransformation::operator== | ( | WPSTransformation const & | mat | ) | const
| inline

operator==

## ◆ operator>()

bool WPSTransformation::operator> | ( | WPSTransformation const & | mat | ) | const
| inline

operator>

## ◆ operator>=()

bool WPSTransformation::operator>= | ( | WPSTransformation const & | mat | ) | const
| inline

operator>=

## ◆ operator[]()

WPSVec3f const & WPSTransformation::operator[] | ( | int | c | ) | const
| inline

the two extremum points which defined the box

Parameters

  c | 0 means the minimum and 1 the maximum

## ◆ rotation()

WPSTransformation WPSTransformation::rotation | ( | float | angle,
|  | Vec2f const & | center = Vec2f(0,0) )
| static

returns a rotation transformation around center.

Note
  angle must be given in degree

Referenced by decompose(), and LotusGraphInternal::ZonePc::getTransformation().

## ◆ scale()

WPSTransformation WPSTransformation::scale | ( | Vec2f const & | trans | ) |
| inline static

returns a scaling transformation

Referenced by Quattro9Graph::sendShape().

## ◆ shear()

WPSTransformation WPSTransformation::shear | ( | Vec2f | s,
|  | Vec2f const & | center = Vec2f(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()

WPSTransformation WPSTransformation::translation | ( | Vec2f const & | trans | ) |
| inline static

returns a translation transformation

Referenced by LotusGraphInternal::ZonePc::getTransformation(), and Quattro9Graph::sendShape().

## Member Data Documentation

## ◆ m_data

std::pair<WPSVec3f, WPSVec3f > WPSTransformation::m_data
| protected

the data

Referenced by checkIdentity(), multiplyDirection(), operator!=(), operator*(), operator*(), operator<(), operator<=(), operator==(), operator>(), operator>=(), operator[](), and WPSTransformation().

## ◆ m_isIdentity

bool WPSTransformation::m_isIdentity
| mutable protected

flag to know if this matrix is an identity matrix

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

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

- libwps_internal.h
- libwps_internal.cpp