#include <Area.h>
Public Member Functions | |
AreaT () | |
AreaT (const Vec2< T > &UL, const Vec2< T > &LR) | |
AreaT (T aX1, T aY1, T aX2, T aY2) | |
template<typename Y > | |
AreaT (const AreaT< Y > &aAreaBase) | |
void | set (T aX1, T aY1, T aX2, T aY2) |
T | getWidth () const |
T | getHeight () const |
Vec2< T > | getSize () const |
T | calcArea () const |
void | clipBy (const AreaT< T > &clip) |
AreaT< T > | getClipBy (const AreaT< T > &clip) const |
void | offsetBy (const Vec2< T > &offset) |
Translates the AreaT by offset. | |
AreaT< T > | getOffsetBy (const Vec2< T > &offset) const |
Returns a copy of the AreaT translated by offset. | |
void | moveULTo (const Vec2< T > &newUL) |
Translates the AreaT so that its upper-left corner is newUL. | |
AreaT< T > | getMoveULTo (const Vec2< T > &newUL) const |
Returns a copy of the AreaT translated so that its upper-left corner is newUL. | |
void | expand (T expandX, T expandY) |
Expands the AreaT by expandX horizontally and expandY vertically. expandX is subtracted from x1 and added to x2 and expandY is subtracted from y1 and added to y2 . | |
T | getX1 () const |
void | setX1 (T aX1) |
T | getY1 () const |
void | setY1 (T aY1) |
T | getX2 () const |
void | setX2 (T aX2) |
T | getY2 () const |
void | setY2 (T aY2) |
Vec2< T > | getUL () const |
Vec2< T > | getLR () const |
bool | isInside (const Vec2< T > &offset) const |
template<typename Y > | |
bool | isInside (const Vec2< Y > &offset) const |
bool | intersects (const AreaT< T > &area) const |
bool | operator== (const AreaT< T > &aArea) const |
bool | operator< (const AreaT< T > &aArea) const |
AreaT< T > | operator+ (const Vec2< T > &offset) const |
template<> | |
AreaT (const AreaT< boost::rational< int32_t > > &aAreaBase) | |
template<> | |
AreaT (const AreaT< int32_t > &aAreaBase) | |
Static Public Member Functions | |
static AreaT< T > | proportionalFit (const AreaT< T > &srcArea, const AreaT< T > &dstArea, bool center, bool expand=false) |
Public Attributes | |
T | x1 |
T | y1 |
T | x2 |
T | y2 |
Friends | |
std::ostream & | operator<< (std::ostream &o, const AreaT< T > &area) |
cinder::AreaT< T >::AreaT | ( | ) |
cinder::AreaT< T >::AreaT | ( | const Vec2< T > & | UL, | |
const Vec2< T > & | LR | |||
) |
cinder::AreaT< T >::AreaT | ( | T | aX1, | |
T | aY1, | |||
T | aX2, | |||
T | aY2 | |||
) |
cinder::AreaT< T >::AreaT | ( | const AreaT< Y > & | aAreaBase | ) | [explicit] |
cinder::AreaT< int32_t >::AreaT | ( | const AreaT< boost::rational< int32_t > > & | aAreaBase | ) |
cinder::AreaT< boost::rational< int32_t > >::AreaT | ( | const AreaT< int32_t > & | aAreaBase | ) |
void cinder::AreaT< T >::set | ( | T | aX1, | |
T | aY1, | |||
T | aX2, | |||
T | aY2 | |||
) |
T cinder::AreaT< T >::getWidth | ( | ) | const |
T cinder::AreaT< T >::getHeight | ( | ) | const |
Vec2<T> cinder::AreaT< T >::getSize | ( | ) | const |
T cinder::AreaT< T >::calcArea | ( | ) | const |
void cinder::AreaT< T >::clipBy | ( | const AreaT< T > & | clip | ) |
AreaT< T > cinder::AreaT< T >::getClipBy | ( | const AreaT< T > & | clip | ) | const |
void cinder::AreaT< T >::offsetBy | ( | const Vec2< T > & | offset | ) |
Translates the AreaT by offset.
AreaT< T > cinder::AreaT< T >::getOffsetBy | ( | const Vec2< T > & | offset | ) | const |
Returns a copy of the AreaT translated by offset.
void cinder::AreaT< T >::moveULTo | ( | const Vec2< T > & | newUL | ) |
Translates the AreaT so that its upper-left corner is newUL.
AreaT< T > cinder::AreaT< T >::getMoveULTo | ( | const Vec2< T > & | newUL | ) | const |
Returns a copy of the AreaT translated so that its upper-left corner is newUL.
void cinder::AreaT< T >::expand | ( | T | expandX, | |
T | expandY | |||
) |
Expands the AreaT by expandX horizontally and expandY vertically. expandX is subtracted from x1
and added to x2
and expandY is subtracted from y1
and added to y2
.
T cinder::AreaT< T >::getX1 | ( | ) | const |
void cinder::AreaT< T >::setX1 | ( | T | aX1 | ) |
T cinder::AreaT< T >::getY1 | ( | ) | const |
void cinder::AreaT< T >::setY1 | ( | T | aY1 | ) |
T cinder::AreaT< T >::getX2 | ( | ) | const |
void cinder::AreaT< T >::setX2 | ( | T | aX2 | ) |
T cinder::AreaT< T >::getY2 | ( | ) | const |
void cinder::AreaT< T >::setY2 | ( | T | aY2 | ) |
Vec2<T> cinder::AreaT< T >::getUL | ( | ) | const |
Vec2<T> cinder::AreaT< T >::getLR | ( | ) | const |
bool cinder::AreaT< T >::isInside | ( | const Vec2< T > & | offset | ) | const |
bool cinder::AreaT< T >::isInside | ( | const Vec2< Y > & | offset | ) | const |
bool cinder::AreaT< T >::intersects | ( | const AreaT< T > & | area | ) | const |
bool cinder::AreaT< T >::operator== | ( | const AreaT< T > & | aArea | ) | const |
bool cinder::AreaT< T >::operator< | ( | const AreaT< T > & | aArea | ) | const |
AreaT<T> cinder::AreaT< T >::operator+ | ( | const Vec2< T > & | offset | ) | const |
AreaT< T > cinder::AreaT< T >::proportionalFit | ( | const AreaT< T > & | srcArea, | |
const AreaT< T > & | dstArea, | |||
bool | center, | |||
bool | expand = false | |||
) | [static] |
std::ostream& operator<< | ( | std::ostream & | o, | |
const AreaT< T > & | area | |||
) | [friend] |
T cinder::AreaT< T >::x1 |
T cinder::AreaT< T >::y1 |
T cinder::AreaT< T >::x2 |
T cinder::AreaT< T >::y2 |