STOFFBox2< T > Class Template Reference

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

#include <libstaroffice_internal.hxx>

Classes

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

Public Types

typedef std::map< STOFFBox2< T >, T, struct PosSizeLtMap
 map of STOFFBox2 More...
 

Public Member Functions

 STOFFBox2 (STOFFVec2< T > minPt=STOFFVec2< T >(), STOFFVec2< T > maxPt=STOFFVec2< T >())
 constructor More...
 
template<class U >
 STOFFBox2 (STOFFBox2< U > const &p)
 generic constructor More...
 
STOFFVec2< T > const & min () const
 the minimum 2D point (in x and in y) More...
 
STOFFVec2< T > const & max () const
 the maximum 2D point (in x and in y) More...
 
STOFFVec2< T > & min ()
 the minimum 2D point (in x and in y) More...
 
STOFFVec2< T > & max ()
 the maximum 2D point (in x and in y) More...
 
STOFFVec2< T > const & operator[] (int c) const
 the two extremum points which defined the box More...
 
STOFFVec2< T > size () const
 the box size More...
 
STOFFVec2< T > center () const
 the box center More...
 
void set (STOFFVec2< T > const &x, STOFFVec2< T > const &y)
 resets the data to minimum x and maximum y More...
 
void setMin (STOFFVec2< T > const &x)
 resets the minimum point More...
 
void setMax (STOFFVec2< T > const &y)
 resets the maximum point More...
 
void resizeFromMin (STOFFVec2< T > const &sz)
 resize the box keeping the minimum More...
 
void resizeFromMax (STOFFVec2< T > const &sz)
 resize the box keeping the maximum More...
 
void resizeFromCenter (STOFFVec2< 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...
 
STOFFBox2< T > getUnion (STOFFBox2< T > const &box) const
 returns the union between this and box More...
 
STOFFBox2< T > getIntersection (STOFFBox2< T > const &box) const
 returns the intersection between this and box More...
 
bool operator== (STOFFBox2< T > const &p) const
 comparison operator== More...
 
bool operator!= (STOFFBox2< T > const &p) const
 comparison operator!= More...
 
bool operator< (STOFFBox2< T > const &p) const
 comparison operator< : fist sorts min by Y,X values then max extremity More...
 
int cmp (STOFFBox2< T > const &p) const
 comparison function : fist sorts min by Y,X values then max extremity More...
 

Protected Attributes

STOFFVec2< T > m_pt [2]
 the two extremities More...
 

Friends

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

Detailed Description

template<class T>
class STOFFBox2< T >

small class which defines a 2D Box

Member Typedef Documentation

◆ Map

template<class T>
STOFFBox2< T >::Map

map of STOFFBox2

Constructor & Destructor Documentation

◆ STOFFBox2() [1/2]

template<class T>
STOFFBox2< T >::STOFFBox2 ( STOFFVec2< T >  minPt = STOFFVec2<T>(),
STOFFVec2< T >  maxPt = STOFFVec2<T>() 
)
inline

constructor

◆ STOFFBox2() [2/2]

template<class T>
template<class U >
STOFFBox2< T >::STOFFBox2 ( STOFFBox2< U > const &  p)
inline

generic constructor

Member Function Documentation

◆ center()

template<class T>
STOFFVec2<T> STOFFBox2< T >::center ( ) const
inline

the box center

Referenced by libstoff::rotateBoxFromCenter().

◆ cmp()

template<class T>
int STOFFBox2< T >::cmp ( STOFFBox2< T > const &  p) const
inline

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

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

◆ extend()

template<class T>
void STOFFBox2< T >::extend ( val)
inline

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

◆ getIntersection()

template<class T>
STOFFBox2<T> STOFFBox2< T >::getIntersection ( STOFFBox2< T > const &  box) const
inline

returns the intersection between this and box

◆ getUnion()

template<class T>
STOFFBox2<T> STOFFBox2< T >::getUnion ( STOFFBox2< T > const &  box) const
inline

returns the union between this and box

◆ max() [1/2]

◆ max() [2/2]

template<class T>
STOFFVec2<T>& STOFFBox2< T >::max ( )
inline

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

◆ min() [1/2]

◆ min() [2/2]

template<class T>
STOFFVec2<T>& STOFFBox2< T >::min ( )
inline

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

◆ operator!=()

template<class T>
bool STOFFBox2< T >::operator!= ( STOFFBox2< T > const &  p) const
inline

comparison operator!=

◆ operator<()

template<class T>
bool STOFFBox2< T >::operator< ( STOFFBox2< T > const &  p) const
inline

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

◆ operator==()

template<class T>
bool STOFFBox2< T >::operator== ( STOFFBox2< T > const &  p) const
inline

comparison operator==

◆ operator[]()

template<class T>
STOFFVec2<T> const& STOFFBox2< T >::operator[] ( int  c) const
inline

the two extremum points which defined the box

Parameters
c0 means the minimum and 1 the maximum

◆ resizeFromCenter()

template<class T>
void STOFFBox2< T >::resizeFromCenter ( STOFFVec2< T > const &  sz)
inline

resize the box keeping the center

◆ resizeFromMax()

template<class T>
void STOFFBox2< T >::resizeFromMax ( STOFFVec2< T > const &  sz)
inline

resize the box keeping the maximum

◆ resizeFromMin()

template<class T>
void STOFFBox2< T >::resizeFromMin ( STOFFVec2< T > const &  sz)
inline

resize the box keeping the minimum

◆ scale()

template<class T>
template<class U >
void STOFFBox2< T >::scale ( factor)
inline

scales all points of the box by factor

◆ set()

template<class T>
void STOFFBox2< T >::set ( STOFFVec2< T > const &  x,
STOFFVec2< T > const &  y 
)
inline

resets the data to minimum x and maximum y

◆ setMax()

template<class T>
void STOFFBox2< T >::setMax ( STOFFVec2< T > const &  y)
inline

resets the maximum point

◆ setMin()

template<class T>
void STOFFBox2< T >::setMin ( STOFFVec2< T > const &  x)
inline

resets the minimum point

◆ size()

Friends And Related Function Documentation

◆ operator<<

template<class T>
std::ostream& operator<< ( std::ostream &  o,
STOFFBox2< T > const &  f 
)
friend

print data in form X0xY0<->X1xY1

Member Data Documentation

◆ m_pt


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

Generated on Sun Mar 24 2019 23:33:13 for libstaroffice by doxygen 1.8.15