small class which defines a 2D Box More...
#include <libmwaw_internal.hxx>
Classes | |
struct | PosSizeLt |
internal struct used to create sorted map, sorted first min then max More... | |
Public Types | |
typedef std::map< Box2< T >, T, struct PosSizeLt > | Map |
map of Box2 | |
Public Member Functions | |
Box2 (Vec2< T > minPt=Vec2< T >(), Vec2< T > maxPt=Vec2< T >()) | |
constructor | |
template<class U > | |
Box2 (Box2< 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 | |
Box2< T > | getUnion (Box2< T > const &box) const |
returns the union between this and box | |
Box2< T > | getIntersection (Box2< T > const &box) const |
returns the intersection between this and box | |
bool | operator== (Box2< T > const &p) const |
comparison operator== | |
bool | operator!= (Box2< T > const &p) const |
comparison operator!= | |
bool | operator< (Box2< T > const &p) const |
comparison operator< : fist sorts min by Y,X values then max extremity | |
int | cmp (Box2< 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, Box2< T > const &f) |
print data in form X0xY0<->X1xY1 |
small class which defines a 2D Box
Box2< T >::Box2 | ( | Vec2< T > | minPt = Vec2<T>() , |
Vec2< T > | maxPt = Vec2<T>() |
||
) | [inline] |
constructor
generic constructor
the box center
Referenced by GWGraph::readFrameHeader(), CWGraph::readShape(), libmwaw::rotateBoxFromCenter(), and CWStyleManagerInternal::Gradient::update().
comparison function : fist sorts min by Y,X values then max extremity
Referenced by MWAWPict::cmp(), MWAWGraphicShape::cmp(), Box2< int >::operator!=(), Box2< T >::PosSizeLt::operator()(), Box2< int >::operator<(), and Box2< int >::operator==().
extends the bdbox by (val, val) keeping the center
Referenced by MWAWPict::getBdBox(), MWAWGraphicShape::getBdBox(), MSKGraphInternal::Zone::getLocalBox(), HMWKGraph::sendGroupChild(), and HMWJGraph::sendGroupChild().
Box2<T> Box2< T >::getIntersection | ( | Box2< T > const & | box | ) | const [inline] |
returns the intersection between this and box
returns the union between this and box
Referenced by MWAWGraphicShape::rotate(), CWGraph::sendGroup(), GWGraph::sendGroupChild(), HMWKGraph::sendGroupChild(), HMWJGraph::sendGroupChild(), MSKGraph::sendGroupChild(), and CWGraph::updateInformation().
the maximum 2D point (in x and in y)
Referenced by MWProStructuresInternal::Cell::Cell(), MSKGraph::getEntryPicture(), MWAWTableInternal::Compare::Point::getPos(), NSText::sendText(), MWAWGraphicShape::translate(), and WNTextInternal::TableData::updateCell().
the minimum 2D point (in x and in y)
Referenced by MWProStructuresInternal::Cell::Cell(), MSKGraph::getEntryPicture(), MSKGraphInternal::Zone::getLocalBox(), MWAWTableInternal::Compare::Point::getPos(), MSKGraphInternal::Zone::getPosition(), MWProStructuresInternal::Block::getPosition(), MSK3Parser::readGroupHeaderInfo(), NSGraph::sendPageGraphics(), NSGraph::sendPicture(), MSWParser::sendPicture(), NSText::sendText(), MWAWGraphicShape::translate(), and WNTextInternal::TableData::updateCell().
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 |
c | value 1 means the maximum |
void Box2< T >::resizeFromCenter | ( | Vec2< T > const & | sz | ) | [inline] |
resize the box keeping the center
void Box2< T >::resizeFromMax | ( | Vec2< T > const & | sz | ) | [inline] |
resize the box keeping the maximum
void Box2< T >::resizeFromMin | ( | Vec2< T > const & | sz | ) | [inline] |
resize the box keeping the minimum
scales all points of the box by factor
resets the data to minimum x and maximum y
Referenced by MWAWPictMac::checkOrGet(), libmwaw_applepict1::Region::read(), and libmwaw_applepict1::OpCode::readRect().
resets the maximum point
Referenced by MWAWTable::sendExtraLines().
resets the minimum point
Referenced by MWAWTable::sendExtraLines().
the box size
Referenced by MWAWGraphicListener::_handleFrameParameters(), MWAWPictMac::checkOrGet(), MCDParser::createZones(), MWAWPictData::get(), HMWKGraphInternal::Frame::getBdBox(), MWAWGraphicShape::getBdBox(), CWGraphInternal::Zone::getBdBox(), HMWJGraphInternal::Frame::getBdBox(), MSKGraph::getEntryPicture(), MSKGraphInternal::Zone::getLocalBox(), MSKGraphInternal::Zone::getPosition(), MWProStructuresInternal::Block::getPosition(), MWProStructuresInternal::Block::getRelativeYPos(), MWAWTableInternal::Compare::Point::getSize(), MWAWGraphicListener::insertPicture(), MWAWContentListener::insertPicture(), MWAWGraphicListener::insertTextBox(), MWAWTableInternal::Compare::operator()(), NSTextInternal::operator<<(), MRWParserInternal::operator<<(), operator<<(), libmwaw_applepict1::Bitmap::read(), libmwaw_applepict1::Pixmap::read(), libmwaw_applepict1::Bitmap::readBitmapData(), GWGraph::readFrameHeader(), MWParser::readGraphic(), WPParser::readGraphic(), MSK3Parser::readGroupHeaderInfo(), NSParser::readPageLimit(), libmwaw_applepict1::Pixmap::readPixmapData(), CWGraph::readShape(), HMWJGraph::readShapeGraph(), HMWKGraph::readShapeGraph(), libmwaw_applepict1::Bitmap::saveBitmap(), libmwaw_applepict1::Pixmap::savePixmap(), MSKGraph::send(), MWAWGraphicShape::send(), HMWJGraph::sendComment(), MWAWTable::sendExtraLines(), HMWJGraph::sendFrame(), HMWKGraph::sendFrame(), ACText::sendGraphic(), FWGraph::sendGraphic(), CWGraph::sendGroup(), HMWKGraph::sendGroup(), HMWJGraph::sendGroup(), GWGraph::sendGroupChild(), CWGraph::sendGroupChild(), HMWKGraph::sendGroupChild(), HMWJGraph::sendGroupChild(), MSKGraph::sendGroupChild(), NSGraph::sendPageGraphics(), HMWKGraph::sendPageGraphics(), HMWJGraph::sendPageGraphics(), LWGraph::sendPICT(), MCDParser::sendPicture(), EDParser::sendPicture(), NSGraph::sendPicture(), TTParser::sendPicture(), DMParser::sendPicture(), WNParser::sendPicture(), MSWParser::sendPicture(), CWGraph::sendPicture(), HMWKGraph::sendPictureFrame(), HMWJGraph::sendPictureFrame(), CWGraph::sendShape(), HMWKGraph::sendShapeGraph(), HMWJGraph::sendShapeGraph(), FWGraph::sendSideBar(), NSText::sendText(), HMWKGraph::sendTextBox(), HMWJGraph::sendTextbox(), GWGraph::sendTextboxAsGraphic(), MWAWGraphicListener::startGraphic(), and CWGraph::updateInformation().
std::ostream& operator<< | ( | std::ostream & | o, |
Box2< T > const & | f | ||
) | [friend] |
print data in form X0xY0<->X1xY1
the two extremities
Referenced by Box2< int >::Box2(), Box2< int >::center(), Box2< int >::cmp(), Box2< int >::extend(), Box2< int >::getIntersection(), Box2< int >::getUnion(), Box2< int >::max(), Box2< int >::min(), Box2< int >::operator[](), Box2< int >::resizeFromCenter(), Box2< int >::resizeFromMax(), Box2< int >::resizeFromMin(), Box2< int >::scale(), Box2< int >::set(), Box2< int >::setMax(), Box2< int >::setMin(), and Box2< int >::size().