small class which defines a vector with 2 elements More...
#include <libwps_internal.h>
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< Vec2< T >, T, struct PosSizeLtX > | MapX |
map of Vec2 | |
typedef std::map< Vec2< T >, T, struct PosSizeLtY > | MapY |
map of Vec2 |
Public Member Functions | |
Vec2 (T xx=0, T yy=0) | |
constructor | |
template<class U > | |
Vec2 (Vec2< 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 | |
Vec2< T > & | operator+= (Vec2< T > const &p) |
operator+= | |
Vec2< T > & | operator-= (Vec2< T > const &p) |
operator-= | |
template<class U > | |
Vec2< T > & | operator*= (U scale) |
generic operator*= | |
bool | operator== (Vec2< T > const &p) const |
comparison== | |
bool | operator!= (Vec2< T > const &p) const |
comparison!= | |
bool | operator< (Vec2< T > const &p) const |
comparison<: sort by y | |
int | cmp (Vec2< T > const &p) const |
a comparison function: which first compares x then y | |
int | cmpY (Vec2< 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 | |
Vec2< T > | operator+ (Vec2< T > const &p1, Vec2< T > const &p2) |
operator+ | |
Vec2< T > | operator- (Vec2< T > const &p1, Vec2< T > const &p2) |
operator- | |
template<class U > | |
Vec2< T > | operator* (U scale, Vec2< T > const &p1) |
generic operator* | |
std::ostream & | operator<< (std::ostream &o, Vec2< T > const &f) |
operator<<: prints data in form "XxY" |
small class which defines a vector with 2 elements
generic copy constructor
|
inline |
increases the actuals values by dx and dy
a comparison function: which first compares x then y
Referenced by Vec2< T >::PosSizeLtX::operator()().
a comparison function: which first compares y then x
Referenced by WPSPosition::cmp(), Vec2< int >::operator!=(), Vec2< T >::PosSizeLtY::operator()(), Vec2< int >::operator<(), and Vec2< int >::operator==().
generic operator*=
comparison<: sort by y
|
inline |
operator[]
|
inline |
operator[]
|
inline |
resets the two elements
|
inline |
resets the first element
|
inline |
resets the second element
|
inline |
first element
Referenced by WPSContentListener::_handleFrameParameters(), WPS4TextInternal::operator<<(), WPSOLEParser::parse(), and WPS4Graph::readObject().
|
inline |
second element
Referenced by WPSContentListener::_handleFrameParameters(), WPS4TextInternal::operator<<(), WPSOLEParser::parse(), and WPS4Graph::readObject().
generic operator*
|
friend |
operator<<: prints data in form "XxY"
|
protected |
|
protected |
second element
Referenced by Vec2< int >::add(), Vec2< int >::cmp(), Vec2< int >::cmpY(), Vec2< int >::operator*=(), Vec2< int >::operator+=(), Vec2< int >::operator-=(), Vec2< int >::operator[](), Vec2< int >::set(), Vec2< int >::setY(), and Vec2< int >::y().