- typedef Array<WindingVertex> container_type;
-
- std::size_t numpoints;
- container_type points;
-
- typedef container_type::iterator iterator;
- typedef container_type::const_iterator const_iterator;
-
- Winding() : numpoints(0)
- {
- }
- Winding(std::size_t size) : numpoints(0), points(size)
- {
- }
- void resize(std::size_t size)
- {
- points.resize(size);
- numpoints = 0;
- }
-
- iterator begin()
- {
- return points.begin();
- }
- const_iterator begin() const
- {
- return points.begin();
- }
- iterator end()
- {
- return points.begin() + numpoints;
- }
- const_iterator end() const
- {
- return points.begin() + numpoints;
- }
-
- WindingVertex& operator[](std::size_t index)
- {
- ASSERT_MESSAGE(index < points.size(), "winding: index out of bounds");
- return points[index];
- }
- const WindingVertex& operator[](std::size_t index) const
- {
- ASSERT_MESSAGE(index < points.size(), "winding: index out of bounds");
- return points[index];
- }
-
- void push_back(const WindingVertex& point)
- {
- points[numpoints] = point;
- ++numpoints;
- }
- void erase(iterator point)
- {
- for(iterator i = point + 1; i != end(); point = i, ++i)
- {
- *point = *i;
- }
- --numpoints;
- }
+ typedef Array<WindingVertex> container_type;
+
+ std::size_t numpoints;
+ container_type points;
+
+ typedef container_type::iterator iterator;
+ typedef container_type::const_iterator const_iterator;
+
+ Winding() : numpoints( 0 ){
+ }
+ Winding( std::size_t size ) : numpoints( 0 ), points( size ){
+ }
+ void resize( std::size_t size ){
+ points.resize( size );
+ numpoints = 0;
+ }
+
+ iterator begin(){
+ return points.begin();
+ }
+ const_iterator begin() const {
+ return points.begin();
+ }
+ iterator end(){
+ return points.begin() + numpoints;
+ }
+ const_iterator end() const {
+ return points.begin() + numpoints;
+ }
+
+ WindingVertex& operator[]( std::size_t index ){
+ ASSERT_MESSAGE( index < points.size(), "winding: index out of bounds" );
+ return points[index];
+ }
+ const WindingVertex& operator[]( std::size_t index ) const {
+ ASSERT_MESSAGE( index < points.size(), "winding: index out of bounds" );
+ return points[index];
+ }
+
+ void push_back( const WindingVertex& point ){
+ points[numpoints] = point;
+ ++numpoints;
+ }
+ void erase( iterator point ){
+ for ( iterator i = point + 1; i != end(); point = i, ++i )
+ {
+ *point = *i;
+ }
+ --numpoints;
+ }