Cinder  0.9.1
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
cinder::PolyLineT< T > Class Template Reference

#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
 
getPosition (float t) const
 
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
 
calcCentroid () const
 

Static Public Member Functions

static std::vector< PolyLineTcalcUnion (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b)
 
static std::vector< PolyLineTcalcIntersection (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b)
 
static std::vector< PolyLineTcalcXor (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b)
 
static std::vector< PolyLineTcalcDifference (const std::vector< PolyLineT > &a, std::vector< PolyLineT > &b)
 

Friends

std::ostream & operator<< (std::ostream &lhs, const PolyLineT &rhs)
 

Member Typedef Documentation

template<typename T>
typedef std::vector<T>::const_iterator cinder::PolyLineT< T >::const_iterator
template<typename T>
typedef std::vector<T>::iterator cinder::PolyLineT< T >::iterator

Constructor & Destructor Documentation

template<typename T>
cinder::PolyLineT< T >::PolyLineT ( )
template<typename T>
cinder::PolyLineT< T >::PolyLineT ( const std::vector< T > &  aPoints)

Member Function Documentation

template<typename T>
const std::vector<T>& cinder::PolyLineT< T >::getPoints ( ) const
template<typename T>
std::vector<T>& cinder::PolyLineT< T >::getPoints ( )
template<typename T>
size_t cinder::PolyLineT< T >::size ( ) const
template<typename T>
void cinder::PolyLineT< T >::push_back ( const T &  v)
template<typename T>
iterator cinder::PolyLineT< T >::begin ( )
template<typename T>
const_iterator cinder::PolyLineT< T >::begin ( ) const
template<typename T>
iterator cinder::PolyLineT< T >::end ( )
template<typename T>
const_iterator cinder::PolyLineT< T >::end ( ) const
template<typename T>
void cinder::PolyLineT< T >::setClosed ( bool  aClosed = true)
template<typename T>
bool cinder::PolyLineT< T >::isClosed ( ) const
template<typename T >
T cinder::PolyLineT< T >::getPosition ( float  t) const
template<typename T >
T cinder::PolyLineT< T >::getDerivative ( float  t) const
template<typename T>
void cinder::PolyLineT< T >::scale ( const T &  scaleFactor,
scaleCenter = T() 
)
template<typename T>
void cinder::PolyLineT< T >::offset ( const T &  offsetBy)
template<typename T >
void cinder::PolyLineT< T >::reverse ( )
template<typename T >
PolyLineT< T > cinder::PolyLineT< T >::reversed ( ) const
template<typename T >
bool cinder::PolyLineT< T >::contains ( const vec2 &  pt) const

Returns whether the point pt is contained within the boundaries of the PolyLine.

template<typename T >
double cinder::PolyLineT< T >::calcArea ( ) const

Returns the unsigned area of the polygon. Assumes closed and no self-intersections.

template<typename T >
T cinder::PolyLineT< T >::calcCentroid ( ) const

Returns the centroid or "center of mass" of the polygon. Assumes closed and no self-intersections.

template<typename T >
std::vector< PolyLineT< T > > cinder::PolyLineT< T >::calcUnion ( const std::vector< PolyLineT< T > > &  a,
std::vector< PolyLineT< T > > &  b 
)
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.

template<typename T >
std::vector< PolyLineT< T > > cinder::PolyLineT< T >::calcIntersection ( const std::vector< PolyLineT< T > > &  a,
std::vector< PolyLineT< T > > &  b 
)
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.

template<typename T >
std::vector< PolyLineT< T > > cinder::PolyLineT< T >::calcXor ( const std::vector< PolyLineT< T > > &  a,
std::vector< PolyLineT< T > > &  b 
)
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.

template<typename T >
std::vector< PolyLineT< T > > cinder::PolyLineT< T >::calcDifference ( const std::vector< PolyLineT< T > > &  a,
std::vector< PolyLineT< T > > &  b 
)
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.

Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  lhs,
const PolyLineT< T > &  rhs 
)
friend

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