WPSTransformation Class Reference documentation

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

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

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

## ◆ WPSTransformation() [1/3]

WPSTransformation::WPSTransformation | ( | WPSVec3f const & | xRow = `WPSVec3f(1,0,0)`,
|  | WPSVec3f const & | yRow = `WPSVec3f(0,1,0)`
| ) |  |
| inlineexplicit

constructor

## ◆ 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*(), 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()

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

returns a scaling transformation

Referenced by Quattro9Graph::sendShape().

## ◆ shear()

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

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>=(), and operator[]().

## ◆ m_isIdentity

bool WPSTransformation::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:

- libwps_internal.h
- libwps_internal.cpp