CGAL 4.7 - Polygon Mesh Processing: CGAL::keep_connected_components()

\( \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
Functions
CGAL::keep_connected_components()
Polygon Mesh Processing Reference

##

## 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

  PolygonMesh | a model of `FaceListGraph`
  NamedParameters | a sequence of Named Parameters
  ComponentRange | a range of ids convertible to `std::size`
  FaceComponentMap | a model of `ReadWritePropertyMap` with `boost::graph_traits<PolygonMesh>::face_descriptor` as key type and `boost::face_index` as value type.

Parameters

  components_to_keep | the range of ids of connected components to keep
  pmesh | the polygon mesh
  fcm | the property map with indices of components associated to faces in `pmesh`. After calling this function, the values of `fcm` are undefined.
  np | optional Named Parameters described below

Named Parameters

  vertex_index_map | a 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

  PolygonMesh | a model of `FaceListGraph`
  NamedParameters | a sequence of Named Parameters
  FaceRange | a range of `boost::graph_traits<PolygonMesh>::face_descriptor` indicating the connected components to be kept.

Parameters

  pmesh | the polygon mesh
  components_to_keep | a face range, including one face or more on each component to be kept
  np | optional Named Parameters described below

Named Parameters

  edge_is_constrained_map | a property map containing the constrained-or-not status of each edge of `pmesh`
  face_index_map | a property map containing the index of each face of `pmesh`
  vertex_index_map | a property map containing the index of each vertex of `pmesh`

`#include <CGAL/Polygon_mesh_processing/connected_components.h>`