template<typename Graph, typename FIMap = Default, typename VIMap = Default, typename HIMap = Default>
struct CGAL::Face_filtered_graph< Graph, FIMap, VIMap, HIMap >
The class Face_filtered_graph
is an adaptor that creates a filtered view of a graph by restricting it to a subset of faces.
Contrary to boost::filtered_graph
, this class only requires a way to access the selected faces and will automatically select the edges/halfedges and vertices present in the adapted graph. A vertex is selected if it is incident to at least one selected face. A edge is selected if it is incident to at least a selected face. A halfedge is selected if its edge is selected.
Since this class is a model of the FaceGraph
concept, there is a restriction on the set of selected faces: the adapted graph must define a manifold mesh. In order to check that this condition is verified, you can use the function is_selection_valid()
.
There are two different ways to initialize this class. You can directly provide the set of faces selected, or if you have a face patch map, select the patches of faces. The latter option is convenient if you want to access some connected components of a graph after having called CGAL::Polygon_mesh_processing::connected_components()
.
The documented interface of this class is limited on purpose and free functions of the concept this class is a model of must be used to manipulate it.
A BGL-like named parameter mechanism is used in the constructors of this class. Default values are available but if you need to set them, you can pass for np
CGAL::parameters::face_index_map(fim).halfedge_index_map(him).vertex_index_map(vim)
where fim
, him
, and vim
are the respective index maps. The order of the arguments is not important and any of them can be missing if the default is fine.
- Template Parameters
-
- Is Model Of:
FaceListGraph
HalfedgeListGraph
VertexListGraph
- Examples
- BGL_surface_mesh/surface_mesh_partition.cpp, Polygon_mesh_processing/face_filtered_graph_example.cpp, and Surface_mesh_segmentation/extract_segmentation_into_mesh_example.cpp.
|
template<class NamedParameters = CGAL::parameters::Default_named_parameters> |
| Face_filtered_graph (const Graph &graph, const NamedParameters &np=parameters::default_values()) |
| constructs an empty face filtered graph (no face is selected)
|
|
template<typename FacePatchIndexMap , class FacePatchIndexRange , class NamedParameters = CGAL::parameters::Default_named_parameters> |
| Face_filtered_graph (const Graph &graph, const FacePatchIndexRange &selected_face_patch_indices, FacePatchIndexMap face_patch_index_map, const NamedParameters &np) |
| Constructor where the set of selected faces is specified as a range of patch ids.
|
|
template<typename FacePatchIndexMap , class NamedParameters = CGAL::parameters::Default_named_parameters> |
| Face_filtered_graph (const Graph &graph, typename boost::property_traits< FacePatchIndexMap >::value_type selected_face_patch_index, FacePatchIndexMap face_patch_index_map, const NamedParameters &np) |
| Constructor where the set of selected faces is specified as a patch id.
|
|
template<typename FaceRange , class NamedParameters = CGAL::parameters::Default_named_parameters> |
| Face_filtered_graph (const Graph &graph, const FaceRange &selected_faces, const NamedParameters &np) |
| Constructor where the set of selected faces is specified as a range of face descriptors.
|
|
const Graph & | graph () const |
| returns a const reference to the underlying graph.
|
|
Graph & | graph () |
| returns a reference to the underlying graph.
|
|
template<class FacePatchIndexMap > |
void | set_selected_faces (typename boost::property_traits< FacePatchIndexMap >::value_type face_patch_id, FacePatchIndexMap face_patch_index_map) |
| changes the set of selected faces using a patch id.
|
|
template<class FacePatchIndexRange , class FacePatchIndexMap > |
void | set_selected_faces (const FacePatchIndexRange &selected_face_patch_indices, FacePatchIndexMap face_patch_index_map) |
| changes the set of selected faces using a range of patch ids
|
|
template<class FaceRange > |
void | set_selected_faces (const FaceRange &selection) |
| changes the set of selected faces using a range of face descriptors.
|
|
size_type | number_of_faces () const |
| returns the number of selected faces.
|
|
size_type | number_of_vertices () const |
| returns the number of selected vertices.
|
|
size_type | number_of_halfedges () const |
| returns the number of selected halfedges.
|
|
bool | is_selection_valid () const |
| returns true if around any vertex of a selected face there is at most a single umbrella
|
|
void | invert_selection () |
| inverts the selected status of faces.
|
|