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 | |
Public Member Functions | |
WPSBox2 (Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >()) | |
constructor | |
template<class U > | |
WPSBox2 (WPSBox2< U > const &p) | |
generic constructor | |
Vec2< T > const & | min () const |
the minimum 2D point (in x and in y) | |
Vec2< T > const & | max () const |
the maximum 2D point (in x and in y) | |
Vec2< T > & | min () |
the minimum 2D point (in x and in y) | |
Vec2< T > & | max () |
the maximum 2D point (in x and in y) | |
Vec2< T > const & | operator[] (int c) const |
the two extremum points which defined the box | |
Vec2< T > | size () const |
the box size | |
Vec2< T > | center () const |
the box center | |
void | set (Vec2< T > const &x, Vec2< T > const &y) |
resets the data to minimum x and maximum y | |
void | setMin (Vec2< T > const &x) |
resets the minimum point | |
void | setMax (Vec2< T > const &y) |
resets the maximum point | |
void | resizeFromMin (Vec2< T > const &sz) |
resize the box keeping the minimum | |
void | resizeFromMax (Vec2< T > const &sz) |
resize the box keeping the maximum | |
void | resizeFromCenter (Vec2< 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 | |
WPSBox2< T > | getUnion (WPSBox2< T > const &box) const |
returns the union between this and box | |
WPSBox2< T > | getIntersection (WPSBox2< T > const &box) const |
returns the intersection between this and box | |
bool | operator== (WPSBox2< T > const &p) const |
comparison operator== | |
bool | operator!= (WPSBox2< T > const &p) const |
comparison operator!= | |
bool | operator< (WPSBox2< T > const &p) const |
comparison operator< : fist sorts min by Y,X values then max extremity | |
int | cmp (WPSBox2< T > const &p) const |
comparison function : fist sorts min by Y,X values then max extremity | |
Protected Attributes | |
Vec2< T > | m_pt [2] |
the two extremities | |
Friends | |
std::ostream & | operator<< (std::ostream &o, WPSBox2< T > const &f) |
print data in form X0xY0<->X1xY1 | |
constructor
the box center
Referenced by WPSGraphicShape::getPath(), and LotusGraphInternal::ZonePc::getTransformation().
comparison function : fist sorts min by Y,X values then max extremity
Referenced by WPSGraphicShape::cmp(), WPSBox2< T >::operator!=(), WPSBox2< T >::operator<(), and WPSBox2< T >::operator==().
extends the bdbox by (val, val) keeping the center
returns the intersection between this and box
returns the union between this and box
Referenced by Quattro9GraphInternal::Shape::getBdBox(), LotusGraph::readGraphic(), and Quattro9Graph::readShapeRec().
the maximum 2D point (in x and in y)
Referenced by WPSCell::Compare::Point::getPos(), WPSTransformation::operator*(), WPSGraphicShape::scale(), and WPSGraphicShape::translate().
the minimum 2D point (in x and in y)
Referenced by WPSCell::Compare::Point::getPos(), WPSTransformation::operator*(), WPSGraphicShape::scale(), and WPSGraphicShape::translate().
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 | value 0 means the minimum, value 1 means the maximum |
resize the box keeping the center
resize the box keeping the maximum
resize the box keeping the minimum
scales all points of the box by factor
resets the data to minimum x and maximum y
resets the maximum point
Referenced by XYWriteParserInternal::Format::readBox2f().
resets the minimum point
Referenced by XYWriteParserInternal::Format::readBox2f().
the box size
Referenced by WPSGraphicShape::addTo(), Quattro9GraphInternal::Shape::getBdBox(), LotusGraphInternal::ZoneMac::getGraphicShape(), LotusGraphInternal::ZonePc::getGraphicShape(), WPSGraphicShape::getPath(), WPSCell::Compare::Point::getSize(), XYWriteParser::parsePictureZone(), and WKSChart::sendChart().
|
friend |
print data in form X0xY0<->X1xY1
the two extremities
Referenced by WPSBox2< T >::center(), WPSBox2< T >::cmp(), WPSBox2< T >::extend(), WPSBox2< T >::getIntersection(), WPSBox2< T >::getUnion(), WPSBox2< T >::max(), WPSBox2< T >::max(), WPSBox2< T >::min(), WPSBox2< T >::min(), WPSBox2< T >::operator[](), WPSBox2< T >::resizeFromCenter(), WPSBox2< T >::resizeFromMax(), WPSBox2< T >::resizeFromMin(), WPSBox2< T >::scale(), WPSBox2< T >::set(), WPSBox2< T >::setMax(), WPSBox2< T >::setMin(), WPSBox2< T >::size(), and WPSBox2< T >::WPSBox2().