mirror of https://github.com/CGAL/cgal
replace remaining 'componant' by 'patch'
This commit is contained in:
parent
1f96262d3d
commit
3ab2f10997
|
|
@ -40,7 +40,7 @@ namespace CGAL
|
||||||
* The class `Face_filtered_graph` wraps a graph into another graph and act like a mask. It assigns a patch id to each face
|
* 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.
|
* 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 patches.
|
||||||
*
|
*
|
||||||
* The `Face_filtered_graph` enables to either consider each patch independently or a union of some of these patches.
|
* 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.
|
* Such a union of patches must define a manifold mesh.
|
||||||
|
|
@ -69,15 +69,15 @@ struct Face_filtered_graph
|
||||||
typedef typename boost::property_traits< HIMap >::value_type halfedge_index_type;
|
typedef typename boost::property_traits< HIMap >::value_type halfedge_index_type;
|
||||||
typedef Face_filtered_graph<Graph, FIMap, VIMap, HIMap> Self;
|
typedef Face_filtered_graph<Graph, FIMap, VIMap, HIMap> Self;
|
||||||
|
|
||||||
template <typename FaceComponentMap, class IndexRangeIterator>
|
template <typename FacePatchMap, class IndexRangeIterator>
|
||||||
void base_iterator_constructor(IndexRangeIterator begin,
|
void base_iterator_constructor(IndexRangeIterator begin,
|
||||||
IndexRangeIterator end,
|
IndexRangeIterator end,
|
||||||
FaceComponentMap fcmap)
|
FacePatchMap fcmap)
|
||||||
{
|
{
|
||||||
face_patch.resize(num_faces(_graph));
|
face_patch.resize(num_faces(_graph));
|
||||||
vertex_patch.resize(num_vertices(_graph));
|
vertex_patch.resize(num_vertices(_graph));
|
||||||
halfedge_patch.resize(num_halfedges(_graph));
|
halfedge_patch.resize(num_halfedges(_graph));
|
||||||
boost::unordered_set<typename boost::property_traits<FaceComponentMap>::value_type> pids;
|
boost::unordered_set<typename boost::property_traits<FacePatchMap>::value_type> pids;
|
||||||
for(IndexRangeIterator it = begin;
|
for(IndexRangeIterator it = begin;
|
||||||
it != end;
|
it != end;
|
||||||
++it)
|
++it)
|
||||||
|
|
@ -101,9 +101,9 @@ struct Face_filtered_graph
|
||||||
CGAL_assertion(is_selection_valid());
|
CGAL_assertion(is_selection_valid());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FaceComponentMap>
|
template <typename FacePatchMap>
|
||||||
void base_constructor(FaceComponentMap fcmap,
|
void base_constructor(FacePatchMap fcmap,
|
||||||
typename boost::property_traits<FaceComponentMap>::value_type pid)
|
typename boost::property_traits<FacePatchMap>::value_type pid)
|
||||||
{
|
{
|
||||||
face_patch.resize(num_faces(_graph));
|
face_patch.resize(num_faces(_graph));
|
||||||
vertex_patch.resize(num_vertices(_graph));
|
vertex_patch.resize(num_vertices(_graph));
|
||||||
|
|
@ -126,10 +126,10 @@ struct Face_filtered_graph
|
||||||
/*!
|
/*!
|
||||||
* \brief Creates a Face_filtered_graph of the patches 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 FacePatchMap 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.
|
||||||
* \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<FacePatchMap>::%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 patch to each face, with
|
* \param fcmap the property_map that assigns a patch to each face, with
|
||||||
|
|
@ -145,9 +145,9 @@ struct Face_filtered_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, class IndexRangeIterator>
|
template <typename FacePatchMap, class IndexRangeIterator>
|
||||||
Face_filtered_graph(const Graph& graph,
|
Face_filtered_graph(const Graph& graph,
|
||||||
FaceComponentMap fcmap,
|
FacePatchMap fcmap,
|
||||||
IndexRangeIterator begin,
|
IndexRangeIterator begin,
|
||||||
IndexRangeIterator end,
|
IndexRangeIterator end,
|
||||||
#ifdef DOXYGEN_RUNNING
|
#ifdef DOXYGEN_RUNNING
|
||||||
|
|
@ -165,9 +165,9 @@ struct Face_filtered_graph
|
||||||
base_iterator_constructor(begin, end, fcmap);
|
base_iterator_constructor(begin, end, fcmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FaceComponentMap, class IndexRangeIterator>
|
template <typename FacePatchMap, class IndexRangeIterator>
|
||||||
Face_filtered_graph(const Graph& graph,
|
Face_filtered_graph(const Graph& graph,
|
||||||
FaceComponentMap fcmap,
|
FacePatchMap fcmap,
|
||||||
IndexRangeIterator begin,
|
IndexRangeIterator begin,
|
||||||
IndexRangeIterator end)
|
IndexRangeIterator end)
|
||||||
: _graph(const_cast<Graph&>(graph))
|
: _graph(const_cast<Graph&>(graph))
|
||||||
|
|
@ -180,7 +180,7 @@ struct Face_filtered_graph
|
||||||
/*!
|
/*!
|
||||||
* \brief Creates a Face_filtered_graph of the patch `pid` of `graph`.
|
* \brief Creates a Face_filtered_graph of the patch `pid` of `graph`.
|
||||||
*
|
*
|
||||||
* \tparam FaceComponentMap a model of `ReadablePropertyMap` with
|
* \tparam FacePatchMap 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.
|
||||||
|
|
@ -195,10 +195,10 @@ struct Face_filtered_graph
|
||||||
* \param himap the property map that assigns an index to each halfedge,
|
* \param himap the property map that assigns an index to each halfedge,
|
||||||
* 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 FacePatchMap>
|
||||||
Face_filtered_graph(const Graph& graph,
|
Face_filtered_graph(const Graph& graph,
|
||||||
FaceComponentMap fcmap,
|
FacePatchMap fcmap,
|
||||||
typename boost::property_traits<FaceComponentMap>::value_type pid,
|
typename boost::property_traits<FacePatchMap>::value_type pid,
|
||||||
#ifdef DOXYGEN_RUNNING
|
#ifdef DOXYGEN_RUNNING
|
||||||
FIMap fimap = get(CGAL::face_index, graph),
|
FIMap fimap = get(CGAL::face_index, graph),
|
||||||
VIMap vimap = get(boost::vertex_index, graph),
|
VIMap vimap = get(boost::vertex_index, graph),
|
||||||
|
|
@ -214,10 +214,10 @@ struct Face_filtered_graph
|
||||||
base_constructor(fcmap, pid);
|
base_constructor(fcmap, pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FaceComponentMap>
|
template <typename FacePatchMap>
|
||||||
Face_filtered_graph(const Graph& graph,
|
Face_filtered_graph(const Graph& graph,
|
||||||
FaceComponentMap fcmap,
|
FacePatchMap fcmap,
|
||||||
typename boost::property_traits<FaceComponentMap>::value_type pid)
|
typename boost::property_traits<FacePatchMap>::value_type pid)
|
||||||
: _graph(const_cast<Graph&>(graph))
|
: _graph(const_cast<Graph&>(graph))
|
||||||
{
|
{
|
||||||
fimap = get(CGAL::face_index, graph);
|
fimap = get(CGAL::face_index, graph);
|
||||||
|
|
@ -230,10 +230,10 @@ struct Face_filtered_graph
|
||||||
///returns a reference to the graph of the Face_filtered_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 patch
|
||||||
template<class FaceComponentMap>
|
template<class FacePatchMap>
|
||||||
void set_selected_component(FaceComponentMap fcmap,
|
void set_selected_patch(FacePatchMap fcmap,
|
||||||
typename boost::property_traits<FaceComponentMap>::value_type pid)
|
typename boost::property_traits<FacePatchMap>::value_type pid)
|
||||||
{
|
{
|
||||||
face_indices.clear();
|
face_indices.clear();
|
||||||
vertex_indices.clear();
|
vertex_indices.clear();
|
||||||
|
|
@ -241,9 +241,9 @@ struct Face_filtered_graph
|
||||||
base_constructor(fcmap, pid);
|
base_constructor(fcmap, pid);
|
||||||
CGAL_assertion(is_selection_valid());
|
CGAL_assertion(is_selection_valid());
|
||||||
}
|
}
|
||||||
/// change the selected components
|
/// change the selected patches
|
||||||
template<class FaceComponentMap, class IndexRangeIterator>
|
template<class FacePatchMap, class IndexRangeIterator>
|
||||||
void set_selected_components(FaceComponentMap fcmap,
|
void set_selected_patches(FacePatchMap fcmap,
|
||||||
IndexRangeIterator begin,
|
IndexRangeIterator begin,
|
||||||
IndexRangeIterator end)
|
IndexRangeIterator end)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ int main(int argc, char* argv[])
|
||||||
components.push_back(0);
|
components.push_back(0);
|
||||||
components.push_back(1);
|
components.push_back(1);
|
||||||
|
|
||||||
ccg.set_selected_components(fccmap,components.begin(), components.end());
|
ccg.set_selected_patches(fccmap,components.begin(), components.end());
|
||||||
|
|
||||||
std::cout << "The faces in components 0 and 1 are:" << std::endl;
|
std::cout << "The faces in components 0 and 1 are:" << std::endl;
|
||||||
BOOST_FOREACH(CCG::face_descriptor f, faces(ccg)){
|
BOOST_FOREACH(CCG::face_descriptor f, faces(ccg)){
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ int main(int argc, char** argv )
|
||||||
for(std::size_t id = 0; id < number_of_segments; ++id)
|
for(std::size_t id = 0; id < number_of_segments; ++id)
|
||||||
{
|
{
|
||||||
if(id > 0)
|
if(id > 0)
|
||||||
segment_mesh.set_selected_component(segment_property_map, id);
|
segment_mesh.set_selected_patch(segment_property_map, id);
|
||||||
std::cout << "Segment "<<id<<"'s area is : "<<CGAL::Polygon_mesh_processing::area(segment_mesh)<<std::endl;
|
std::cout << "Segment "<<id<<"'s area is : "<<CGAL::Polygon_mesh_processing::area(segment_mesh)<<std::endl;
|
||||||
SM out;
|
SM out;
|
||||||
CGAL::copy_face_graph(segment_mesh, out);
|
CGAL::copy_face_graph(segment_mesh, out);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue