\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.7 - Polygon Mesh Processing
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::keep_connected_components()

Functions

template<typename PolygonMesh , typename ComponentRange , typename FaceComponentMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::keep_connected_components (PolygonMesh &pmesh, const ComponentRange &components_to_keep, const FaceComponentMap &fcm, const NamedParameters &np)
 keeps the connected components designated by theirs ids in components_to_keep, and removes the other connected components as well as all the isolated vertices. More...
 
template<typename PolygonMesh , typename FaceRange , typename NamedParameters >
void CGAL::Polygon_mesh_processing::keep_connected_components (PolygonMesh &pmesh, const FaceRange &components_to_keep, const NamedParameters &np)
 keeps the connected components designated by the faces in components_to_keep, and removes the other connected components and all the isolated vertices. More...
 

Function Documentation

template<typename PolygonMesh , typename ComponentRange , typename FaceComponentMap , typename NamedParameters >
void CGAL::Polygon_mesh_processing::keep_connected_components ( PolygonMesh &  pmesh,
const ComponentRange &  components_to_keep,
const FaceComponentMap &  fcm,
const NamedParameters &  np 
)

keeps the connected components designated by theirs ids in components_to_keep, and removes the other connected components as well as all the isolated vertices.

The connected component id of a face is given by fcm.

Note
If the removal of the connected components makes pmesh a non-manifold surface, then the behavior of this function is undefined.

Property maps for CGAL::vertex_index_t should be either available as internal property map to pmesh or provided as Named Parameters.

Template Parameters
PolygonMesha model of FaceListGraph
NamedParametersa sequence of Named Parameters
ComponentRangea range of ids convertible to std::size
FaceComponentMapa model of ReadWritePropertyMap with boost::graph_traits<PolygonMesh>::face_descriptor as key type and boost::face_index as value type.
Parameters
components_to_keepthe range of ids of connected components to keep
pmeshthe polygon mesh
fcmthe property map with indices of components associated to faces in pmesh. After calling this function, the values of fcm are undefined.
npoptional Named Parameters described below
Named Parameters
vertex_index_mapa property map containing the index of each vertex of pmesh

#include <CGAL/Polygon_mesh_processing/connected_components.h>

template<typename PolygonMesh , typename FaceRange , typename NamedParameters >
void CGAL::Polygon_mesh_processing::keep_connected_components ( PolygonMesh &  pmesh,
const FaceRange &  components_to_keep,
const NamedParameters &  np 
)

keeps the connected components designated by the faces in components_to_keep, and removes the other connected components and all the isolated vertices.

Two faces are considered in the same connected component if they share an edge that is not marked as constrained.

Property maps for CGAL::face_index_t and CGAL::vertex_index_t should be either available as internal property maps to pmesh or provided as Named Parameters.

Note
If the removal of the connected components makes pmesh a non-manifold surface, then the behavior of this function is undefined.
Template Parameters
PolygonMesha model of FaceListGraph
NamedParametersa sequence of Named Parameters
FaceRangea range of boost::graph_traits<PolygonMesh>::face_descriptor indicating the connected components to be kept.
Parameters
pmeshthe polygon mesh
components_to_keepa face range, including one face or more on each component to be kept
npoptional Named Parameters described below
Named Parameters
edge_is_constrained_mapa property map containing the constrained-or-not status of each edge of pmesh
face_index_mapa property map containing the index of each face of pmesh
vertex_index_mapa property map containing the index of each vertex of pmesh

#include <CGAL/Polygon_mesh_processing/connected_components.h>