![]() |
Cinder
0.9.1
|
#include <PolyLine.h>
Public Types | |
typedef std::vector< T >::const_iterator | const_iterator |
typedef std::vector< T >::iterator | iterator |
Public Member Functions | |
PolyLineT () | |
PolyLineT (const std::vector< T > &aPoints) | |
const std::vector< T > & | getPoints () const |
std::vector< T > & | getPoints () |
size_t | size () const |
void | push_back (const T &v) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | setClosed (bool aClosed=true) |
bool | isClosed () const |
T | getPosition (float t) const |
T | getDerivative (float t) const |
void | scale (const T &scaleFactor, T scaleCenter=T()) |
void | offset (const T &offsetBy) |
void | reverse () |
PolyLineT< T > | reversed () const |
bool | contains (const vec2 &pt) const |
double | calcArea () const |
T | calcCentroid () const |
Static Public Member Functions | |
static std::vector< PolyLineT > | calcUnion (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b) |
static std::vector< PolyLineT > | calcIntersection (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b) |
static std::vector< PolyLineT > | calcXor (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b) |
static std::vector< PolyLineT > | calcDifference (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b) |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const PolyLineT &rhs) |
typedef std::vector<T>::const_iterator cinder::PolyLineT< T >::const_iterator |
typedef std::vector<T>::iterator cinder::PolyLineT< T >::iterator |
cinder::PolyLineT< T >::PolyLineT | ( | ) |
cinder::PolyLineT< T >::PolyLineT | ( | const std::vector< T > & | aPoints | ) |
const std::vector<T>& cinder::PolyLineT< T >::getPoints | ( | ) | const |
std::vector<T>& cinder::PolyLineT< T >::getPoints | ( | ) |
size_t cinder::PolyLineT< T >::size | ( | ) | const |
void cinder::PolyLineT< T >::push_back | ( | const T & | v | ) |
iterator cinder::PolyLineT< T >::begin | ( | ) |
const_iterator cinder::PolyLineT< T >::begin | ( | ) | const |
iterator cinder::PolyLineT< T >::end | ( | ) |
const_iterator cinder::PolyLineT< T >::end | ( | ) | const |
void cinder::PolyLineT< T >::setClosed | ( | bool | aClosed = true | ) |
bool cinder::PolyLineT< T >::isClosed | ( | ) | const |
T cinder::PolyLineT< T >::getPosition | ( | float | t | ) | const |
T cinder::PolyLineT< T >::getDerivative | ( | float | t | ) | const |
void cinder::PolyLineT< T >::scale | ( | const T & | scaleFactor, |
T | scaleCenter = T() |
||
) |
void cinder::PolyLineT< T >::offset | ( | const T & | offsetBy | ) |
void cinder::PolyLineT< T >::reverse | ( | ) |
PolyLineT< T > cinder::PolyLineT< T >::reversed | ( | ) | const |
bool cinder::PolyLineT< T >::contains | ( | const vec2 & | pt | ) | const |
Returns whether the point pt is contained within the boundaries of the PolyLine.
double cinder::PolyLineT< T >::calcArea | ( | ) | const |
Returns the unsigned area of the polygon. Assumes closed and no self-intersections.
T cinder::PolyLineT< T >::calcCentroid | ( | ) | const |
Returns the centroid or "center of mass" of the polygon. Assumes closed and no self-intersections.
|
static |
Calculates the boolean union of a and b. Assumes the first PolyLine in the vector is the outermost and the (optional) others are holes.
|
static |
Calculates the boolean intersection of a and b. Assumes the first PolyLine in the vector is the outermost and the (optional) others are holes.
|
static |
Calculates the boolean XOR (symmetric difference) of a and b. Assumes the first PolyLine in the vector is the outermost and the (optional) others are holes.
|
static |
Calculates the boolean difference of a and b. Assumes the first PolyLine in the vector is the outermost and the (optional) others are holes.
|
friend |