STOFFVec2< T > Class Template Reference

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

#include <libstaroffice_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< STOFFVec2< T >
, T, struct PosSizeLtX
MapX
 map of STOFFVec2 More...
 
typedef std::map< STOFFVec2< T >
, T, struct PosSizeLtY
MapY
 map of STOFFVec2 More...
 

Public Member Functions

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

Protected Attributes

m_x
 first element More...
 
m_y
 second element More...
 

Friends

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

Detailed Description

template<class T>
class STOFFVec2< T >

small class which defines a vector with 2 elements

Member Typedef Documentation

template<class T>
STOFFVec2< T >::MapX

map of STOFFVec2

template<class T>
STOFFVec2< T >::MapY

map of STOFFVec2

Constructor & Destructor Documentation

template<class T>
STOFFVec2< T >::STOFFVec2 ( xx = 0,
yy = 0 
)
inline

constructor

template<class T>
template<class U >
STOFFVec2< T >::STOFFVec2 ( STOFFVec2< U > const &  p)
inline

generic copy constructor

Member Function Documentation

template<class T>
void STOFFVec2< T >::add ( dx,
dy 
)
inline

increases the actuals values by dx and dy

template<class T>
int STOFFVec2< T >::cmp ( STOFFVec2< T > const &  p) const
inline

a comparison function: which first compares x then y

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

template<class T>
int STOFFVec2< T >::cmpY ( STOFFVec2< T > const &  p) const
inline
template<class T>
bool STOFFVec2< T >::operator!= ( STOFFVec2< T > const &  p) const
inline

comparison!=

template<class T>
template<class U >
STOFFVec2<T>& STOFFVec2< T >::operator*= ( scale)
inline

generic operator*=

template<class T>
STOFFVec2<T>& STOFFVec2< T >::operator+= ( STOFFVec2< T > const &  p)
inline

operator+=

template<class T>
STOFFVec2<T>& STOFFVec2< T >::operator-= ( STOFFVec2< T > const &  p)
inline

operator-=

template<class T>
bool STOFFVec2< T >::operator< ( STOFFVec2< T > const &  p) const
inline

comparison<: sort by y

template<class T>
bool STOFFVec2< T >::operator== ( STOFFVec2< T > const &  p) const
inline

comparison==

template<class T>
T STOFFVec2< T >::operator[] ( int  c) const
inline

operator[]

template<class T>
T& STOFFVec2< T >::operator[] ( int  c)
inline

operator[]

template<class T>
void STOFFVec2< T >::set ( xx,
yy 
)
inline

resets the two elements

template<class T>
void STOFFVec2< T >::setX ( xx)
inline

resets the first element

template<class T>
void STOFFVec2< T >::setY ( yy)
inline

resets the second element

template<class T>
T STOFFVec2< T >::x ( ) const
inline
template<class T>
T STOFFVec2< T >::y ( ) const
inline

Friends And Related Function Documentation

template<class T>
template<class U >
STOFFVec2<T> operator* ( scale,
STOFFVec2< T > const &  p1 
)
friend

generic operator*

template<class T>
STOFFVec2<T> operator+ ( STOFFVec2< T > const &  p1,
STOFFVec2< T > const &  p2 
)
friend

operator+

template<class T>
STOFFVec2<T> operator- ( STOFFVec2< T > const &  p1,
STOFFVec2< T > const &  p2 
)
friend

operator-

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

operator<<: prints data in form "XxY"

Member Data Documentation


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

Generated on Wed Apr 11 2018 01:10:36 for libstaroffice by doxygen 1.8.5