MWAWBox2< T > Class Template Reference

small class which defines a 2D Box More...

#include <libmwaw_internal.hxx>

Public Member Functions

 MWAWBox2 (MWAWVec2< T > minPt=MWAWVec2< T >(), MWAWVec2< T > maxPt=MWAWVec2< T >())
 constructor
 
template<class U>
 MWAWBox2 (MWAWBox2< U > const &p)
 generic constructor
 
MWAWVec2< T > const & min () const
 the minimum 2D point (in x and in y)
 
MWAWVec2< T > const & max () const
 the maximum 2D point (in x and in y)
 
MWAWVec2< T > & min ()
 the minimum 2D point (in x and in y)
 
MWAWVec2< T > & max ()
 the maximum 2D point (in x and in y)
 
MWAWVec2< T > const & operator[] (int c) const
 the two extremum points which defined the box
 
MWAWVec2< T > size () const
 the box size
 
MWAWVec2< T > center () const
 the box center
 
void set (MWAWVec2< T > const &x, MWAWVec2< T > const &y)
 resets the data to minimum x and maximum y
 
void setMin (MWAWVec2< T > const &x)
 resets the minimum point
 
void setMax (MWAWVec2< T > const &y)
 resets the maximum point
 
void resizeFromMin (MWAWVec2< T > const &sz)
 resize the box keeping the minimum
 
void resizeFromMax (MWAWVec2< T > const &sz)
 resize the box keeping the maximum
 
