# Cinder

# cinder::Shape2d Class Reference

`#include <Shape2d.h>`

List of all members.

## Public Member Functions
void | moveTo (const Vec2f &p)
void | moveTo (float x, float y)
void | lineTo (const Vec2f &p)
void | lineTo (float x, float y)
void | quadTo (const Vec2f &p1, const Vec2f &p2)
void | quadTo (float x1, float y1, float x2, float y2)
void | curveTo (const Vec2f &p1, const Vec2f &p2, const Vec2f &p3)
void | curveTo (float x1, float y1, float x2, float y2, float x3, float y3)
void | close ()
bool | empty () const
void | clear ()
size_t | getNumContours () const
const Path2d & | getContour (size_t i) const
Path2d & | getContour (size_t i)
const Vec2f & | getCurrentPoint () const
void | removeContour (size_t i)
Rectf | calcBoundingBox () const
| Returns the bounding box of the path's control points. Note that this is not necessarily the bounding box of the path's shape.
template<typename IT >
void | iterate (IT &it)
| Iterates all of the contours and points of a Shape2d.

## Member Function Documentation

void cinder::Shape2d::moveTo | ( | const Vec2f & | p | ) |

void cinder::Shape2d::moveTo | ( | float | x,
|  | float | y |
| ) |  |  |

void cinder::Shape2d::lineTo | ( | const Vec2f & | p | ) |

void cinder::Shape2d::lineTo | ( | float | x,
|  | float | y |
| ) |  |  |

void cinder::Shape2d::quadTo | ( | const Vec2f & | p1,
|  | const Vec2f & | p2 |
| ) |  |  |

void cinder::Shape2d::quadTo | ( | float | x1,
|  | float | y1,
|  | float | x2,
|  | float | y2 |
| ) |  |  |

void cinder::Shape2d::curveTo | ( | const Vec2f & | p1,
|  | const Vec2f & | p2,
|  | const Vec2f & | p3 |
| ) |  |  |

void cinder::Shape2d::curveTo | ( | float | x1,
|  | float | y1,
|  | float | x2,
|  | float | y2,
|  | float | x3,
|  | float | y3 |
| ) |  |  |

void cinder::Shape2d::close | ( |  | ) |

bool cinder::Shape2d::empty | ( |  | ) | const

void cinder::Shape2d::clear | ( |  | ) |

size_t cinder::Shape2d::getNumContours | ( |  | ) | const

const Path2d& cinder::Shape2d::getContour | ( | size_t | i | ) | const

Path2d& cinder::Shape2d::getContour | ( | size_t | i | ) |

const Vec2f& cinder::Shape2d::getCurrentPoint | ( |  | ) | const

void cinder::Shape2d::removeContour | ( | size_t | i | ) |

Rectf cinder::Shape2d::calcBoundingBox | ( |  | ) | const

Returns the bounding box of the path's control points. Note that this is not necessarily the bounding box of the path's shape.

template<typename IT >

void cinder::Shape2d::iterate | ( | IT & | it | ) |

Iterates all of the contours and points of a Shape2d.

Expects a template parameter that implements

     bool operator()( Path2d::SegmentType type, Vec2f *points, Vec2f *previousPoint )

. Functor should return false to cease iteration. A SegmentType of type `CLOSE` receives &mPoints[0] for its points parameters.

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

- include/cinder/Shape2d.h
- src/cinder/Shape2d.cpp