Classes | Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
WPSBox2< T > Class Template Reference

small class which defines a 2D WPSBox More...

`#include <libwps_internal.h>`

## Classes
struct | PosSizeLt
| internal struct used to create sorted map, sorted first min then max More...

## Public Types
typedef std::map< WPSBox2< T >, T, struct PosSizeLt > | Map
| map of WPSBox2 More...

## Public Member Functions
| WPSBox2 (Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >())
| constructor More...
template<class U >
| WPSBox2 (WPSBox2< U > const &p)
| generic constructor More...
Vec2< T > const & | min () const
| the minimum 2D point (in x and in y) More...
Vec2< T > const & | max () const
| the maximum 2D point (in x and in y) More...
Vec2< T > & | min ()
| the minimum 2D point (in x and in y) More...
Vec2< T > & | max ()
| the maximum 2D point (in x and in y) More...
Vec2< T > const & | operator[] (int c) const
| the two extremum points which defined the box More...
Vec2< T > | size () const
| the box size More...
Vec2< T > | center () const
| the box center More...
void | set (Vec2< T > const &x, Vec2< T > const &y)
| resets the data to minimum x and maximum y More...
void | setMin (Vec2< T > const &x)
| resets the minimum point More...
void | setMax (Vec2< T > const &y)
| resets the maximum point More...
void | resizeFromMin (Vec2< T > const &sz)
| resize the box keeping the minimum More...
void | resizeFromMax (Vec2< T > const &sz)
| resize the box keeping the maximum More...
void | resizeFromCenter (Vec2< T > const &sz)
| resize the box keeping the center More...
template<class U >
void | scale (U factor)
| scales all points of the box by factor More...
void | extend (T val)
| extends the bdbox by (val, val) keeping the center More...
WPSBox2< T > | getUnion (WPSBox2< T > const &box) const
| returns the union between this and box More...
WPSBox2< T > | getIntersection (WPSBox2< T > const &box) const
| returns the intersection between this and box More...
bool | operator== (WPSBox2< T > const &p) const
| comparison operator== More...
bool | operator!= (WPSBox2< T > const &p) const
| comparison operator!= More...
bool | operator< (WPSBox2< T > const &p) const
| comparison operator< : fist sorts min by Y,X values then max extremity More...
int | cmp (WPSBox2< T > const &p) const
| comparison function : fist sorts min by Y,X values then max extremity More...

## Protected Attributes
Vec2< T > | m_pt [2]
| the two extremities More...

## Friends
std::ostream & | operator<< (std::ostream &o, WPSBox2< T > const &f)
| print data in form X0xY0<->X1xY1 More...

## Detailed Description

### template<class T>
class WPSBox2< T >

small class which defines a 2D WPSBox

## Member Typedef Documentation

## ◆ Map

template<class T>

WPSBox2< T >::Map

map of WPSBox2

## Constructor & Destructor Documentation

## ◆ WPSBox2() [1/2]

template<class T>

WPSBox2< T >::WPSBox2 | ( | Vec2< T > | minPt = `Vec2<T>()`,
|  | Vec2< T > | maxPt = `Vec2<T>()`
| ) |  |
| inline explicit

constructor

## ◆ WPSBox2() [2/2]

template<class T>
template<class U >

WPSBox2< T >::WPSBox2 | ( | WPSBox2< U > const & | p | ) |
| inline explicit

generic constructor

## Member Function Documentation

## ◆ center()

template<class T>

Vec2<T> WPSBox2< T >::center | ( |  | ) | const
| inline

the box center

Referenced by WPSGraphicShape::getPath(), LotusGraphInternal::ZonePc::getTransformation(), and WPSGraphicShape::transform().

## ◆ cmp()

template<class T>

int WPSBox2< T >::cmp | ( | WPSBox2< T > const & | p | ) | const
| inline

comparison function : fist sorts min by Y,X values then max extremity

Referenced by WPSGraphicShape::cmp(), WPSBox2< int >::operator!=(), WPSBox2< T >::PosSizeLt::operator()(), WPSBox2< int >::operator<(), and WPSBox2< int >::operator==().

## ◆ extend()

template<class T>

void WPSBox2< T >::extend | ( | T | val | ) |
| inline

extends the bdbox by (val, val) keeping the center

## ◆ getIntersection()

template<class T>

WPSBox2<T> WPSBox2< T >::getIntersection | ( | WPSBox2< T > const & | box | ) | const
| inline

returns the intersection between this and box

## ◆ getUnion()

template<class T>

WPSBox2<T> WPSBox2< T >::getUnion | ( | WPSBox2< T > const & | box | ) | const
| inline

returns the union between this and box

Referenced by Quattro9GraphInternal::Shape::getBdBox(), LotusGraph::readGraphic(), Quattro9Graph::readShapeRec(), WPSGraphicShape::rotate(), and WPSGraphicShape::transform().

