00001 // Mesh Algorithms: a library of algorithms to manipulate 3D meshes 00002 // Copyright (C) 2001 Tim Garthwaite and Jason Reposa 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 #ifndef DECIMATE_H 00019 #define DECIMATE_H 00020 00021 #include <set> 00022 #include "Scene.h" 00023 00025 class Decimate { 00030 std::set <Triangle *> insert; 00031 00035 bool can_create_link(Vertex * c_n, Vertex * m_n, Vertex * l_n, Vertex * v_t_r); 00036 bool check_overlap(std::vector <Vertex *> * verts, std::set <Triangle *> * tris); 00037 bool vertex_contained(Vertex * v, Triangle * t); 00038 bool ordered(Vertex * v0, Vertex * v1, Vertex * v2, bool clockwise); 00039 00040 // we need the vertex that is going to be removed in triangulate 00041 Vertex * current_vertex_to_remove; 00042 00043 bool removeVertex(Model * model, Vertex * vertex_to_remove); 00044 public: 00045 Decimate(); 00046 bool remove(Scene * scene, int maxNumRemoved); 00047 }; 00048 00049 #endif