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 PosSizeLt > | Map |
map of STOFFBox2 | |
Public Member Functions | |
STOFFBox2 (STOFFVec2< T > minPt=STOFFVec2< T >(), STOFFVec2< T > maxPt=STOFFVec2< T >()) | |
constructor | |
template<class U > | |
STOFFBox2 (STOFFBox2< U > const &p) | |
generic constructor | |
STOFFVec2< T > const & | min () const |
the minimum 2D point (in x and in y) | |
STOFFVec2< T > const & | max () const |
the maximum 2D point (in x and in y) | |
STOFFVec2< T > & | min () |
the minimum 2D point (in x and in y) | |
STOFFVec2< T > & | max () |
the maximum 2D point (in x and in y) | |
STOFFVec2< T > const & | operator[] (int c) const |
the two extremum points which defined the box | |
STOFFVec2< T > | size () const |
the box size | |
STOFFVec2< T > | center () const |
the box center | |
void | set (STOFFVec2< T > const &x, STOFFVec2< T > const &y) |
resets the data to minimum x and maximum y | |
void | setMin (STOFFVec2< T > const &x) |
resets the minimum point | |
void | setMax (STOFFVec2< T > const &y) |
resets the maximum point | |
void | resizeFromMin (STOFFVec2< T > const &sz) |
resize the box keeping the minimum | |
void | resizeFromMax (STOFFVec2< T > const &sz) |
resize the box keeping the maximum | |
void | resizeFromCenter (STOFFVec2< T > const &sz) |
resize the box keeping the center | |
template<class U > | |
void | scale (U factor) |
scales all points of the box by factor | |
void | extend (T val) |
extends the bdbox by (val, val) keeping the center | |
STOFFBox2< T > | getUnion (STOFFBox2< T > const &box) const |
returns the union between this and box | |
STOFFBox2< T > | getIntersection (STOFFBox2< T > const &box) const |
returns the intersection between this and box | |
bool | operator== (STOFFBox2< T > const &p) const |
comparison operator== | |
bool | operator!= (STOFFBox2< T > const &p) const |
comparison operator!= | |
bool | operator< (STOFFBox2< T > const &p) const |
comparison operator< : fist sorts min by Y,X values then max extremity | |
int | cmp (STOFFBox2< T > const &p) const |
comparison function : fist sorts min by Y,X values then max extremity | |
Protected Attributes | |
STOFFVec2< T > | m_pt [2] |
the two extremities | |
Friends | |
std::ostream & | operator<< (std::ostream &o, STOFFBox2< T > const &f) |
print data in form X0xY0<->X1xY1 |
small class which defines a 2D Box
STOFFBox2< T >::STOFFBox2 | ( | STOFFVec2< T > | minPt = STOFFVec2<T>() , |
STOFFVec2< T > | maxPt = STOFFVec2<T>() |
||
) | [inline] |
constructor
generic constructor
the box center
Referenced by libstoff::rotateBoxFromCenter().
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==().
extends the bdbox by (val, val) keeping the center
STOFFBox2<T> STOFFBox2< T >::getIntersection | ( | STOFFBox2< T > const & | box | ) | const [inline] |
returns the intersection between this and box
STOFFBox2<T> STOFFBox2< T >::getUnion | ( | STOFFBox2< T > const & | box | ) | const [inline] |
returns the union between this and box
the maximum 2D point (in x and in y)
Referenced by STOFFTableInternal::Compare::Point::getPos().
the maximum 2D point (in x and in y)
the minimum 2D point (in x and in y)
Referenced by STOFFTableInternal::Compare::Point::getPos().
the minimum 2D point (in x and in y)
comparison operator!=
comparison operator< : fist sorts min by Y,X values then max extremity
comparison operator==
the two extremum points which defined the box
c | 0 means the minimum and 1 the maximum |
void STOFFBox2< T >::resizeFromCenter | ( | STOFFVec2< T > const & | sz | ) | [inline] |
resize the box keeping the center
void STOFFBox2< T >::resizeFromMax | ( | STOFFVec2< T > const & | sz | ) | [inline] |
resize the box keeping the maximum
void STOFFBox2< T >::resizeFromMin | ( | STOFFVec2< T > const & | sz | ) | [inline] |
resize the box keeping the minimum
scales all points of the box by factor
void STOFFBox2< T >::set | ( | STOFFVec2< T > const & | x, |
STOFFVec2< T > const & | y | ||
) | [inline] |
resets the data to minimum x and maximum y
resets the maximum point
resets the minimum point
the box size
Referenced by STOFFGraphicShape::addTo(), STOFFTableInternal::Compare::Point::getSize(), STOFFTableInternal::Compare::operator()(), operator<<(), StarObjectSmallGraphicInternal::SdrGraphicRect::send(), StarObjectSmallGraphicInternal::SdrGraphicCircle::send(), StarObjectSmallGraphicInternal::SdrGraphicGraph::send(), StarObjectSmallGraphicInternal::SdrGraphicOLE::send(), and StarObjectSmallGraphicInternal::SdrGraphicText::sendTextZone().
std::ostream& operator<< | ( | std::ostream & | o, |
STOFFBox2< T > const & | f | ||
) | [friend] |
print data in form X0xY0<->X1xY1
the two extremities
Referenced by STOFFBox2< int >::center(), STOFFBox2< int >::cmp(), STOFFBox2< int >::extend(), STOFFBox2< int >::getIntersection(), STOFFBox2< int >::getUnion(), STOFFBox2< int >::max(), STOFFBox2< int >::min(), STOFFBox2< int >::operator[](), STOFFBox2< int >::resizeFromCenter(), STOFFBox2< int >::resizeFromMax(), STOFFBox2< int >::resizeFromMin(), STOFFBox2< int >::scale(), STOFFBox2< int >::set(), STOFFBox2< int >::setMax(), STOFFBox2< int >::setMin(), STOFFBox2< int >::size(), and STOFFBox2< int >::STOFFBox2().