Converts an arbitrary Shape2d into a TriMesh2d. More...
#include <Triangulate.h>
Classes | |
class | Exception |
Public Types | |
enum | Winding { WINDING_ODD, WINDING_NONZERO, WINDING_POSITIVE, WINDING_NEGATIVE, WINDING_ABS_GEQ_TWO } |
typedef enum cinder::Triangulator::Winding | Winding |
Public Member Functions | |
Triangulator () | |
Default constructor. | |
Triangulator (const Path2d &path, float approximationScale=1.0f) | |
Constructs using a Path2d. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space. | |
Triangulator (const Shape2d &shape, float approximationScale=1.0f) | |
Constructs using a Shape2d. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space. | |
Triangulator (const PolyLine2f &polyLine) | |
Constructs using a PolyLine2f. | |
void | addShape (const Shape2d &path, float approximationScale=1.0f) |
Adds a Shape2d to the tesselation. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space. | |
void | addPath (const Path2d &path, float approximationScale=1.0f) |
Adds a Path2d to the tesselation. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space. | |
void | addPolyLine (const PolyLine2f &polyLine) |
Adds a PolyLine2f to the tesselation. | |
TriMesh2d | calcMesh (Winding winding=WINDING_ODD) |
Performs the tesselation, returning a TriMesh2d. | |
Protected Member Functions | |
void | allocate () |
Protected Attributes | |
int | mAllocated |
std::shared_ptr< TESStesselator > | mTess |
Converts an arbitrary Shape2d into a TriMesh2d.
cinder::Triangulator::Triangulator | ( | ) |
Default constructor.
cinder::Triangulator::Triangulator | ( | const Path2d & | path, | |
float | approximationScale = 1.0f | |||
) |
Constructs using a Path2d. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space.
cinder::Triangulator::Triangulator | ( | const Shape2d & | shape, | |
float | approximationScale = 1.0f | |||
) |
Constructs using a Shape2d. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space.
cinder::Triangulator::Triangulator | ( | const PolyLine2f & | polyLine | ) |
Constructs using a PolyLine2f.
void cinder::Triangulator::addShape | ( | const Shape2d & | path, | |
float | approximationScale = 1.0f | |||
) |
Adds a Shape2d to the tesselation. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space.
void cinder::Triangulator::addPath | ( | const Path2d & | path, | |
float | approximationScale = 1.0f | |||
) |
Adds a Path2d to the tesselation. approximationScale represents how smooth the tesselation is, with 1.0 corresponding to 1:1 with screen space.
void cinder::Triangulator::addPolyLine | ( | const PolyLine2f & | polyLine | ) |
Adds a PolyLine2f to the tesselation.
Performs the tesselation, returning a TriMesh2d.
void cinder::Triangulator::allocate | ( | ) | [protected] |
int cinder::Triangulator::mAllocated [protected] |
std::shared_ptr<TESStesselator> cinder::Triangulator::mTess [protected] |