## ◆ max() [1/2]

template<class T>

Vec2<T> const& WPSBox2< T >::max | ( |  | ) | const
| inline

the maximum 2D point (in x and in y)

Referenced by WPSCell::Compare::Point::getPos(), WPSTransformation::operator*(), WPSGraphicShape::scale(), and WPSGraphicShape::translate().

## ◆ max() [2/2]

template<class T>

Vec2<T>& WPSBox2< T >::max | ( |  | ) |
| inline

the maximum 2D point (in x and in y)

## ◆ min() [1/2]

template<class T>

Vec2<T> const& WPSBox2< T >::min | ( |  | ) | const
| inline

the minimum 2D point (in x and in y)

Referenced by WPSCell::Compare::Point::getPos(), WPSTransformation::operator*(), WPSGraphicShape::scale(), and WPSGraphicShape::translate().

## ◆ min() [2/2]

template<class T>

Vec2<T>& WPSBox2< T >::min | ( |  | ) |
| inline

the minimum 2D point (in x and in y)

## ◆ operator!=()

template<class T>

bool WPSBox2< T >::operator!= | ( | WPSBox2< T > const & | p | ) | const
| inline

comparison operator!=

## ◆ operator<()

template<class T>

bool WPSBox2< T >::operator< | ( | WPSBox2< T > const & | p | ) | const
| inline

comparison operator< : fist sorts min by Y,X values then max extremity

## ◆ operator==()

template<class T>

bool WPSBox2< T >::operator== | ( | WPSBox2< T > const & | p | ) | const
| inline

comparison operator==

## ◆ operator[]()

template<class T>

Vec2<T> const& WPSBox2< T >::operator[] | ( | int | c | ) | const
| inline

the two extremum points which defined the box

Parameters

  c | value 0 means the minimum, value 1 means the maximum

## ◆ resizeFromCenter()

template<class T>

void WPSBox2< T >::resizeFromCenter | ( | Vec2< T > const & | sz | ) |
| inline

resize the box keeping the center

## ◆ resizeFromMax()

template<class T>

void WPSBox2< T >::resizeFromMax | ( | Vec2< T > const & | sz | ) |
| inline

resize the box keeping the maximum

## ◆ resizeFromMin()

template<class T>

void WPSBox2< T >::resizeFromMin | ( | Vec2< T > const & | sz | ) |
| inline

resize the box keeping the minimum

## ◆ scale()

template<class T>
template<class U >

void WPSBox2< T >::scale | ( | U | factor | ) |
| inline

scales all points of the box by factor

## ◆ set()

template<class T>

void WPSBox2< T >::set | ( | Vec2< T > const & | x,
|  | Vec2< T > const & | y
| ) |  |
| inline

resets the data to minimum x and maximum y

## ◆ setMax()

template<class T>

void WPSBox2< T >::setMax | ( | Vec2< T > const & | y | ) |
| inline

resets the maximum point

Referenced by LotusSpreadsheet::readCellName().

## ◆ setMin()

template<class T>

void WPSBox2< T >::setMin | ( | Vec2< T > const & | x | ) |
| inline

resets the minimum point

Referenced by LotusSpreadsheet::readCellName().

## ◆ size()

template<class T>

Vec2<T> WPSBox2< T >::size | ( |  | ) | const
| inline

the box size

Referenced by WPSGraphicShape::addTo(), Quattro9GraphInternal::Shape::getBdBox(), LotusGraphInternal::ZoneMac::getGraphicShape(), LotusGraphInternal::ZonePc::getGraphicShape(), WPSGraphicShape::getPath(), WPSCell::Compare::Point::getSize(), WPSCell::Compare::operator()(), WKSChart::sendChart(), and LotusGraph::sendZone().

## Friends And Related Function Documentation

## ◆ operator<<

template<class T>

std::ostream& operator<< | ( | std::ostream & | o,
|  | WPSBox2< T > const & | f
| ) |  |
| friend

print data in form X0xY0<->X1xY1

## Member Data Documentation

## ◆ m_pt

template<class T>

Vec2<T> WPSBox2< T >::m_pt[2]
| protected

the two extremities

Referenced by WPSBox2< int >::center(), WPSBox2< int >::cmp(), WPSBox2< int >::extend(), WPSBox2< int >::getIntersection(), WPSBox2< int >::getUnion(), WPSBox2< int >::max(), WPSBox2< int >::min(), WPSBox2< int >::operator[](), WPSBox2< int >::resizeFromCenter(), WPSBox2< int >::resizeFromMax(), WPSBox2< int >::resizeFromMin(), WPSBox2< int >::scale(), WPSBox2< int >::set(), WPSBox2< int >::setMax(), WPSBox2< int >::setMin(), WPSBox2< int >::size(), and WPSBox2< int >::WPSBox2().

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

- libwps_internal.h