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< MWAWBox2< T > , T, struct PosSizeLt > | Map |
map of MWAWBox2 More... | |
Public Member Functions | |
MWAWBox2 (MWAWVec2< T > minPt=MWAWVec2< T >(), MWAWVec2< T > maxPt=MWAWVec2< T >()) | |
constructor More... | |
template<class U > | |
MWAWBox2 (MWAWBox2< U > const &p) | |
generic constructor More... | |
MWAWVec2< T > const & | min () const |
the minimum 2D point (in x and in y) More... | |
MWAWVec2< T > const & | max () const |
the maximum 2D point (in x and in y) More... | |
MWAWVec2< T > & | min () |
the minimum 2D point (in x and in y) More... | |
MWAWVec2< T > & | max () |
the maximum 2D point (in x and in y) More... | |
MWAWVec2< T > const & | operator[] (int c) const |
the two extremum points which defined the box More... | |
MWAWVec2< T > | size () const |
the box size More... | |
MWAWVec2< T > | center () const |
the box center More... | |
void | set (MWAWVec2< T > const &x, MWAWVec2< T > const &y) |
resets the data to minimum x and maximum y More... | |
void | setMin (MWAWVec2< T > const &x) |
resets the minimum point More... | |
void | setMax (MWAWVec2< T > const &y) |
resets the maximum point More... | |
void | resizeFromMin (MWAWVec2< T > const &sz) |
resize the box keeping the minimum More... | |
void | resizeFromMax (MWAWVec2< T > const &sz) |
resize the box keeping the maximum More... | |
void | resizeFromCenter (MWAWVec2< 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... | |
MWAWBox2< T > | getUnion (MWAWBox2< T > const &box) const |
returns the union between this and box More... | |
MWAWBox2< T > | getIntersection (MWAWBox2< T > const &box) const |
returns the intersection between this and box More... | |
bool | operator== (MWAWBox2< T > const &p) const |
comparison operator== More... | |
bool | operator!= (MWAWBox2< T > const &p) const |
comparison operator!= More... | |
bool | operator< (MWAWBox2< T > const &p) const |
comparison operator< : fist sorts min by Y,X values then max extremity More... | |
int | cmp (MWAWBox2< T > const &p) const |
comparison function : fist sorts min by Y,X values then max extremity More... | |
Protected Attributes | |
MWAWVec2< T > | m_pt [2] |
the two extremities More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, MWAWBox2< T > const &f) |
print data in form X0xY0<->X1xY1 More... | |
small class which defines a 2D Box
|
inline |
constructor
generic constructor
the box center
Referenced by MacDraftParser::readObject(), SuperPaintParser::readShape(), ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), BeagleWksDRParser::readStyle(), libmwaw::rotateBoxFromCenter(), MacDraftParser::send(), MacDraftParserInternal::Shape::transform(), ClarisDrawStyleManagerInternal::Gradient::update(), and ClarisWksStyleManagerInternal::Gradient::update().
comparison function : fist sorts min by Y,X values then max extremity
Referenced by MWAWPict::cmp(), MWAWGraphicShape::cmp(), MWAWBox2< int >::operator!=(), MWAWBox2< T >::PosSizeLt::operator()(), MWAWBox2< int >::operator<(), and MWAWBox2< int >::operator==().
|
inline |
extends the bdbox by (val, val) keeping the center
Referenced by MWAWPict::getBdBox(), MWAWGraphicShape::getBdBox(), MsWksGraphInternal::Zone::getLocalBox(), HanMacWrdKGraph::sendGroupChild(), and HanMacWrdJGraph::sendGroupChild().
|
inline |
returns the intersection between this and box
returns the union between this and box
Referenced by MacDrawProParser::computeLayersAndLibrariesBoundingBox(), ClarisWksStruct::DSET::getUnionChildBox(), MacDraftParser::readObject(), MWAWGraphicShape::rotate(), MacDraftParserInternal::Shape::rotateBox(), MacDraftParser::sendBitmap(), ClarisWksGraph::sendGroup(), GreatWksGraph::sendGroupChild(), HanMacWrdKGraph::sendGroupChild(), HanMacWrdJGraph::sendGroupChild(), MsWksGraph::sendGroupChild(), and ClarisWksStruct::DSET::updateChildPositions().
the maximum 2D point (in x and in y)
Referenced by MacWrtProStructuresInternal::Cell::Cell(), MsWksGraph::getEntryPicture(), MWAWTableInternal::Compare::Point::getPos(), MWAWGraphicShape::scale(), NisusWrtText::sendText(), MWAWGraphicShape::translate(), and WriteNowTextInternal::TableData::updateCell().
the minimum 2D point (in x and in y)
Referenced by MacWrtProStructuresInternal::Cell::Cell(), MsWksGraph::getEntryPicture(), MsWksGraphInternal::Zone::getLocalBox(), MWAWTableInternal::Compare::Point::getPos(), MsWksGraphInternal::Zone::getPosition(), MacWrtProStructuresInternal::Block::getPosition(), MsWksDocument::readGroupHeaderFooter(), MWAWGraphicShape::scale(), NisusWrtGraph::sendPageGraphics(), NisusWrtGraph::sendPicture(), MsWrdParser::sendPicture(), NisusWrtText::sendText(), MWAWGraphicShape::translate(), and WriteNowTextInternal::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 | 0 means the minimum and 1 the maximum |
resize the box keeping the center
Referenced by ClarisDrawGraph::readShape().
resize the box keeping the maximum
resize the box keeping the minimum
scales all points of the box by factor
|
inline |
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 MacDrawProParser::computeLayersAndLibrariesBoundingBox(), BeagleWksSSParser::readChart(), RagTimeParser::readDataZoneHeader(), and MWAWTable::sendExtraLines().
resets the minimum point
Referenced by BeagleWksSSParser::readChart(), RagTimeParser::readDataZoneHeader(), and MWAWTable::sendExtraLines().
the box size
Referenced by MWAWGraphicShape::addTo(), MWAWPictMac::checkOrGet(), MacDrawProParser::computeLayersAndLibrariesBoundingBox(), MacDocParser::createZones(), RagTimeParser::createZones(), ClarisWksStruct::DSET::findForbiddenPagesBreaking(), ClarisWksGraph::findMasterPage(), MWAWPictData::get(), HanMacWrdKGraphInternal::Frame::getBdBox(), ClarisWksStruct::DSET::getBdBox(), MWAWGraphicShape::getBdBox(), ClarisWksStruct::DSET::Child::getBdBox(), ClarisWksGraphInternal::Zone::getBdBox(), ClarisDrawGraphInternal::Zone::getBdBox(), HanMacWrdJGraphInternal::Frame::getBdBox(), MsWksGraph::getEntryPicture(), MsWksGraphInternal::Zone::getLocalBox(), MsWksGraphInternal::Zone::getPosition(), MacWrtProStructuresInternal::Block::getPosition(), MacWrtProStructuresInternal::Block::getRelativeYPos(), MWAWTableInternal::Compare::Point::getSize(), MWAWTextListener::insertPicture(), MWAWGraphicListener::MWAWGraphicListener(), MWAWSpreadsheetListener::MWAWSpreadsheetListener(), MacDraftParserInternal::BitmapFileData::ok(), MWAWTableInternal::Compare::operator()(), NisusWrtTextInternal::operator<<(), BeagleWksDRParserInternal::operator<<(), MarinerWrtParserInternal::operator<<(), ClarisWksStruct::operator<<(), operator<<(), libmwaw_applepict1::Bitmap::read(), libmwaw_applepict1::Pixmap::read(), MacDraftParser::readBitmapData(), libmwaw_applepict1::Bitmap::readBitmapData(), GreatWksGraph::readFrameHeader(), MacWrtParser::readGraphic(), WriterPlsParser::readGraphic(), MsWksDocument::readGroupHeaderFooter(), NisusWrtParser::readPageLimit(), libmwaw_applepict1::Pixmap::readPixmapData(), SuperPaintParser::readShape(), ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), BeagleWksDRParser::readStyle(), libmwaw_applepict1::Bitmap::saveBitmap(), libmwaw_applepict1::Pixmap::savePixmap(), MacDrawParser::send(), MsWksGraph::send(), MacDraftParser::send(), RagTimeParser::send(), MacDrawProParser::send(), MacDrawParser::sendBitmap(), MacDraftParser::sendBitmap(), MacDrawProParser::sendBitmap(), HanMacWrdJGraph::sendComment(), MWAWTable::sendExtraLines(), HanMacWrdJGraph::sendFrame(), HanMacWrdKGraph::sendFrame(), ActaText::sendGraphic(), FullWrtGraph::sendGraphic(), ClarisDrawGraph::sendGroup(), GreatWksGraph::sendGroup(), ClarisWksGraph::sendGroup(), HanMacWrdKGraph::sendGroup(), HanMacWrdJGraph::sendGroup(), MsWksGraph::sendGroup(), GreatWksGraph::sendGroupChild(), ClarisWksGraph::sendGroupChild(), HanMacWrdKGraph::sendGroupChild(), HanMacWrdJGraph::sendGroupChild(), MsWksGraph::sendGroupChild(), ClarisDrawGraph::sendMainGroupChild(), ClarisWksGraph::sendPageChild(), NisusWrtGraph::sendPageGraphics(), HanMacWrdKGraph::sendPageGraphics(), HanMacWrdJGraph::sendPageGraphics(), LightWayTxtGraph::sendPICT(), MacDocParser::sendPicture(), EDocParser::sendPicture(), NisusWrtGraph::sendPicture(), TeachTxtParser::sendPicture(), DocMkrParser::sendPicture(), WriteNowParser::sendPicture(), MsWrdParser::sendPicture(), ClarisWksGraph::sendPicture(), HanMacWrdKGraph::sendPictureFrame(), HanMacWrdJGraph::sendPictureFrame(), SuperPaintParser::sendPictures(), BeagleWksDRParser::sendPictures(), ClarisDrawGraph::sendShape(), ClarisWksGraph::sendShape(), HanMacWrdJGraph::sendShapeGraph(), HanMacWrdKGraph::sendShapeGraph(), FullWrtGraph::sendSideBar(), NisusWrtText::sendText(), HanMacWrdKGraph::sendTextBox(), HanMacWrdJGraph::sendTextbox(), GreatWksGraph::sendTextboxAsGraphic(), and ClarisWksStruct::DSET::updateChildPositions().
|
friend |
print data in form X0xY0<->X1xY1
the two extremities
Referenced by MWAWBox2< int >::center(), MWAWBox2< int >::cmp(), MWAWBox2< int >::extend(), MWAWBox2< int >::getIntersection(), MWAWBox2< int >::getUnion(), MWAWBox2< int >::max(), MWAWBox2< int >::min(), MWAWBox2< int >::MWAWBox2(), MWAWBox2< int >::operator[](), MWAWBox2< int >::resizeFromCenter(), MWAWBox2< int >::resizeFromMax(), MWAWBox2< int >::resizeFromMin(), MWAWBox2< int >::scale(), MWAWBox2< int >::set(), MWAWBox2< int >::setMax(), MWAWBox2< int >::setMin(), and MWAWBox2< int >::size().