Rename the graph into Face_filtered_graph and add a function to check its validity.

This commit is contained in:
Maxime Gimeno 2017-05-12 11:52:07 +02:00
parent 185ac3bbd0
commit 1f96262d3d
12 changed files with 243 additions and 172 deletions

View File

@ -8,7 +8,7 @@ INPUT += ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Euler_operations.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/split_graph_into_polylines.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/split_graph_into_polylines.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/copy_face_graph.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/copy_face_graph.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Graph_with_descriptor_with_graph.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Graph_with_descriptor_with_graph.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Connected_components_graph.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Face_filtered_graph.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Dual.h \ ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/Dual.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h ${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h
EXAMPLE_PATH = ${CGAL_Surface_mesh_skeletonization_EXAMPLE_DIR} \ EXAMPLE_PATH = ${CGAL_Surface_mesh_skeletonization_EXAMPLE_DIR} \

View File

@ -316,7 +316,7 @@ user might encounter.
- `CGAL::Dual` - `CGAL::Dual`
- `CGAL::Graph_with_descriptor_with_graph` - `CGAL::Graph_with_descriptor_with_graph`
- `CGAL::Graph_with_descriptor_with_graph_property_map` - `CGAL::Graph_with_descriptor_with_graph_property_map`
- `CGAL::Connected_components_graph` - `CGAL::Face_filtered_graph`
## Helper Functions ## ## Helper Functions ##
- `CGAL::is_border()` - `CGAL::is_border()`

View File

@ -16,8 +16,8 @@
// //
// //
// Author(s) : Maxime Gimeno // Author(s) : Maxime Gimeno
#ifndef CGAL_BOOST_GRAPH_CONNECTED_COMPONENTS_GRAPH_H #ifndef CGAL_BOOST_GRAPH_FACE_FILTERED_GRAPH_H
#define CGAL_BOOST_GRAPH_CONNECTED_COMPONENTS_GRAPH_H #define CGAL_BOOST_GRAPH_FACE_FILTERED_GRAPH_H
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
#include <CGAL/boost/graph/properties.h> #include <CGAL/boost/graph/properties.h>
@ -37,10 +37,14 @@ namespace CGAL
/*! /*!
* \ingroup PkgBGLHelper * \ingroup PkgBGLHelper
* *
* The class `Connected_components_graph` wraps a graph into another graph in such a way that only the specified connected components are seen from the outside. * The class `Face_filtered_graph` wraps a graph into another graph and act like a mask. It assigns a patch id to each face
* and acts in such a way that only the specified patches are seen from the outside.
* *
* For example, calling `vertices(graph)` will provide the range of vertices belonging to the selected components. * For example, calling `vertices(graph)` will provide the range of vertices belonging to the selected components.
* *
* The `Face_filtered_graph` enables to either consider each patch independently or a union of some of these patches.
* Such a union of patches must define a manifold mesh.
*
* \tparam Graph must be a model of a `FaceListGraph` and `HalfedgeListGraph`. * \tparam Graph must be a model of a `FaceListGraph` and `HalfedgeListGraph`.
* \tparam FIMap a model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor` as key and `graph_traits<Graph>::%faces_size_type` as value * \tparam FIMap a model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor` as key and `graph_traits<Graph>::%faces_size_type` as value
* \tparam VIMap a model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor` as key and `graph_traits<Graph>::%vertices_size_type` as value * \tparam VIMap a model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor` as key and `graph_traits<Graph>::%vertices_size_type` as value
@ -53,7 +57,7 @@ template<typename Graph,
typename FIMap = typename boost::property_map<Graph, CGAL::face_index_t>::type, typename FIMap = typename boost::property_map<Graph, CGAL::face_index_t>::type,
typename VIMap = typename boost::property_map<Graph, boost::vertex_index_t>::type, typename VIMap = typename boost::property_map<Graph, boost::vertex_index_t>::type,
typename HIMap = typename boost::property_map<Graph, CGAL::halfedge_index_t>::type> typename HIMap = typename boost::property_map<Graph, CGAL::halfedge_index_t>::type>
struct Connected_components_graph struct Face_filtered_graph
{ {
typedef boost::graph_traits<Graph> gt; typedef boost::graph_traits<Graph> gt;
typedef typename gt::vertex_descriptor vertex_descriptor; typedef typename gt::vertex_descriptor vertex_descriptor;
@ -63,7 +67,7 @@ struct Connected_components_graph
typedef typename boost::property_traits< FIMap >::value_type face_index_type; typedef typename boost::property_traits< FIMap >::value_type face_index_type;
typedef typename boost::property_traits< VIMap >::value_type vertex_index_type; typedef typename boost::property_traits< VIMap >::value_type vertex_index_type;
typedef typename boost::property_traits< HIMap >::value_type halfedge_index_type; typedef typename boost::property_traits< HIMap >::value_type halfedge_index_type;
typedef Connected_components_graph<Graph, FIMap, VIMap, HIMap> Self; typedef Face_filtered_graph<Graph, FIMap, VIMap, HIMap> Self;
template <typename FaceComponentMap, class IndexRangeIterator> template <typename FaceComponentMap, class IndexRangeIterator>
void base_iterator_constructor(IndexRangeIterator begin, void base_iterator_constructor(IndexRangeIterator begin,
@ -94,6 +98,7 @@ struct Connected_components_graph
} }
} }
} }
CGAL_assertion(is_selection_valid());
} }
template <typename FaceComponentMap> template <typename FaceComponentMap>
@ -116,9 +121,10 @@ struct Connected_components_graph
} }
} }
} }
CGAL_assertion(is_selection_valid());
} }
/*! /*!
* \brief Creates a Connected_components_graph of the connected components of `graph` specified in the range * \brief Creates a Face_filtered_graph of the patches of `graph` specified in the range
* defined by `begin` and `end`. * defined by `begin` and `end`.
* \tparam FaceComponentMap a model of `ReadablePropertyMap` with * \tparam FaceComponentMap a model of `ReadablePropertyMap` with
`boost::graph_traits<Graph>::%face_descriptor` as key type and `boost::graph_traits<Graph>::%face_descriptor` as key type and
@ -126,11 +132,11 @@ struct Connected_components_graph
* \tparam IndexRangeIterator an iterator of a range of `boost::property_traits<FaceComponentMap>::%value_type`. * \tparam IndexRangeIterator an iterator of a range of `boost::property_traits<FaceComponentMap>::%value_type`.
* \param graph the graph containing the wanted patches. * \param graph the graph containing the wanted patches.
* \param fcmap the property_map that assigns a connected component to each face, with * \param fcmap the property_map that assigns a patch to each face, with
`boost::graph_traits<Graph>::%face_descriptor` as key type and `boost::graph_traits<Graph>::%face_descriptor` as key type and
`graph_traits<Graph>::%faces_size_type` as value type. `graph_traits<Graph>::%faces_size_type` as value type.
* \param begin an interator to the beginning of a range of connected components indices of interest. * \param begin an interator to the beginning of a range of patches indices of interest.
* \param end an interator to the element past the end of a range of connected components indices of interest. * \param end an interator to the element past the end of a range of patches indices of interest.
* \param fimap the property map that assigns an index to each face, * \param fimap the property map that assigns an index to each face,
* with boost::graph_traits<Graph>::%face_descriptor as key type and boost::graph_traits<Graph>::%faces_size_type as value type * with boost::graph_traits<Graph>::%face_descriptor as key type and boost::graph_traits<Graph>::%faces_size_type as value type
* \param vimap the property map that assigns an index to each vertex, * \param vimap the property map that assigns an index to each vertex,
@ -140,7 +146,7 @@ struct Connected_components_graph
*/ */
template <typename FaceComponentMap, class IndexRangeIterator> template <typename FaceComponentMap, class IndexRangeIterator>
Connected_components_graph(const Graph& graph, Face_filtered_graph(const Graph& graph,
FaceComponentMap fcmap, FaceComponentMap fcmap,
IndexRangeIterator begin, IndexRangeIterator begin,
IndexRangeIterator end, IndexRangeIterator end,
@ -160,7 +166,7 @@ struct Connected_components_graph
} }
template <typename FaceComponentMap, class IndexRangeIterator> template <typename FaceComponentMap, class IndexRangeIterator>
Connected_components_graph(const Graph& graph, Face_filtered_graph(const Graph& graph,
FaceComponentMap fcmap, FaceComponentMap fcmap,
IndexRangeIterator begin, IndexRangeIterator begin,
IndexRangeIterator end) IndexRangeIterator end)
@ -172,16 +178,16 @@ struct Connected_components_graph
base_iterator_constructor(begin, end, fcmap); base_iterator_constructor(begin, end, fcmap);
} }
/*! /*!
* \brief Creates a Connected_components_graph of the connected component `pid` of `graph`. * \brief Creates a Face_filtered_graph of the patch `pid` of `graph`.
* *
* \tparam FaceComponentMap a model of `ReadablePropertyMap` with * \tparam FaceComponentMap a model of `ReadablePropertyMap` with
`boost::graph_traits<Graph>::%face_descriptor` as key type and `boost::graph_traits<Graph>::%face_descriptor` as key type and
`graph_traits<Graph>::%faces_size_type` as value type. `graph_traits<Graph>::%faces_size_type` as value type.
* \param graph the graph containing the wanted patch. * \param graph the graph containing the wanted patch.
* \param fcmap the property_map that assigns a connected component's index to each face, with * \param fcmap the property_map that assigns a patch's index to each face, with
`boost::graph_traits<Graph>::%face_descriptor` as key type and `boost::graph_traits<Graph>::%face_descriptor` as key type and
`graph_traits<Graph>::%faces_size_type` as value type. `graph_traits<Graph>::%faces_size_type` as value type.
* \param pid the index of the connected component of interest. * \param pid the index of the patch of interest.
* \param fimap the property map that assigns an index to each face, * \param fimap the property map that assigns an index to each face,
* with boost::graph_traits<Graph>::%face_descriptor as key type and boost::graph_traits<Graph>::%faces_size_type as value type * with boost::graph_traits<Graph>::%face_descriptor as key type and boost::graph_traits<Graph>::%faces_size_type as value type
* \param vimap the property map that assigns an index to each vertex, * \param vimap the property map that assigns an index to each vertex,
@ -190,7 +196,7 @@ struct Connected_components_graph
* with boost::graph_traits<Graph>::%halfedge_descriptor as key type and boost::graph_traits<Graph>::%halfedges_size_type as value type * with boost::graph_traits<Graph>::%halfedge_descriptor as key type and boost::graph_traits<Graph>::%halfedges_size_type as value type
*/ */
template <typename FaceComponentMap> template <typename FaceComponentMap>
Connected_components_graph(const Graph& graph, Face_filtered_graph(const Graph& graph,
FaceComponentMap fcmap, FaceComponentMap fcmap,
typename boost::property_traits<FaceComponentMap>::value_type pid, typename boost::property_traits<FaceComponentMap>::value_type pid,
#ifdef DOXYGEN_RUNNING #ifdef DOXYGEN_RUNNING
@ -209,7 +215,7 @@ struct Connected_components_graph
} }
template <typename FaceComponentMap> template <typename FaceComponentMap>
Connected_components_graph(const Graph& graph, Face_filtered_graph(const Graph& graph,
FaceComponentMap fcmap, FaceComponentMap fcmap,
typename boost::property_traits<FaceComponentMap>::value_type pid) typename boost::property_traits<FaceComponentMap>::value_type pid)
: _graph(const_cast<Graph&>(graph)) : _graph(const_cast<Graph&>(graph))
@ -219,9 +225,9 @@ struct Connected_components_graph
himap = get(CGAL::halfedge_index, graph); himap = get(CGAL::halfedge_index, graph);
base_constructor(fcmap, pid); base_constructor(fcmap, pid);
} }
///returns a const reference to the graph of the Connected_components_graph. ///returns a const reference to the graph of the Face_filtered_graph.
const Graph& graph()const{ return _graph; } const Graph& graph()const{ return _graph; }
///returns a reference to the graph of the Connected_components_graph. ///returns a reference to the graph of the Face_filtered_graph.
Graph& graph(){ return _graph; } Graph& graph(){ return _graph; }
///change the selected component ///change the selected component
@ -233,6 +239,7 @@ struct Connected_components_graph
vertex_indices.clear(); vertex_indices.clear();
halfedge_indices.clear(); halfedge_indices.clear();
base_constructor(fcmap, pid); base_constructor(fcmap, pid);
CGAL_assertion(is_selection_valid());
} }
/// change the selected components /// change the selected components
template<class FaceComponentMap, class IndexRangeIterator> template<class FaceComponentMap, class IndexRangeIterator>
@ -244,6 +251,7 @@ struct Connected_components_graph
vertex_indices.clear(); vertex_indices.clear();
halfedge_indices.clear(); halfedge_indices.clear();
base_iterator_constructor(begin, end, fcmap); base_iterator_constructor(begin, end, fcmap);
CGAL_assertion(is_selection_valid());
} }
struct Is_simplex_valid struct Is_simplex_valid
{ {
@ -277,19 +285,19 @@ struct Connected_components_graph
{ {
return halfedge_patch[get(himap, h)]; return halfedge_patch[get(himap, h)];
} }
///returns the number of faces contained in the specified connected components ///returns the number of faces contained in the specified patches
typename boost::graph_traits<Graph>:: typename boost::graph_traits<Graph>::
faces_size_type number_of_faces()const faces_size_type number_of_faces()const
{ {
return face_patch.count(); return face_patch.count();
} }
///returns the number of vertices contained in the specified connected components ///returns the number of vertices contained in the specified patches
typename boost::graph_traits<Graph>:: typename boost::graph_traits<Graph>::
vertices_size_type number_of_vertices()const vertices_size_type number_of_vertices()const
{ {
return vertex_patch.count(); return vertex_patch.count();
} }
///returns the number of halfedges contained in the specified connected components ///returns the number of halfedges contained in the specified patches
typename boost::graph_traits<Graph>:: typename boost::graph_traits<Graph>::
halfedges_size_type number_of_halfedges()const halfedges_size_type number_of_halfedges()const
{ {
@ -341,6 +349,70 @@ struct Connected_components_graph
return bind_property_maps(himap, make_property_map(halfedge_indices) ); return bind_property_maps(himap, make_property_map(halfedge_indices) );
} }
///returns true if around each vertex of the `Face_filtered_graph`,
/// there is only one set of selected faces. In other words, returns true
/// if all the selected faces around a vertex are consecutive.
bool is_selection_valid()
{
BOOST_FOREACH(vertex_descriptor vd, vertices(*this) )
{
face_descriptor first_selected = boost::graph_traits<Graph>::null_face();
bool first_unselected_found(false),
second_unselected_found(false);
//find an unselected face, then find the first selected face.
//Find another unselected face, the next selected face must be the first;
//else this is not valid.
halfedge_descriptor hd = halfedge(vd, _graph);
face_descriptor first_tested = boost::graph_traits<Graph>::null_face();
while(1) //will break if valid, return false if not valid
{
face_descriptor fd = face(hd, _graph);
if(first_tested == boost::graph_traits<Graph>::null_face())
first_tested = fd;
else if(fd == first_tested )
{
//if there is no unselected face, break
if(face_patch[get(fimap, fd)] && !first_unselected_found)
break;
//if there is no selected face, break
else if(!face_patch[get(fimap, fd)] &&
first_selected == boost::graph_traits<Graph>::null_face())
break;
}
if(fd != boost::graph_traits<Graph>::null_face())
{
if(face_patch[get(fimap, fd)])
{
if(first_unselected_found &&
first_selected == boost::graph_traits<Graph>::null_face())
{
first_selected = fd;
}
else if(second_unselected_found)
{
if(fd == first_selected)
break;
else
return false;
}
}
else
{
if(first_selected == boost::graph_traits<Graph>::null_face())
first_unselected_found = true;
else
second_unselected_found = true;
}
}
hd = next(opposite(hd, _graph), _graph);
}
}
return true;
}
private: private:
Graph& _graph; Graph& _graph;
FIMap fimap; FIMap fimap;
@ -363,9 +435,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
struct graph_traits< CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> > struct graph_traits< CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >
{ {
typedef CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> G; typedef CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> G;
typedef boost::graph_traits<Graph> BGTG; typedef boost::graph_traits<Graph> BGTG;
typedef typename BGTG::vertex_descriptor vertex_descriptor; typedef typename BGTG::vertex_descriptor vertex_descriptor;
typedef typename BGTG::halfedge_descriptor halfedge_descriptor; typedef typename BGTG::halfedge_descriptor halfedge_descriptor;
@ -414,8 +486,8 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
struct graph_traits< const CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> > struct graph_traits< const CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >
: public graph_traits< CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> > : public graph_traits< CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >
{}; {};
@ -428,8 +500,8 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
bool bool
in_CC(const typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::face_descriptor f, in_CC(const typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::face_descriptor f,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
return w.is_in_cc(f); return w.is_in_cc(f);
} }
@ -439,8 +511,8 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
bool bool
in_CC(const typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, in_CC(const typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
return w.is_in_cc(h); return w.is_in_cc(h);
} }
@ -450,8 +522,8 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
bool bool
in_CC(const typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e, in_CC(const typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
return w.is_in_cc(halfedge(e, w.graph())); return w.is_in_cc(halfedge(e, w.graph()));
} }
@ -461,8 +533,8 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
bool bool
in_CC(const typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, in_CC(const typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
return w.is_in_cc(v); return w.is_in_cc(v);
} }
@ -473,7 +545,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::vertices_size_type typename boost::graph_traits<Graph>::vertices_size_type
num_vertices(const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) num_vertices(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return w.number_of_vertices(); return w.number_of_vertices();
} }
@ -483,7 +555,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::edges_size_type typename boost::graph_traits<Graph>::edges_size_type
num_edges(const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) num_edges(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return w.number_of_halfedges()/2; return w.number_of_halfedges()/2;
} }
@ -493,13 +565,13 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::degree_size_type typename boost::graph_traits<Graph>::degree_size_type
degree(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, degree(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
CGAL_assertion(in_CC(v, w)); CGAL_assertion(in_CC(v, w));
typename boost::graph_traits<Graph>::degree_size_type v_deg = 0; typename boost::graph_traits<Graph>::degree_size_type v_deg = 0;
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h = halfedge(v, w); typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h = halfedge(v, w);
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor hcirc = h; typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor hcirc = h;
do do
{ {
if(in_CC(hcirc, w)) if(in_CC(hcirc, w))
@ -514,8 +586,8 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::degree_size_type typename boost::graph_traits<Graph>::degree_size_type
out_degree(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, out_degree(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
CGAL_assertion(in_CC(v, w)); CGAL_assertion(in_CC(v, w));
return std::distance(out_edges(v, w).first ,out_edges(v, w).second); return std::distance(out_edges(v, w).first ,out_edges(v, w).second);
@ -526,8 +598,8 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::degree_size_type typename boost::graph_traits<Graph>::degree_size_type
in_degree(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, in_degree(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
CGAL_assertion(in_CC(v, w)); CGAL_assertion(in_CC(v, w));
return std::distance(in_edges(v, w).first ,in_edges(v, w).second); return std::distance(in_edges(v, w).first ,in_edges(v, w).second);
@ -537,9 +609,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor
source(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e, source(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(e, w)); CGAL_assertion(in_CC(e, w));
return source(e, w.graph()); return source(e, w.graph());
@ -549,9 +621,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor
target(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e, target(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(e, w)); CGAL_assertion(in_CC(e, w));
return target(e, w.graph()); return target(e, w.graph());
@ -561,13 +633,13 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
std::pair<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor, bool> std::pair<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor, bool>
edge(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor u, edge(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor u,
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(u, w) && in_CC(v, w)); CGAL_assertion(in_CC(u, w) && in_CC(v, w));
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e = edge(u, v, w.graph()).first; typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e = edge(u, v, w.graph()).first;
bool res = in_CC(e, w); bool res = in_CC(e, w);
return std::make_pair(e, res); return std::make_pair(e, res);
} }
@ -577,13 +649,13 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
CGAL::Iterator_range<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_iterator> CGAL::Iterator_range<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_iterator>
vertices(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) vertices(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
typedef typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_iterator vertex_iterator; typedef typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_iterator vertex_iterator;
typedef typename boost::graph_traits<Graph >::vertex_iterator g_vertex_iterator; typedef typename boost::graph_traits<Graph >::vertex_iterator g_vertex_iterator;
typename Connected_components_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w); typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_vertex_iterator b,e; g_vertex_iterator b,e;
boost::tie(b,e) = vertices(w.graph()); boost::tie(b,e) = vertices(w.graph());
return make_range(vertex_iterator(predicate, b, e), return make_range(vertex_iterator(predicate, b, e),
@ -594,13 +666,13 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
CGAL::Iterator_range<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_iterator> CGAL::Iterator_range<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_iterator>
edges(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) edges(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
typedef typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_iterator edge_iterator; typedef typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_iterator edge_iterator;
typedef typename boost::graph_traits<Graph >::edge_iterator g_edge_iterator; typedef typename boost::graph_traits<Graph >::edge_iterator g_edge_iterator;
typename Connected_components_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w); typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_edge_iterator b,e; g_edge_iterator b,e;
boost::tie(b,e) = edges(w.graph()); boost::tie(b,e) = edges(w.graph());
return make_range(edge_iterator(predicate, b, e), return make_range(edge_iterator(predicate, b, e),
@ -611,15 +683,15 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
CGAL::Iterator_range<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::out_edge_iterator> CGAL::Iterator_range<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::out_edge_iterator>
out_edges(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, out_edges(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
typedef typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::out_edge_iterator out_edge_iterator; typedef typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::out_edge_iterator out_edge_iterator;
typedef typename boost::graph_traits<Graph >::out_edge_iterator g_out_edge_iterator; typedef typename boost::graph_traits<Graph >::out_edge_iterator g_out_edge_iterator;
typename Connected_components_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w); typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_out_edge_iterator b,e; g_out_edge_iterator b,e;
boost::tie(b,e) = out_edges(v, w.graph()); boost::tie(b,e) = out_edges(v, w.graph());
return make_range(out_edge_iterator(predicate, b, e), return make_range(out_edge_iterator(predicate, b, e),
@ -630,15 +702,15 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
CGAL::Iterator_range<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::in_edge_iterator> CGAL::Iterator_range<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::in_edge_iterator>
in_edges(typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, in_edges(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
typedef typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::in_edge_iterator in_edge_iterator; typedef typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::in_edge_iterator in_edge_iterator;
typedef typename boost::graph_traits<Graph >::in_edge_iterator g_in_edge_iterator; typedef typename boost::graph_traits<Graph >::in_edge_iterator g_in_edge_iterator;
typename Connected_components_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w); typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_in_edge_iterator b,e; g_in_edge_iterator b,e;
boost::tie(b,e) = in_edges(v, w.graph()); boost::tie(b,e) = in_edges(v, w.graph());
return make_range(in_edge_iterator(predicate, b, e), return make_range(in_edge_iterator(predicate, b, e),
@ -652,9 +724,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor
edge(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, edge(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(CGAL::in_CC(h, w)); CGAL_assertion(CGAL::in_CC(h, w));
return edge(h, w.graph()); return edge(h, w.graph());
@ -664,9 +736,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor
halfedge(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e, halfedge(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::edge_descriptor e,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(CGAL::in_CC(e, w)); CGAL_assertion(CGAL::in_CC(e, w));
return halfedge(e, w.graph()); return halfedge(e, w.graph());
@ -676,20 +748,20 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor
halfedge(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, halfedge(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(v, w)); CGAL_assertion(in_CC(v, w));
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h = halfedge(v, w.graph()); typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h = halfedge(v, w.graph());
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor hcirc = h; typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor hcirc = h;
do do
{ {
if(in_CC(hcirc, w)) if(in_CC(hcirc, w))
return hcirc; return hcirc;
hcirc = opposite(next(hcirc, w.graph()), w.graph()); hcirc = opposite(next(hcirc, w.graph()), w.graph());
}while(hcirc != h); }while(hcirc != h);
return boost::graph_traits< CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::null_halfedge(); return boost::graph_traits< CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::null_halfedge();
} }
@ -697,13 +769,13 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
std::pair<typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor, bool> std::pair<typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor, bool>
halfedge(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor u, halfedge(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor u,
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v, typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor v,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(u, w) && in_CC(v, w)); CGAL_assertion(in_CC(u, w) && in_CC(v, w));
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h = halfedge(u, v, w.graph()).first; typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h = halfedge(u, v, w.graph()).first;
return std::make_pair(h, in_CC(h, w)); return std::make_pair(h, in_CC(h, w));
} }
@ -712,9 +784,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor
opposite(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, opposite(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(h, w) ); CGAL_assertion(in_CC(h, w) );
return opposite(h, w.graph()); return opposite(h, w.graph());
@ -724,9 +796,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor
source(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, source(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(h, w) ); CGAL_assertion(in_CC(h, w) );
return source(h, w.graph()); return source(h, w.graph());
@ -736,9 +808,9 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::vertex_descriptor
target(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, target(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(h, w) ); CGAL_assertion(in_CC(h, w) );
return target(h, w.graph()); return target(h, w.graph());
@ -748,15 +820,15 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor
next(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, next(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(h, w)); CGAL_assertion(in_CC(h, w));
if(in_CC(next(h, w.graph()), w)) if(in_CC(next(h, w.graph()), w))
return next(h, w.graph()); return next(h, w.graph());
//act as a border //act as a border
typedef typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h_d; typedef typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h_d;
BOOST_FOREACH( h_d hcirc, BOOST_FOREACH( h_d hcirc,
CGAL::halfedges_around_target(target(h, w.graph()), w.graph())) CGAL::halfedges_around_target(target(h, w.graph()), w.graph()))
{ {
@ -765,16 +837,16 @@ next(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMa
return opposite(hcirc, w.graph()); return opposite(hcirc, w.graph());
} }
} }
return boost::graph_traits< CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::null_halfedge(); return boost::graph_traits< CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::null_halfedge();
} }
template<typename Graph, template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor
prev(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, prev(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(in_CC(h, w)); CGAL_assertion(in_CC(h, w));
@ -782,7 +854,7 @@ prev(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMa
return prev(h, w.graph()); return prev(h, w.graph());
//act as a border //act as a border
typedef typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h_d; typedef typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h_d;
BOOST_FOREACH(h_d hcirc, BOOST_FOREACH(h_d hcirc,
CGAL::halfedges_around_source(source(h, w.graph()), w.graph())) CGAL::halfedges_around_source(source(h, w.graph()), w.graph()))
{ {
@ -791,7 +863,7 @@ prev(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMa
return opposite(hcirc, w.graph()); return opposite(hcirc, w.graph());
} }
} }
return boost::graph_traits< CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::null_halfedge(); return boost::graph_traits< CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::null_halfedge();
} }
// //
@ -802,14 +874,14 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
std::pair<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_iterator, std::pair<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_iterator,
typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_iterator> typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_iterator>
halfedges(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) halfedges(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
typedef typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_iterator halfedge_iterator; typedef typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_iterator halfedge_iterator;
typedef typename boost::graph_traits<Graph >::halfedge_iterator g_halfedge_iterator; typedef typename boost::graph_traits<Graph >::halfedge_iterator g_halfedge_iterator;
typename Connected_components_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w); typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
std::pair<g_halfedge_iterator, g_halfedge_iterator> original_halfedges = halfedges(w.graph()); std::pair<g_halfedge_iterator, g_halfedge_iterator> original_halfedges = halfedges(w.graph());
return make_range(halfedge_iterator(predicate, original_halfedges.first, original_halfedges.second), return make_range(halfedge_iterator(predicate, original_halfedges.first, original_halfedges.second),
@ -822,7 +894,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::halfedges_size_type typename boost::graph_traits<Graph>::halfedges_size_type
num_halfedges(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) num_halfedges(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
return w.number_of_halfedges(); return w.number_of_halfedges();
} }
@ -832,24 +904,24 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::face_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::face_descriptor
face(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h, face(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(CGAL::in_CC(h, w)); CGAL_assertion(CGAL::in_CC(h, w));
if(in_CC(face(h,w.graph()), w)) if(in_CC(face(h,w.graph()), w))
return face(h,w.graph()); return face(h,w.graph());
else else
return boost::graph_traits< CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::null_face(); return boost::graph_traits< CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::null_face();
} }
template<typename Graph, template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor
halfedge(typename boost::graph_traits< Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::face_descriptor f, halfedge(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::face_descriptor f,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
CGAL_assertion(CGAL::in_CC(f, w)); CGAL_assertion(CGAL::in_CC(f, w));
return halfedge(f,w.graph()); return halfedge(f,w.graph());
@ -860,13 +932,13 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
Iterator_range<typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::face_iterator> Iterator_range<typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::face_iterator>
faces(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) faces(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
typedef typename boost::graph_traits<Connected_components_graph<Graph, FIMap, VIMap, HIMap> >::face_iterator face_iterator; typedef typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::face_iterator face_iterator;
typedef typename boost::graph_traits<Graph >::face_iterator g_face_iterator; typedef typename boost::graph_traits<Graph >::face_iterator g_face_iterator;
typename Connected_components_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w); typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
std::pair<g_face_iterator, g_face_iterator> original_faces = faces(w.graph()); std::pair<g_face_iterator, g_face_iterator> original_faces = faces(w.graph());
return make_range(face_iterator(predicate, original_faces.first, original_faces.second), return make_range(face_iterator(predicate, original_faces.first, original_faces.second),
@ -880,7 +952,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::graph_traits<Graph>::vertices_size_type typename boost::graph_traits<Graph>::vertices_size_type
num_faces(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w) num_faces(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
{ {
return w.number_of_faces(); return w.number_of_faces();
} }
@ -891,7 +963,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
bool bool
in_CC(const Connected_components_graph<Graph, FIMap, VIMap, HIMap> & w, bool verbose = false) in_CC(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w, bool verbose = false)
{ {
return in_CC(w.graph(),verbose); return in_CC(w.graph(),verbose);
} }
@ -902,7 +974,7 @@ template <class Graph,
typename HIMap, typename HIMap,
class PropertyTag> class PropertyTag>
typename boost::property_map<Graph, PropertyTag >::const_type typename boost::property_map<Graph, PropertyTag >::const_type
get(PropertyTag ptag, const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) get(PropertyTag ptag, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return get(ptag, w.graph()); return get(ptag, w.graph());
} }
@ -913,7 +985,7 @@ template <class Graph,
typename HIMap, typename HIMap,
class PropertyTag> class PropertyTag>
typename boost::property_map<Graph, PropertyTag >::type typename boost::property_map<Graph, PropertyTag >::type
get(PropertyTag ptag, Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) get(PropertyTag ptag, Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return get(ptag, w.graph()); return get(ptag, w.graph());
} }
@ -923,8 +995,8 @@ template <class Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::property_map<Connected_components_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t >::type typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t >::type
get(CGAL::face_index_t, const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) get(CGAL::face_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return w.get_face_index_map(); return w.get_face_index_map();
} }
@ -934,8 +1006,8 @@ template <class Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::property_map<Connected_components_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::type typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t >::type
get(boost::vertex_index_t, const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) get(boost::vertex_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return w.get_vertex_index_map(); return w.get_vertex_index_map();
} }
@ -945,8 +1017,8 @@ template <class Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
typename boost::property_map<Connected_components_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t >::type typename boost::property_map<Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t >::type
get(CGAL::halfedge_index_t, const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w) get(CGAL::halfedge_index_t, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w)
{ {
return w.get_halfedge_index_map(); return w.get_halfedge_index_map();
} }
@ -959,7 +1031,7 @@ template <class Graph,
class PropertyTag> class PropertyTag>
typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::value_type typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::value_type
get(PropertyTag ptag, get(PropertyTag ptag,
const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w,
const typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::key_type& k) const typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::key_type& k)
{ {
return get(ptag, w.graph(), k); return get(ptag, w.graph(), k);
@ -972,7 +1044,7 @@ template <class Graph,
typename HIMap, typename HIMap,
class PropertyTag> class PropertyTag>
void void
put(PropertyTag ptag, const Connected_components_graph<Graph, FIMap, VIMap, HIMap>& w, put(PropertyTag ptag, const Face_filtered_graph<Graph, FIMap, VIMap, HIMap>& w,
const typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::key_type& k, const typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::key_type& k,
typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::value_type& v) typename boost::property_traits<typename boost::property_map<Graph,PropertyTag>::type>::value_type& v)
{ {
@ -987,7 +1059,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap, typename HIMap,
typename PropertyTag> typename PropertyTag>
struct property_map<CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap>,PropertyTag> { struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>,PropertyTag> {
typedef typename boost::property_map<Graph, PropertyTag >::type type; typedef typename boost::property_map<Graph, PropertyTag >::type type;
typedef typename boost::property_map<Graph, PropertyTag >::const_type const_type; typedef typename boost::property_map<Graph, PropertyTag >::const_type const_type;
}; };
@ -997,7 +1069,7 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap, typename HIMap,
typename PropertyTag> typename PropertyTag>
struct graph_has_property<CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap>, PropertyTag> struct graph_has_property<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, PropertyTag>
: graph_has_property<Graph, PropertyTag> {}; : graph_has_property<Graph, PropertyTag> {};
@ -1006,7 +1078,7 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
struct property_map<CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t>{ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::face_index_t>{
typedef typename CGAL::Property_map_binder< FIMap, typedef typename CGAL::Property_map_binder< FIMap,
typename CGAL::Pointer_property_map< typename boost::property_traits< FIMap >::value_type >::type > type; typename CGAL::Pointer_property_map< typename boost::property_traits< FIMap >::value_type >::type > type;
typedef type const_type; typedef type const_type;
@ -1016,7 +1088,7 @@ template<typename Graph,
typename FIMap, typename FIMap,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
struct property_map<CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t>{ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, boost::vertex_index_t>{
typedef typename CGAL::Property_map_binder< VIMap, typedef typename CGAL::Property_map_binder< VIMap,
typename CGAL::Pointer_property_map< typename boost::property_traits< VIMap >::value_type >::type > type; typename CGAL::Pointer_property_map< typename boost::property_traits< VIMap >::value_type >::type > type;
typedef type const_type; typedef type const_type;
@ -1027,10 +1099,10 @@ template<typename Graph,
typename VIMap, typename VIMap,
typename HIMap> typename HIMap>
struct property_map<CGAL::Connected_components_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t>{ struct property_map<CGAL::Face_filtered_graph<Graph, FIMap, VIMap, HIMap>, CGAL::halfedge_index_t>{
typedef typename CGAL::Property_map_binder< HIMap, typedef typename CGAL::Property_map_binder< HIMap,
typename CGAL::Pointer_property_map< typename boost::property_traits< HIMap >::value_type >::type > type; typename CGAL::Pointer_property_map< typename boost::property_traits< HIMap >::value_type >::type > type;
typedef type const_type; typedef type const_type;
}; };
}// namespace boost }// namespace boost
#endif // CGAL_BOOST_GRAPH_CONNECTED_COMPONENTS_GRAPH_H #endif // CGAL_BOOST_GRAPH_FACE_FILTERED_GRAPH_H

View File

@ -87,9 +87,9 @@ create_single_source_cgal_program( "test_Has_member_id.cpp" )
create_single_source_cgal_program( "test_cgal_bgl_named_params.cpp" ) create_single_source_cgal_program( "test_cgal_bgl_named_params.cpp" )
create_single_source_cgal_program( "test_Connected_components_graph.cpp" ) create_single_source_cgal_program( "test_Face_filtered_graph.cpp" )
create_single_source_cgal_program( "graph_concept_Connected_components_graph.cpp" ) create_single_source_cgal_program( "graph_concept_Face_filtered_graph.cpp" )

View File

@ -1,6 +1,6 @@
#include <CGAL/Surface_mesh.h> #include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/Connected_components_graph.h> #include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <boost/graph/graph_concepts.hpp> #include <boost/graph/graph_concepts.hpp>
@ -8,7 +8,7 @@
typedef CGAL::Simple_cartesian<double> K; typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Surface_mesh<K::Point_3> SM; typedef CGAL::Surface_mesh<K::Point_3> SM;
typedef CGAL::Connected_components_graph<SM, SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> > Adapter; typedef CGAL::Face_filtered_graph<SM, SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> > Adapter;
typedef boost::graph_traits< Adapter > Traits; typedef boost::graph_traits< Adapter > Traits;
typedef Traits::edge_descriptor edge_descriptor; typedef Traits::edge_descriptor edge_descriptor;
typedef Traits::halfedge_descriptor halfedge_descriptor; typedef Traits::halfedge_descriptor halfedge_descriptor;

View File

@ -1,4 +1,4 @@
#include <CGAL/boost/graph/Connected_components_graph.h> #include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Polygon_mesh_processing/connected_components.h> #include <CGAL/Polygon_mesh_processing/connected_components.h>
#include <CGAL/boost/graph/copy_face_graph.h> #include <CGAL/boost/graph/copy_face_graph.h>
#include "test_Prefix.h" #include "test_Prefix.h"
@ -15,7 +15,7 @@ template <typename Graph>
void test_halfedge_around_vertex_iterator(const Graph& g) void test_halfedge_around_vertex_iterator(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
boost::unordered_map<g_face_descriptor, std::size_t> map(CGAL::num_faces(g)); boost::unordered_map<g_face_descriptor, std::size_t> map(CGAL::num_faces(g));
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -43,7 +43,7 @@ template <typename Graph>
void test_halfedge_around_face_iterator(const Graph& g) void test_halfedge_around_face_iterator(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -63,7 +63,7 @@ template<typename Graph>
void test_edge_iterators(const Graph& g) void test_edge_iterators(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -89,7 +89,7 @@ template<typename Graph>
void test_vertex_iterators(Graph& g) void test_vertex_iterators(Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -119,7 +119,7 @@ template<typename Graph>
void test_out_edges(const Graph& g) void test_out_edges(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -148,7 +148,7 @@ template<typename Graph>
void test_in_edges(const Graph& g) void test_in_edges(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -175,7 +175,7 @@ template<typename Graph>
void test_in_out_edges(const Graph& g) void test_in_out_edges(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -217,7 +217,7 @@ template<typename Graph>
void test_edge_find(const Graph& g) void test_edge_find(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -241,7 +241,7 @@ template<typename Graph>
void test_faces(const Graph& g) void test_faces(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -267,7 +267,7 @@ template<typename Graph>
void test_read(const Graph& g) void test_read(const Graph& g)
{ {
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor; typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
typedef CGAL::Connected_components_graph<Graph> Adapter; typedef CGAL::Face_filtered_graph<Graph> Adapter;
CGAL_GRAPH_TRAITS_MEMBERS(Adapter); CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
std::map<g_face_descriptor, std::size_t> map; std::map<g_face_descriptor, std::size_t> map;
CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default()); CGAL::Polygon_mesh_processing::connected_components(g, boost::make_assoc_property_map(map), CGAL::Polygon_mesh_processing::parameters::all_default());
@ -397,10 +397,9 @@ void test_mesh(Adapter fga)
int int
main() main()
{ {
test(sm_data()); test(sm_data());
//Make a tetrahedron and test the adapter for a patch that only contains 2 faces //Make a tetrahedron and test the adapter for a patch that only contains 2 faces
typedef typename CGAL::Connected_components_graph<SM> SM_Adapter; typedef typename CGAL::Face_filtered_graph<SM> SM_Adapter;
typedef SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> SM_FCCMap; typedef SM::Property_map<boost::graph_traits<SM>::face_descriptor , std::size_t> SM_FCCMap;
SM* sm = new SM(); SM* sm = new SM();
CGAL::make_tetrahedron( CGAL::make_tetrahedron(
@ -433,7 +432,7 @@ main()
typedef boost::property_map<Polyhedron, CGAL::face_external_index_t>::type FIMap; typedef boost::property_map<Polyhedron, CGAL::face_external_index_t>::type FIMap;
typedef boost::property_map<Polyhedron, CGAL::vertex_external_index_t>::type VIMap; typedef boost::property_map<Polyhedron, CGAL::vertex_external_index_t>::type VIMap;
typedef boost::property_map<Polyhedron, CGAL::halfedge_external_index_t>::type HIMap; typedef boost::property_map<Polyhedron, CGAL::halfedge_external_index_t>::type HIMap;
typedef typename CGAL::Connected_components_graph<Polyhedron, FIMap, VIMap, HIMap> Poly_Adapter; typedef typename CGAL::Face_filtered_graph<Polyhedron, FIMap, VIMap, HIMap> Poly_Adapter;
Polyhedron *poly = new Polyhedron(); Polyhedron *poly = new Polyhedron();
CGAL::make_tetrahedron( CGAL::make_tetrahedron(
Point_3(1,1,1), Point_3(1,1,1),

View File

@ -181,7 +181,7 @@ and <code>src/</code> directories).
<h3>CGAL and the Boost Graph Library (BGL)</h3> <h3>CGAL and the Boost Graph Library (BGL)</h3>
<ul> <ul>
<li> <li>
Add class <code>CGAL::Connected_components_graph</code> that Add class <code>CGAL::Face_filtered_graph</code> that
wraps an existing graph and hide all simplices that are not wraps an existing graph and hide all simplices that are not
in the selected connected components. in the selected connected components.
</li> </li>

View File

@ -607,10 +607,10 @@ the propagation of a connected component index to cross it.
\cgalExample{Polygon_mesh_processing/connected_components_example.cpp} \cgalExample{Polygon_mesh_processing/connected_components_example.cpp}
The second example shows how to use the class template `Connected_components_graph` The second example shows how to use the class template `Face_filtered_graph`
which enables to treat one or several connected components as a face graph. which enables to treat one or several connected components as a face graph.
\cgalExample{Polygon_mesh_processing/connected_components_graph_example.cpp} \cgalExample{Polygon_mesh_processing/face_filtered_graph_example.cpp}
\section PMPDistance Approximate Hausdorff Distance \section PMPDistance Approximate Hausdorff Distance

View File

@ -7,7 +7,7 @@
\example Polygon_mesh_processing/point_inside_example.cpp \example Polygon_mesh_processing/point_inside_example.cpp
\example Polygon_mesh_processing/triangulate_faces_example.cpp \example Polygon_mesh_processing/triangulate_faces_example.cpp
\example Polygon_mesh_processing/connected_components_example.cpp \example Polygon_mesh_processing/connected_components_example.cpp
\example Polygon_mesh_processing/connected_components_graph_example.cpp \example Polygon_mesh_processing/filtered_face_graph_example.cpp
\example Polygon_mesh_processing/polygon_soup_example.cpp \example Polygon_mesh_processing/polygon_soup_example.cpp
\example Polygon_mesh_processing/triangulate_polyline_example.cpp \example Polygon_mesh_processing/triangulate_polyline_example.cpp
\example Polygon_mesh_processing/refine_fair_example.cpp \example Polygon_mesh_processing/refine_fair_example.cpp

View File

@ -90,7 +90,7 @@ create_single_source_cgal_program( "compute_normals_example.cpp" CXX_FEATURES cx
create_single_source_cgal_program( "point_inside_example.cpp") create_single_source_cgal_program( "point_inside_example.cpp")
create_single_source_cgal_program( "triangulate_faces_example.cpp") create_single_source_cgal_program( "triangulate_faces_example.cpp")
create_single_source_cgal_program( "connected_components_example.cpp") create_single_source_cgal_program( "connected_components_example.cpp")
create_single_source_cgal_program( "connected_components_graph_example.cpp") create_single_source_cgal_program( "face_filtered_graph_example.cpp")
create_single_source_cgal_program( "polygon_soup_example.cpp") create_single_source_cgal_program( "polygon_soup_example.cpp")
create_single_source_cgal_program( "triangulate_polyline_example.cpp") create_single_source_cgal_program( "triangulate_polyline_example.cpp")
create_single_source_cgal_program( "mesh_slicer_example.cpp") create_single_source_cgal_program( "mesh_slicer_example.cpp")

View File

@ -2,7 +2,7 @@
#include <CGAL/Surface_mesh.h> #include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_mesh_processing/connected_components.h> #include <CGAL/Polygon_mesh_processing/connected_components.h>
#include <CGAL/boost/graph/Connected_components_graph.h> #include <CGAL/boost/graph/Face_filtered_graph.h>
#include <boost/property_map/property_map.hpp> #include <boost/property_map/property_map.hpp>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
@ -18,7 +18,7 @@ typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
typedef boost::graph_traits<Mesh>::faces_size_type faces_size_type; typedef boost::graph_traits<Mesh>::faces_size_type faces_size_type;
typedef Mesh::Property_map<face_descriptor, faces_size_type> FCCmap; typedef Mesh::Property_map<face_descriptor, faces_size_type> FCCmap;
typedef CGAL::Connected_components_graph<Mesh> CCG; typedef CGAL::Face_filtered_graph<Mesh> CCG;
namespace PMP = CGAL::Polygon_mesh_processing; namespace PMP = CGAL::Polygon_mesh_processing;

View File

@ -1,7 +1,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h> #include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/graph_traits_Surface_mesh.h> #include <CGAL/boost/graph/graph_traits_Surface_mesh.h>
#include <CGAL/boost/graph/Connected_components_graph.h> #include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Polygon_mesh_processing/measure.h> #include <CGAL/Polygon_mesh_processing/measure.h>
#include <CGAL/boost/graph/copy_face_graph.h> #include <CGAL/boost/graph/copy_face_graph.h>
#include <CGAL/mesh_segmentation.h> #include <CGAL/mesh_segmentation.h>
@ -38,7 +38,7 @@ int main(int argc, char** argv )
// Any other scalar values can be used instead of using SDF values computed using the CGAL function // Any other scalar values can be used instead of using SDF values computed using the CGAL function
std::size_t number_of_segments = CGAL::segmentation_from_sdf_values(mesh, sdf_property_map, segment_property_map); std::size_t number_of_segments = CGAL::segmentation_from_sdf_values(mesh, sdf_property_map, segment_property_map);
typedef CGAL::Connected_components_graph<SM> Cc_graph; typedef CGAL::Face_filtered_graph<SM> Cc_graph;
//print area of each segment and then put it in a Mesh and print it in an OFF file //print area of each segment and then put it in a Mesh and print it in an OFF file
Cc_graph segment_mesh(mesh, segment_property_map, 0); Cc_graph segment_mesh(mesh, segment_property_map, 0);
for(std::size_t id = 0; id < number_of_segments; ++id) for(std::size_t id = 0; id < number_of_segments; ++id)