00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ARCHON_UTILITIES_POLYGON_MESHER_H
00021 #define ARCHON_UTILITIES_POLYGON_MESHER_H
00022
00023 #include <string>
00024 #include <vector>
00025
00026 #include <archon/math/vector.H>
00027
00028 #include <archon/util/exception.H>
00029
00030 namespace Archon
00031 {
00032 namespace Utilities
00033 {
00034 using namespace std;
00035 using namespace Math;
00036
00037 struct MesherException: virtual Exception {};
00038
00039 struct MesherContext
00040 {
00041 virtual int addVertex(const Vector3 &) = 0;
00042 virtual void addPolygon(const vector<int> &) = 0;
00043 virtual ~MesherContext() {}
00044 };
00045
00185 void meshPolygon(const vector<Vector3> &polygon,
00186 double maxPatchSize,
00187 MesherContext *context);
00188
00201 void meshPolygon(const vector<Vector3> &polygon,
00202 double maxPatchSize,
00203 vector<Vector3> &resultingVertices,
00204 vector<int> &resultingPolygons);
00205 }
00206 }
00207
00208 #endif // ARCHON_UTILITIES_POLYGON_MESHER_H
00209