MWAWVec2< T > Class Template Reference

small class which defines a vector with 2 elements More...

`#include <libmwaw_internal.hxx>`

## Classes

struct | PosSizeLtX
| internal struct used to create sorted map, sorted by X More...
struct | PosSizeLtY
| internal struct used to create sorted map, sorted by Y More...

## Public Types

typedef std::map< MWAWVec2< T >, T, struct PosSizeLtX > | MapX
| map of MWAWVec2
typedef std::map< MWAWVec2< T >, T, struct PosSizeLtY > | MapY
| map of MWAWVec2

## Public Member Functions

| MWAWVec2 (T xx=0, T yy=0)
| constructor
template<class U>
| MWAWVec2 (MWAWVec2< U > const &p)
| generic copy constructor
T | x () const
| first element
T | y () const
| second element
T | operator[] (int c) const
| operator[]
T & | operator[] (int c)
| operator[]
void | set (T xx, T yy)
| resets the two elements
void | setX (T xx)
| resets the first element
void | setY (T yy)
| resets the second element
void | add (T dx, T dy)
| increases the actuals values by dx and dy
MWAWVec2< T > & | operator+= (MWAWVec2< T > const &p)
| operator+=
MWAWVec2< T > & | operator-= (MWAWVec2< T > const &p)
| operator-=
template<class U>
MWAWVec2< T > & | operator*= (U scale)
| generic operator*=
bool | operator== (MWAWVec2< T > const &p) const
| comparison==
bool | operator!= (MWAWVec2< T > const &p) const
| comparison!=
bool | operator< (MWAWVec2< T > const &p) const
| comparison<: sort by y
int | cmp (MWAWVec2< T > const &p) const
| a comparison function: which first compares x then y
int | cmpY (MWAWVec2< T > const &p) const
| a comparison function: which first compares y then x

## Protected Attributes

T | m_x
| first element
T | m_y
| second element

## Friends

