Box2< T > Class Template Reference documentation

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Box2< T > Class Template Reference

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 More...

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

## Protected Attributes
Vec2< T > | m_pt [2]
| the two extremities More...

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

## Detailed Description

### template<class T>
class Box2< T >

small class which defines a 2D Box

## Member Typedef Documentation

template<class T>

Box2< T >::Map

map of Box2

## Constructor & Destructor Documentation

template<class T>

Box2< T >::Box2 | ( | Vec2< T > | minPt = `Vec2<T>()`,
|  | Vec2< T > | maxPt = `Vec2<T>()`
| ) |  |
| inline

constructor

template<class T>
template<class U >

Box2< T >::Box2 | ( | Box2< U > const & | p | ) |
| inline

generic constructor

## Member Function Documentation

template<class T>

Vec2<T> Box2< T >::center | ( |  | ) | const
| inline

the box center

Referenced by SuperPaintParser::readShape(), ClarisWksGraph::readShape(), BeagleWksDRParser::readStyle(), libmwaw::rotateBoxFromCenter(), and ClarisWksStyleManagerInternal::Gradient::update().

template<class T>

int Box2< T >::cmp | ( | Box2< T > const & | p | ) | const
| inline

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==().

template<class T>

void Box2< T >::extend | ( | T | val | ) |
| inline

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

Referenced by MWAWPict::getBdBox(), MWAWGraphicShape::getBdBox(), MsWksGraphInternal::Zone::getLocalBox(), HanMacWrdKGraph::sendGroupChild(), and HanMacWrdJGraph::sendGroupChild().

template<class T>

Box2<T> Box2< T >::getIntersection | ( | Box2< T > const & | box | ) | const
| inline

returns the intersection between this and box

template<class T>

Box2<T> Box2< T >::getUnion | ( | Box2< T > const & | box | ) | const
| inline

returns the union between this and box

Referenced by MacDrawProParser::computeLayersAndLibrariesBoundingBox(), ClarisWksStruct::DSET::getUnionChildBox(), MWAWGraphicShape::rotate(), ClarisWksGraph::sendGroup(), GreatWksGraph::sendGroupChild(), HanMacWrdKGraph::sendGroupChild(), HanMacWrdJGraph::sendGroupChild(), MsWksGraph::sendGroupChild(), and ClarisWksStruct::DSET::updateChildPositions().

template<class T>

Vec2<T> const& Box2< T >::max | ( |  | ) | const
| inline

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().

template<class T>

Vec2<T>& Box2< T >::max | ( |  | ) |
| inline

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

template<class T>

Vec2<T> const& Box2< T >::min | ( |  | ) | const
| inline

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().

template<class T>

Vec2<T>& Box2< T >::min | ( |  | ) |
| inline

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

template<class T>

bool Box2< T >::operator!= | ( | Box2< T > const & | p | ) | const
| inline

comparison operator!=

template<class T>

bool Box2< T >::operator< | ( | Box2< T > const & | p | ) | const
| inline

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

template<class T>

bool Box2< T >::operator== | ( | Box2< T > const & | p | ) | const
| inline

comparison operator==

template<class T>

Vec2<T> const& Box2< T >::operator[] | ( | int | c | ) | const
| inline

the two extremum points which defined the box

Parameters

  c | 0 means the minimum and 1 the maximum

template<class T>

void Box2< T >::resizeFromCenter | ( | Vec2< T > const & | sz | ) |
| inline

resize the box keeping the center

template<class T>

void Box2< T >::resizeFromMax | ( | Vec2< T > const & | sz | ) |
| inline

resize the box keeping the maximum

template<class T>

void Box2< T >::resizeFromMin | ( | Vec2< T > const & | sz | ) |
| inline

resize the box keeping the minimum

template<class T>
template<class U >

void Box2< T >::scale | ( | U | factor | ) |
| inline

scales all points of the box by factor

template<class T>

void Box2< T >::set | ( | Vec2< T > const & | x,
|  | Vec2< T > const & | y
| ) |  |
| inline

resets the data to minimum x and maximum y

Referenced by MWAWPictMac::checkOrGet(), libmwaw_applepict1::Region::read(), and libmwaw_applepict1::OpCode::readRect().

template<class T>

void Box2< T >::setMax | ( | Vec2< T > const & | y | ) |
| inline

resets the maximum point

Referenced by MacDrawProParser::computeLayersAndLibrariesBoundingBox(), BeagleWksSSParser::readChart(), RagTimeParser::readDataZoneHeader(), and MWAWTable::sendExtraLines().

template<class T>

void Box2< T >::setMin | ( | Vec2< T > const & | x | ) |
| inline

resets the minimum point

Referenced by BeagleWksSSParser::readChart(), RagTimeParser::readDataZoneHeader(), and MWAWTable::sendExtraLines().

template<class T>

Vec2<T> Box2< T >::size | ( |  | ) | const
| inline

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(), 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(), MWAWTableInternal::Compare::operator()(), NisusWrtTextInternal::operator<<(), BeagleWksDRParserInternal::operator<<(), MarinerWrtParserInternal::operator<<(), ClarisWksStruct::operator<<(), operator<<(), libmwaw_applepict1::Bitmap::read(), libmwaw_applepict1::Pixmap::read(), libmwaw_applepict1::Bitmap::readBitmapData(), GreatWksGraph::readFrameHeader(), MacWrtParser::readGraphic(), WriterPlsParser::readGraphic(), MsWksDocument::readGroupHeaderFooter(), NisusWrtParser::readPageLimit(), libmwaw_applepict1::Pixmap::readPixmapData(), SuperPaintParser::readShape(), ClarisWksGraph::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), BeagleWksDRParser::readStyle(), libmwaw_applepict1::Bitmap::saveBitmap(), libmwaw_applepict1::Pixmap::savePixmap(), MacDrawParser::send(), MsWksGraph::send(), RagTimeParser::send(), MacDrawProParser::send(), MacDrawParser::sendBitmap(), MacDrawProParser::sendBitmap(), HanMacWrdJGraph::sendComment(), MWAWTable::sendExtraLines(), HanMacWrdKGraph::sendFrame(), HanMacWrdJGraph::sendFrame(), ActaText::sendGraphic(), FullWrtGraph::sendGraphic(), GreatWksGraph::sendGroup(), ClarisWksGraph::sendGroup(), HanMacWrdKGraph::sendGroup(), HanMacWrdJGraph::sendGroup(), MsWksGraph::sendGroup(), GreatWksGraph::sendGroupChild(), ClarisWksGraph::sendGroupChild(), HanMacWrdKGraph::sendGroupChild(), HanMacWrdJGraph::sendGroupChild(), MsWksGraph::sendGroupChild(), 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(), ClarisWksGraph::sendShape(), HanMacWrdKGraph::sendShapeGraph(), HanMacWrdJGraph::sendShapeGraph(), FullWrtGraph::sendSideBar(), NisusWrtText::sendText(), HanMacWrdKGraph::sendTextBox(), HanMacWrdJGraph::sendTextbox(), GreatWksGraph::sendTextboxAsGraphic(), and ClarisWksStruct::DSET::updateChildPositions().

## Friends And Related Function Documentation

template<class T>

std::ostream& operator<< | ( | std::ostream & | o,
|  | Box2< T > const & | f
| ) |  |
| friend

print data in form X0xY0<->X1xY1

## Member Data Documentation

template<class T>

Vec2<T> Box2< T >::m_pt[2]
| protected

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().

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

- libmwaw_internal.hxx