MC_connectivity_index.hpp

Go to the documentation of this file.
00001 /*
00002 **    Mesh Converter
00003 **    Copyright (C) 2009  Damien Rohmer
00004 **
00005 **    This program is free software: you can redistribute it and/or modify
00006 **    it under the terms of the GNU General Public License as published by
00007 **    the Free Software Foundation, either version 3 of the License, or
00008 **    (at your option) any later version.
00009 **
00010 **   This program is distributed in the hope that it will be useful,
00011 **    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 **    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 **    GNU General Public Licens1e for more details.
00014 **
00015 **    You should have received a copy of the GNU General Public License
00016 **    along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 #ifndef MC_CONNECTIVITY_INDEX_H_
00020 #define MC_CONNECTIVITY_INDEX_H_
00021 
00022 #include <MC_int_vector_vector.hpp>
00023 
00024 #include <map>
00025 #include <set>
00026 
00027 
00028 namespace mesh_conv
00029 {
00030 
00031     class MC_int_pair;
00032     class MC_int_pair_less;
00033 
00034 
00036     class MC_connectivity_index : public MC_int_vector_vector
00037     {
00038     public:
00039 
00040         //************************************************//
00041         //************************************************//
00042         //CONSTRUCTORS
00043         //************************************************//
00044         //************************************************//
00045 
00047         MC_connectivity_index();
00049         MC_connectivity_index(const MC_int_vector& v0);
00051         MC_connectivity_index(const MC_int_vector& v0,const MC_int_vector& v1);
00053         MC_connectivity_index(const MC_int_vector& v0,const MC_int_vector& v1,const MC_int_vector& v2);
00055         MC_connectivity_index(const MC_int_vector& v0,const MC_int_vector& v1,const MC_int_vector& v2,const MC_int_vector& v3);
00057         MC_connectivity_index(const MC_int_vector_vector& v0);
00059         MC_connectivity_index(const MC_connectivity_index& v0);
00060 
00061 
00062 
00063         //************************************************//
00064         //************************************************//
00065         //Neighbooring
00066         //************************************************//
00067         //************************************************//
00068 
00070         MC_connectivity_index& build_ring();
00072         const std::map<int,std::set<int> >& ring() const;
00073 
00075         MC_connectivity_index& build_star();
00077         const std::map<int,std::set<int> >& star() const;
00078 
00080         std::map<int,std::set<int> > polygon_neighbors() const;
00081 
00083         MC_connectivity_index& update_neighbors();
00084 
00085 
00086         //************************************************//
00087         //************************************************//
00088         //informations
00089         //************************************************//
00090         //************************************************//
00091 
00095         std::set<int> used_vertex() const;
00096 
00098         bool is_triangle_only() const;
00099 
00100 
00101         //************************************************//
00102         //************************************************//
00103         //Modification
00104         //************************************************//
00105         //************************************************//
00106 
00111         MC_connectivity_index triangulated() const;
00112 
00114         MC_connectivity_index fliped_polygon() const;
00115 
00116         //************************************************//
00117         //************************************************//
00118         //Boundary
00119         //************************************************//
00120         //************************************************//
00121 
00123         std::set <MC_int_pair,MC_int_pair_less> boundary() const;
00125         std::set<int> boundary_vertex() const;
00130         std::set<int> boundary_polygon() const;
00131 
00132 
00133         //************************************************//
00134         //************************************************//
00135         //Edges
00136         //************************************************//
00137         //************************************************//
00138 
00140         std::set<MC_int_pair,MC_int_pair_less> edges() const;
00141 
00142         //************************************************//
00143         //************************************************//
00144         //Connectivity algorithm
00145         //************************************************//
00146         //************************************************//
00147 
00149         MC_int_vector triangle_propagation_using_vertex_field(const MC_int_vector& seed_vertices,const MC_double_vector& field_per_vertex,const double& threshold,const std::set<int>& invalidated_triangle) const;
00150 
00151 
00152 
00153     private:
00154 
00156         std::map<int,std::set<int> > ring_1;
00158         std::map<int,std::set<int> > star_1;
00159     };
00160 }
00161 
00162 #endif

Generated on Sun Apr 18 20:24:47 2010 by  doxygen 1.6.1