/**************************************************************************** Copyright (C) 2010-2012 the Office National des ForĂȘts (ONF), France and the Association de Recherche Technologie et Sciences (ARTS), Ecole Nationale Suprieure d'Arts et MĂ©tiers (ENSAM), Cluny, France. All rights reserved. Contact : alexandre.piboule@onf.fr Developers : Michal KREBS (ARTS/ENSAM) This file is part of PluginShared library 2.0. PluginShared is free library: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PluginShared is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with PluginShared. If not, see . *****************************************************************************/ #ifndef CT_DELAUNAYT_H #define CT_DELAUNAYT_H #include "pluginShared_global.h" #include class CT_NodeT; class CT_EdgeT; class CT_TriangleT; class PLUGINSHAREDSHARED_EXPORT CT_DelaunayT { public: CT_DelaunayT(); ~CT_DelaunayT(); // supprimer tous les points ajoutes a la liste des points et efface les informations de la triangulation void clear(); // insertion d'un point (on peut inserer un point, retrouver la liste de ses voisins en appelant // la methode getNodesAround(), puis supprimer ce point de la triangulation en appelant removeNode(...). Lorsque // le point est supprime, il ne connait plus la liste de ses voisins) void insertNode(QSharedPointer n, bool debug = false); // supression d'un point (node) void removeNode(QSharedPointer n); // retourne la liste de tous les points ajoutes a la triangulation const QList< QSharedPointer >& getNodeList() const; // retourne la liste de toutes les aretes trouvees const QList< QSharedPointer >& getEdgeList() const; // retourne la liste de tous les triangles trouvees const QList< QSharedPointer >& getTriangleList() const; // retourne le point de depart de l'enveloppe convexe (pour continuer il faut appeler la methode getHullEdge() recursivement) QSharedPointer getHullEdgeStart() const; // retourne la liste des points (Node) de l'enveloppe convexe QList< QSharedPointer > getHullNodes() const; CT_DelaunayT* copy(); private: QList< QSharedPointer > _list_nodes; QList< QSharedPointer > _list_edges; QList< QSharedPointer > _list_triangles; QSharedPointer _hull_edge_start; QSharedPointer _act_edge; void expandTri(QSharedPointer e, QSharedPointer nd, int type); void expandHull(QSharedPointer nd); int searchEdge(QSharedPointer e, QSharedPointer nd); void swapTest(QSharedPointer e11); bool nodeInTriangleTest(QSharedPointer e1, QSharedPointer e2, QSharedPointer e3, QSharedPointer n); }; #endif // CT_DELAUNAYT_H