MWAWVec2< T > | operator+ (MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
| operator+
MWAWVec2< T > | operator- (MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
| operator-
template<class U>
MWAWVec2< T > | operator* (U scale, MWAWVec2< T > const &p1)
| generic operator*
std::ostream & | operator<< (std::ostream &o, MWAWVec2< T > const &f)
| operator<<: prints data in form "XxY"

## Detailed Description

template<class T>
class MWAWVec2< T >

small class which defines a vector with 2 elements

## Member Typedef Documentation

## MapX

template<class T>

typedef std::map<MWAWVec2<T>, T,struct PosSizeLtX> MWAWVec2< T >::MapX

map of MWAWVec2

## MapY

template<class T>

typedef std::map<MWAWVec2<T>, T,struct PosSizeLtY> MWAWVec2< T >::MapY

map of MWAWVec2

## Constructor & Destructor Documentation

## MWAWVec2() [1/2]

template<class T>

MWAWVec2< T >::MWAWVec2 | ( | T | xx = 0,
|  | T | yy = 0 )

inline explicit

constructor

Referenced by MWAWVec2< T >::PosSizeLtX::operator()(), and MWAWVec2< T >::PosSizeLtY::operator()().

## MWAWVec2() [2/2]

template<class T>
template<class U>

MWAWVec2< T >::MWAWVec2 | ( | MWAWVec2< U > const & | p | ) |

inline explicit

generic copy constructor

## Member Function Documentation

## add()

template<class T>

void MWAWVec2< T >::add | ( | T | dx,
|  | T | dy )

inline

increases the actuals values by dx and dy

Referenced by MWAWVec2< bool >::operator+=(), and MWAWVec2< bool >::operator-=().

## cmp()

template<class T>

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

inline

a comparison function: which first compares x then y

Referenced by MWAWVec2< T >::PosSizeLtX::operator()().

## cmpY()

template<class T>

int MWAWVec2< T >::cmpY | ( | MWAWVec2< T > const & | p | ) | const

inline

a comparison function: which first compares y then x

Referenced by MWAWVec2< bool >::operator!=(), MWAWVec2< T >::PosSizeLtY::operator()(), MWAWVec2< bool >::operator<(), and MWAWVec2< bool >::operator==().

## operator!=()

template<class T>

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

inline

comparison!=

## operator*=()

template<class T>
template<class U>

MWAWVec2< T > & MWAWVec2< T >::operator*= | ( | U | scale | ) |

inline

generic operator*=

## operator+=()

template<class T>

MWAWVec2< T > & MWAWVec2< T >::operator+= | ( | MWAWVec2< T > const & | p | ) |

inline

operator+=

## operator-=()

template<class T>

MWAWVec2< T > & MWAWVec2< T >::operator-= | ( | MWAWVec2< T > const & | p | ) |

inline

operator-=

## operator<()

template<class T>

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

inline

comparison<: sort by y

## operator==()

template<class T>

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

inline

comparison==

## operator[]() [1/2]

template<class T>

T & MWAWVec2< T >::operator[] | ( | int | c | ) |

inline

operator[]

## operator[]() [2/2]

template<class T>

T MWAWVec2< T >::operator[] | ( | int | c | ) | const

inline

operator[]

## set()

template<class T>

void MWAWVec2< T >::set | ( | T | xx,
|  | T | yy )

inline

resets the two elements

Referenced by libmwaw_applepict1::OpCode::readPoint(), and MsWks4Zone::readPRNT().

## setX()

template<class T>

void MWAWVec2< T >::setX | ( | T | xx | ) |

inline

resets the first element

Referenced by MsWks4Zone::readFRAM().

## setY()

template<class T>

void MWAWVec2< T >::setY | ( | T | yy | ) |

inline

resets the second element

Referenced by MsWks4Zone::readFRAM().

## x()

template<class T>

T MWAWVec2< T >::x | ( |  | ) | const

inline

first element

Referenced by MWAWGraphicListener::_handleFrameParameters(), MWAWPresentationListener::_handleFrameParameters(), MWAWSpreadsheetListener::_handleFrameParameters(), MWAWTextListener::_handleFrameParameters(), MWAWGraphicShape::addTo(), MWAWPictMac::checkOrGet(), MWAWPictData::get(), MsWksGraph::getEntryPicture(), MsWksGraph::getEntryPictureV1(), MWAWGraphicListener::MWAWGraphicListener(), MWAWSpreadsheetListener::MWAWSpreadsheetListener(), ClarisWksStruct::DSET::Child::operator<<, HanMacWrdKGraphInternal::Frame::operator<<, WriterPlsParserInternal::WindowsInfo::operator<<, MWAWOLEParser::parse(), libmwaw::PrinterRect::read(), libmwaw_applepict1::Bitmap::read(), ApplePictParser::readBitmap(), PowerPoint7Parser::readDocAtom(), ClarisDrawParser::readDocHeader(), ClarisWksDocument::readDocHeader(), PowerPoint1Parser::readDocInfo(), PowerPoint3Parser::readDocInfo(), MacWrtParser::readGraphic(), WriterPlsParser::readGraphic(), MsWksDocument::readGroupHeaderFooter(), ApplePictParser::readPixmap(), ActaParser::readPrintInfo(), BeagleWksBMParser::readPrintInfo(), BeagleWksDBParser::readPrintInfo(), BeagleWksDRParser::readPrintInfo(), BeagleWksParser::readPrintInfo(), BeagleWksSSParser::readPrintInfo(), CanvasParser::readPrintInfo(), ClarisDrawParser::readPrintInfo(), ClarisWksDocument::readPrintInfo(), CricketDrawParser::readPrintInfo(), DrawTableParser::readPrintInfo(), FullWrtParser::readPrintInfo(), GreatWksDocument::readPrintInfo(), HanMacWrdJParser::readPrintInfo(), HanMacWrdKParser::readPrintInfo(), LightWayTxtParser::readPrintInfo(), MacDraft5Parser::readPrintInfo(), MacDraftParser::readPrintInfo(), MacDrawParser::readPrintInfo(), MacDrawProParser::readPrintInfo(), MacWrtParser::readPrintInfo(), MacWrtProParser::readPrintInfo(), MarinerWrtParser::readPrintInfo(), MindWrtParser::readPrintInfo(), MoreParser::readPrintInfo(), MouseWrtParser::readPrintInfo(), MsWksDocument::readPrintInfo(), MsWrdParser::readPrintInfo(), NisusWrtParser::readPrintInfo(), PowerPoint1Parser::readPrintInfo(), PowerPoint3Parser::readPrintInfo(), RagTimeParser::readPrintInfo(), ReadySetGoParser::readPrintInfo(), ScoopParser::readPrintInfo(), ScriptWriterParser::readPrintInfo(), StudentWritingCParser::readPrintInfo(), StyleParser::readPrintInfo(), SuperPaintParser::readPrintInfo(), WingzParser::readPrintInfo(), WordMakerParser::readPrintInfo(), WriteNowParser::readPrintInfo(), WriterPlsParser::readPrintInfo(), MsWks4Zone::readPRNT(), WriteNowText::readTokenV2(), MWAWBox2< int >::resizeFromCenter(), FullWrtGraph::sendGraphic(), MacWrtProParser::sendPicture(), and WriteNowParser::sendPicture().

## y()

template<class T>

T MWAWVec2< T >::y | ( |  | ) | const

inline

second element

Referenced by MWAWGraphicListener::_handleFrameParameters(), MWAWPresentationListener::_handleFrameParameters(), MWAWSpreadsheetListener::_handleFrameParameters(), MWAWTextListener::_handleFrameParameters(), MWAWGraphicShape::addTo(), MWAWPictMac::checkOrGet(), MWAWPictData::get(), MsWksGraph::getEntryPicture(), MsWksGraph::getEntryPictureV1(), MWAWGraphicListener::MWAWGraphicListener(), MWAWSpreadsheetListener::MWAWSpreadsheetListener(), ClarisWksStruct::DSET::Child::operator<<, HanMacWrdKGraphInternal::Frame::operator<<, WriterPlsParserInternal::WindowsInfo::operator<<, MWAWOLEParser::parse(), libmwaw::PrinterRect::read(), libmwaw_applepict1::Bitmap::read(), ApplePictParser::readBitmap(), PowerPoint7Parser::readDocAtom(), ClarisDrawParser::readDocHeader(), ClarisWksDocument::readDocHeader(), PowerPoint1Parser::readDocInfo(), PowerPoint3Parser::readDocInfo(), MacWrtParser::readGraphic(), WriterPlsParser::readGraphic(), MsWksDocument::readGroupHeaderFooter(), ApplePictParser::readPixmap(), ActaParser::readPrintInfo(), BeagleWksBMParser::readPrintInfo(), BeagleWksDBParser::readPrintInfo(), BeagleWksDRParser::readPrintInfo(), BeagleWksParser::readPrintInfo(), BeagleWksSSParser::readPrintInfo(), CanvasParser::readPrintInfo(), ClarisDrawParser::readPrintInfo(), ClarisWksDocument::readPrintInfo(), CricketDrawParser::readPrintInfo(), DrawTableParser::readPrintInfo(), FullWrtParser::readPrintInfo(), GreatWksDocument::readPrintInfo(), HanMacWrdJParser::readPrintInfo(), HanMacWrdKParser::readPrintInfo(), LightWayTxtParser::readPrintInfo(), MacDraft5Parser::readPrintInfo(), MacDraftParser::readPrintInfo(), MacDrawParser::readPrintInfo(), MacDrawProParser::readPrintInfo(), MacWrtParser::readPrintInfo(), MacWrtProParser::readPrintInfo(), MarinerWrtParser::readPrintInfo(), MindWrtParser::readPrintInfo(), MoreParser::readPrintInfo(), MouseWrtParser::readPrintInfo(), MsWksDocument::readPrintInfo(), MsWrdParser::readPrintInfo(), NisusWrtParser::readPrintInfo(), PowerPoint1Parser::readPrintInfo(), PowerPoint3Parser::readPrintInfo(), RagTimeParser::readPrintInfo(), ReadySetGoParser::readPrintInfo(), ScoopParser::readPrintInfo(), ScriptWriterParser::readPrintInfo(), StudentWritingCParser::readPrintInfo(), StyleParser::readPrintInfo(), SuperPaintParser::readPrintInfo(), WingzParser::readPrintInfo(), WordMakerParser::readPrintInfo(), WriteNowParser::readPrintInfo(), WriterPlsParser::readPrintInfo(), MsWks4Zone::readPRNT(), WriteNowText::readTokenV2(), MWAWBox2< int >::resizeFromCenter(), FullWrtGraph::sendGraphic(), MacWrtProParser::sendPicture(), and WriteNowParser::sendPicture().

## Friends And Related Symbol Documentation

## operator*

template<class T>
template<class U>

MWAWVec2< T > operator* | ( | U | scale,
|  | MWAWVec2< T > const & | p1 )

friend

generic operator*

## operator+

template<class T>

MWAWVec2< T > operator+ | ( | MWAWVec2< T > const & | p1,
|  | MWAWVec2< T > const & | p2 )

friend

operator+

## operator-

template<class T>

MWAWVec2< T > operator- | ( | MWAWVec2< T > const & | p1,
|  | MWAWVec2< T > const & | p2 )

friend

operator-

## operator<<

template<class T>

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

friend

operator<<: prints data in form "XxY"

## Member Data Documentation

## m_x

template<class T>

T MWAWVec2< T >::m_x

protected

first element

Referenced by MWAWVec2< bool >::cmp(), MWAWVec2< bool >::cmpY(), MWAWVec2< bool >::operator+=(), MWAWVec2< bool >::operator-=(), and MWAWVec2< bool >::operator<<.

## m_y

template<class T>

T MWAWVec2< T >::m_y

protected

second element

Referenced by MWAWVec2< bool >::cmp(), MWAWVec2< bool >::cmpY(), MWAWVec2< bool >::operator+=(), MWAWVec2< bool >::operator-=(), and MWAWVec2< bool >::operator<<.

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

- libmwaw_internal.hxx