diff --git a/README.md b/README.md index 2ce4d8d..fede570 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,6 @@ Paul Bourke's Delaunay Triangulation implementation. This is a big refactor from Julapy (Lukasz Karluk) and Pat Long's version (http://code.google.com/p/julapy/source/browse/trunk/openframeworks/ofxDelaunay/?r=708) Changes: -Now uses ofMesh rather than custom data structure -uses std::vector for internal storage, which removes need for reallocating memory or constructor/destructors -Removed need for setMaxPoints(). No max points enforced \ No newline at end of file +* Now uses ofMesh rather than custom data structure +* uses std::vector for internal storage, which removes need for reallocating memory or constructor/destructors +* Removed need for setMaxPoints(). No max points enforced diff --git a/src/ofxDelaunay.cpp b/src/ofxDelaunay.cpp index 732ed4e..5fcf2f4 100644 --- a/src/ofxDelaunay.cpp +++ b/src/ofxDelaunay.cpp @@ -1,6 +1,5 @@ /* - * ofxDelaunay.cpp - * openFrameworks + * ofxDelaunay.h * * Created by Pat Long on 29/10/09. * Copyright 2009 Tangible Interaction. All rights reserved. @@ -8,11 +7,14 @@ * Some parts based on demo code by Gilles Dumoulin. * Source: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/cpp.zip * + * Cleaned up by Lukasz Karluk, 19/05/2010 + * + * Refactored for 0071 + ofMesh by James George on 21/06/2012 */ + #include "ofxDelaunay.h" void ofxDelaunay::reset(){ - vertices.clear(); triangles.clear(); triangleMesh.clear(); @@ -48,7 +50,7 @@ int ofxDelaunay::triangulate(){ //allocate space for triangle indices triangles.resize(3*nv); - + int ntri; qsort( &vertices[0], vertices.size()-3, sizeof( XYZ ), XYZCompare ); Triangulate( nv, &vertices[0], &triangles[0], ntri ); diff --git a/src/ofxDelaunay.h b/src/ofxDelaunay.h index 7bf60d1..8c3c61a 100644 --- a/src/ofxDelaunay.h +++ b/src/ofxDelaunay.h @@ -18,8 +18,8 @@ #include "Delaunay.h" class ofxDelaunay { - - public: + +public: void reset(); @@ -32,7 +32,7 @@ class ofxDelaunay { ofMesh triangleMesh; - private: +private: vector triangles; vector vertices;