void resizeFromCenter (MWAWVec2< 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
 
MWAWBox2< T > getUnion (MWAWBox2< T > const &box) const
 returns the union between this and box
 
MWAWBox2< T > getIntersection (MWAWBox2< T > const &box) const
 returns the intersection between this and box
 
bool operator== (MWAWBox2< T > const &mat) const
 operator==
 
bool operator!= (MWAWBox2< T > const &mat) const
 operator!=
 
bool operator< (MWAWBox2< T > const &mat) const
 operator<
 
bool operator<= (MWAWBox2< T > const &mat) const
 operator<=
 
bool operator> (MWAWBox2< T > const &mat) const
 operator>
 
bool operator>= (MWAWBox2< T > const &mat) const
 operator>=
 

Protected Attributes

std::pair< MWAWVec2< T >, MWAWVec2< T > > m_data
 the data
 

Friends

std::ostream & operator<< (std::ostream &o, MWAWBox2< T > const &f)
 print data in form X0xY0<->X1xY1
 

Detailed Description

template<class T>
class MWAWBox2< T >

small class which defines a 2D Box

Constructor & Destructor Documentation

◆ MWAWBox2() [1/2]

template<class T>
MWAWBox2< T >::MWAWBox2 ( MWAWVec2< T > minPt = MWAWVec2<T>(),
MWAWVec2< T > maxPt = MWAWVec2<T>() )
inlineexplicit

constructor

◆ MWAWBox2() [2/2]

template<class T>
template<class U>
MWAWBox2< T >::MWAWBox2 ( MWAWBox2< U > const & p)
inlineexplicit

generic constructor

Member Function Documentation

◆ center()

◆ extend()

template<class T>
void MWAWBox2< T >::extend ( T val)
inline

◆ getIntersection()

template<class T>
MWAWBox2< T > MWAWBox2< T >::getIntersection ( MWAWBox2< T > const & box) const
inline

returns the intersection between this and box

Referenced by ApplePictParser::drawRectangle().

◆ getUnion()

◆ max() [1/2]

template<class T>
MWAWVec2< T > & MWAWBox2< T >::max ( )
inline

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

◆ max() [2/2]

◆ min() [1/2]

template<class T>
MWAWVec2< T > & MWAWBox2< T >::min ( )
inline

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

◆ min() [2/2]

◆ operator!=()

template<class T>
bool MWAWBox2< T >::operator!= ( MWAWBox2< T > const & mat) const
inline

operator!=

◆ operator<()

template<class T>
bool MWAWBox2< T >::operator< ( MWAWBox2< T > const & mat) const
inline

operator<

◆ operator<=()

template<class T>
bool MWAWBox2< T >::operator<= ( MWAWBox2< T > const & mat) const
inline

operator<=

◆ operator==()

template<class T>
bool MWAWBox2< T >::operator== ( MWAWBox2< T > const & mat) const
inline

operator==

◆ operator>()

template<class T>
bool MWAWBox2< T >::operator> ( MWAWBox2< T > const & mat) const
inline

operator>

◆ operator>=()

template<class T>
bool MWAWBox2< T >::operator>= ( MWAWBox2< T > const & mat) const
inline

operator>=

◆ operator[]()

template<class T>
MWAWVec2< T > const & MWAWBox2< T >::operator[] ( int c) const
inline

the two extremum points which defined the box

Parameters
c0 means the minimum and 1 the maximum

◆ resizeFromCenter()

template<class T>
void MWAWBox2< T >::resizeFromCenter ( MWAWVec2< T > const & sz)
inline

resize the box keeping the center

Referenced by Canvas5Graph::sendSpecial().

◆ resizeFromMax()

template<class T>
void MWAWBox2< T >::resizeFromMax ( MWAWVec2< T > const & sz)
inline

resize the box keeping the maximum

◆ resizeFromMin()

template<class T>
void MWAWBox2< T >::resizeFromMin ( MWAWVec2< T > const & sz)
inline

resize the box keeping the minimum

◆ scale()

template<class T>
template<class U>
void MWAWBox2< T >::scale ( U factor)
inline

scales all points of the box by factor

◆ set()

template<class T>
void MWAWBox2< T >::set ( MWAWVec2< T > const & x,
MWAWVec2< T > const & y )
inline

resets the data to minimum x and maximum y

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

◆ setMax()

template<class T>
void MWAWBox2< T >::setMax ( MWAWVec2< T > const & y)
inline

◆ setMin()

template<class T>
void MWAWBox2< T >::setMin ( MWAWVec2< T > const & x)
inline

◆ size()

template<class T>
MWAWVec2< T > MWAWBox2< T >::size ( ) const
inline

the box size

Referenced by ApplePictParser::checkHeader(), MWAWPictMac::checkOrGet(), MacDocParser::createZones(), ApplePictParser::drawBitmap(), ClarisWksStruct::DSET::findForbiddenPagesBreaking(), ClarisWksGraph::findMasterPage(), MWAWPictData::get(), CanvasGraph::getBitmap(), DrawTableParser::getBitmap(), CanvasGraph::getBitmapBW(), MsWksGraph::getEntryPicture(), MWAWGraphicShape::getPath(), MsWksGraphInternal::Zone::getPosition(), MWAWTextListener::insertShape(), MWAWGraphicListener::MWAWGraphicListener(), MWAWSpreadsheetListener::MWAWSpreadsheetListener(), MWAWTableInternal::Compare::operator()(), BeagleWksDRParserInternal::Shape::operator<<, ClarisWksStruct::DSET::Child::operator<<, ClarisWksStruct::DSET::operator<<, MarinerWrtParserInternal::Zone::operator<<, MWAWCell::operator<<, MWAWChart::Axis::operator<<, NisusWrtTextInternal::Font::operator<<, NisusWrtTextInternal::PicturePara::operator<<, WriteNowTextInternal::TableData::operator<<, WriteNowTextInternal::Token::operator<<, libmwaw_applepict1::Bitmap::read(), ApplePictParser::readBitmap(), MacDrawProParser::readBitmap(), MacDraftParser::readBitmapData(), PowerPoint1Parser::readDocInfo(), PowerPoint3Parser::readDocInfo(), GreatWksGraph::readFrameHeader(), MacWrtParser::readGraphic(), MindWrtParser::readGraphic(), WriterPlsParser::readGraphic(), MsWksDocument::readGroupHeaderFooter(), MacDraftParser::readObject(), MacDrawParser::readObject(), NisusWrtParser::readPageLimit(), ApplePictParser::readPixmap(), ClarisDrawGraph::readShape(), ClarisWksGraph::readShape(), SuperPaintParser::readShape(), HanMacWrdJGraph::readShapeGraph(), HanMacWrdKGraph::readShapeGraph(), BeagleWksDRParser::readStyle(), Canvas5Graph::send(), Canvas5Image::send(), Canvas5Image::send(), CanvasGraph::send(), CricketDrawParser::send(), MacDraft5Parser::send(), MacDraftParser::send(), MacDrawParser::send(), MacDrawProParser::send(), MsWksGraph::send(), RagTime5Graph::send(), ReadySetGoGraph::send(), ScoopParser::send(), ScriptWriterParser::send(), CricketDrawParser::sendAll(), CricketDrawParser::sendBitmap(), MacDraftParser::sendBitmap(), MacDrawParser::sendBitmap(), MacDrawProParser::sendBitmap(), HanMacWrdJGraph::sendComment(), Canvas5Graph::sendDimension(), CanvasGraph::sendDimension(), MWAWTable::sendExtraLines(), HanMacWrdJGraph::sendFrame(), HanMacWrdKGraph::sendFrame(), PowerPoint1Parser::sendFrame(), PowerPoint3Parser::sendFrame(), PowerPoint7Graph::sendFrame(), SpringBoardParser::sendFrame(), Canvas5Graph::sendGIF(), ActaText::sendGraphic(), FullWrtGraph::sendGraphic(), ClarisDrawGraph::sendGroup(), ClarisWksGraph::sendGroup(), GreatWksGraph::sendGroup(), HanMacWrdJGraph::sendGroup(), HanMacWrdKGraph::sendGroup(), ClarisWksGraph::sendGroupChild(), ClarisWksGraph::sendGroupChild(), GreatWksGraph::sendGroupChild(), HanMacWrdJGraph::sendGroupChild(), HanMacWrdKGraph::sendGroupChild(), MsWksGraph::sendGroupChild(), ClarisDrawGraph::sendMainGroupChild(), MouseWrtParser::sendMainZone(), CanvasGraph::sendMultiLines(), ClarisWksGraph::sendPageChild(), NisusWrtGraph::sendPageGraphics(), LightWayTxtGraph::sendPICT(), ClarisWksGraph::sendPicture(), DocMkrParser::sendPicture(), EDocParser::sendPicture(), FreeHandParser::sendPicture(), MacDocParser::sendPicture(), TeachTxtParser::sendPicture(), WordMakerParser::sendPicture(), WriteNowParser::sendPicture(), HanMacWrdJGraph::sendPictureFrame(), HanMacWrdKGraph::sendPictureFrame(), BeagleWksDRParser::sendPictures(), ClarisDrawGraph::sendShape(), ClarisWksGraph::sendShape(), DrawTableParser::sendShape(), FreeHandParser::sendShape(), HanMacWrdJGraph::sendShapeGraph(), HanMacWrdKGraph::sendShapeGraph(), FullWrtGraph::sendSideBar(), Canvas5Graph::sendSpecial(), CanvasGraph::sendSpecial(), Canvas5Graph::sendTechnical(), MoreText::sendText(), NisusWrtText::sendText(), HanMacWrdKGraph::sendTextBox(), FreeHandParser::sendTextbox(), HanMacWrdJGraph::sendTextbox(), GreatWksGraph::sendTextboxAsGraphic(), ApplePictParserInternal::State::updatePosition(), PowerPoint3ParserInternal::Polygon::updateShape(), PowerPoint7GraphInternal::FrameArc::updateShape(), and PowerPoint7GraphInternal::FramePolygon::updateShape().

Friends And Related Symbol Documentation

◆ operator<<

template<class T>
std::ostream & operator<< ( std::ostream & o,
MWAWBox2< T > const & f )
friend

print data in form X0xY0<->X1xY1

Member Data Documentation

◆ m_data


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

Generated on Wed May 3 2023 07:18:29 for libmwaw by doxygen 1.13.2