00001
00002
00003 #ifndef JMATH_DELAUNAY_HPP
00004 #define JMATH_DELAUNAY_HPP
00005
00006 #include <list>
00007
00008
00009
00010 #include <HeTriang.h>
00011 #include <HeDart.h>
00012 #include <HeTraits.h>
00013
00014 namespace jafar {
00015 namespace jmath {
00016
00017
00018 class DNode : public hed::Node {
00019
00020 protected:
00021
00022 unsigned int _id;
00023
00024 public:
00025
00026 DNode(double x_, double y_, double z_=0);
00027 DNode(unsigned int id_, double x_, double y_, double z_=0);
00028
00029 unsigned int id() const {return _id;};
00030
00031 };
00032
00033
00034 class Delaunay {
00035
00036 protected:
00037 typedef std::list<DNode*>::iterator nodes_it;
00038
00039 std::list<DNode*> nodes;
00040
00041 hed::Triangulation triangulation;
00042
00043 public:
00044
00045 Delaunay(double xmin_, double ymin_, double xmax_, double ymax_, double zref_=0.0);
00046 ~Delaunay();
00047
00048 void addNode(int id, double x_, double y_, double z_=0);
00049
00050 int nbTriangles() const;
00051 std::string getTriangles();
00052
00053 };
00054
00055 }
00056 }
00057
00058 #endif // JMATH_DELAUNAY_HPP