#ifndef CGAL_MESH_3_H #define CGAL_MESH_3_H #include #include namespace CGAL { // Tr: a conform Delaunay triangulation template class Mesh_3 : public Tr { public: typedef Tr Triangulation; typedef Mesh_3 Self; typedef typename Tr::Geom_traits Geom_traits; typedef typename Tr::Triangulation_data_structure Tds; typedef typename Tr::Face_handle Face_handle; typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Finite_vertices_iterator Finite_vertices_iterator; public: // constructor from a Triangulation& t explicit Mesh_3(Triangulation& t, const Geom_traits& gt = Geom_traits(), bool dont_refine = false); void create_clusters(); private: // PRIVATE TYPES class Is_really_a_constrained_edge { const Self& _m; public: explicit Is_really_a_constrained_edge(const Self& m) : _m(m) {}; bool operator()(const Constrained_edge& ce) const { Face_handle fh; int i; return _m.is_edge(ce.first, ce.second, fh,i) && fh->is_constrained(i); } }; template class Filter_insert_iterator { protected: Cont* container; Predicate p; public: typedef Cont container_type; typedef std::output_iterator_tag iterator_category; typedef void value_type; typedef void difference_type; typedef void pointer; typedef void reference; explicit Filter_insert_iterator(Cont& x, Pred p = Pred()) : container(&x), predicate(p) {} Filter_insert_iterator& operator=(const typename Cont::value_type& value) { if( predicate(value) ) container->insert(value); return *this; } Filter_insert_iterator& operator*() { return *this; } Filter_insert_iterator& operator++() { return *this; } Filter_insert_iterator& operator++(int) { return *this; } }; inline template Filter_insert_iterator filter_inserter(Cont& x, Pred p = Pred()) { return Filter_insert_iterator(x, p); }; struct Cluster { bool reduced; // Is the cluster reduced typedef std::map Vertices_map; Vertices_map vertices; bool is_reduced() const { return reduced; } bool is_reduced(const Vertex_handle v) { return vertices[v]; } }; typedef std::multimap Cluster_map; private: Cluster_map cluster_map; }; // end Mesh_3 template void Mesh_3:: create_clusters() { for(Finite_vertices_iterator vit = finite_vertices_begin(); vit != finite_vertices_end(); vit++) create_clusters_of_vertex(vit); } template void Mesh_2:: create_clusters_of_vertex(Vertex_handle v) { typedef std::set Set_of_vertices; typedef std::list Clustered_vertices; typedef std::list List_of_baby_clusters; typedef typename List_of_baby_clusters::iterator Cl_it; List_of_baby_clusters futur_clusters; Set_of_vertices vh_set; // store incident vertices into vh_set; incident_vertices(v, std::inserter(vh_set, vh_set.end())); } } //end namespace CGAL #endif