CGAL 6.2 - Shape Detection: CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap > Class Template Reference

CGAL 6.2 - Shape Detection

Loading...
Searching...
No Matches
List of all members
CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap > Class Template Reference
Reference Manual » Region Growing » Polygon Mesh

`#include <CGAL/Shape_detection/Region_growing/Polygon_mesh/Plane_face_region.h>`

## Definition

template<typename GeomTraits, typename PolygonMesh, typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>
class CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >

Region type based on the plane of the first face selected.

This class uses the supporting plane of the first face picked for the region and expands it for all faces with a normal close to that of the first face ("close" being defined by the `maximum_distance` parameter), and such that vertices are not far from that supporting plane (far being defined by the `maximum_angle` or `cosine_of_maximum_angle` parameter).

Template Parameters

  GeomTraits | a model of `Kernel`
  PolygonMesh | a model of `FaceListGraph`
  VertexToPointMap | a model of `ReadablePropertyMap` whose key type is the vertex type of a polygon mesh (`boost::graph_traits<PolygonMesh>::vertex_descriptor`) and value type is `GeomTraits::Point_3`

Is model of
  `RegionType`

Examples
  Shape_detection/region_growing_lines_on_segment_set.cpp, and Shape_detection/region_growing_planes_on_polygon_mesh.cpp.

## Types
using | FT = typename GeomTraits::FT
| Number type.
using | Item = face_descriptor
| Item type.
using | Region = std::vector< Item >
using | Primitive = typename GeomTraits::Plane_3
| Primitive.
using | Region_index_map = typename boost::property_map< PolygonMesh, CGAL::dynamic_face_property_t< std::size_t > >::const_type
| Region map.

## Initialization
template<typename NamedParameters = CGAL::parameters::Default_named_parameters>
| Plane_face_region (const PolygonMesh &pmesh, const NamedParameters &np=parameters::default_values())
| initializes all internal data structures.

## Access
Region_index_map | region_index_map ()
| implements `RegionType::region_index_map()`.
Primitive | primitive () const
| implements `RegionType::primitive()`.
bool | is_part_of_region (const Item query, const Region &) const
| implements `RegionType::is_part_of_region()`.
bool | is_valid_region (const Region &region) const
| implements `RegionType::is_valid_region()`.
bool | update (const Region &region)
| implements `RegionType::update()`.

## Constructor & Destructor Documentation

## ◆ Plane_face_region()

template<typename GeomTraits , typename PolygonMesh , typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>
template<typename NamedParameters = CGAL::parameters::Default_named_parameters>

CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >::Plane_face_region | ( | const PolygonMesh & | pmesh,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

initializes all internal data structures.

Template Parameters

  NamedParameters | a sequence of Named Parameters

Parameters

  pmesh | an instance of `PolygonMesh` that represents a polygon mesh
  np | a sequence of Named Parameters among the ones listed below

Optional Named Parameters

  the maximum distance from a point to the plane of the primitive Type: `GeomTraits::FT` Default: 1 |
  the maximum angle in degrees between the normal of a face and the normal of the plane of the primitive Type: `GeomTraits::FT` Default: 25 degrees |
  the cosine value `cos(maximum_angle * PI / 180)`, to be used instead of the parameter `maximum_angle()` Type: `GeomTraits::FT` Default: `cos(25 * PI / 180)` |
  the minimum number of faces a region must have Type: `std::size_t` Default: 1 |
  an instance of `VertexToPointMap` that maps a polygon mesh vertex (`boost::graph_traits<PolygonMesh>::vertex_descriptor`) to `GeomTraits::Point_3` Default: `boost::get(CGAL::vertex_point, pmesh)` |
  a property map associating normal vectors to the faces of `pmesh`. Type: a class model of `ReadablePropertyMap` with `boost::graph_traits<PolygonMesh>::face_descriptor` as key type and `GeomTraits::Vector_3` as value type. Default: If this parameter is omitted, face normals will be estimated using cross products of vectors created from consecutive vertices of the face. |
  an instance of `GeomTraits` Default: `GeomTraits()` |

Precondition
  `faces(pmesh).size() > 0`
  `maximum_distance >= 0`
  `maximum_angle >= 0 && maximum_angle <= 90`
  `cosine_of_maximum_angle >= 0 && cosine_of_maximum_angle <= 1`
  `minimum_region_size > 0`

## Member Function Documentation

## ◆ is_part_of_region()

template<typename GeomTraits , typename PolygonMesh , typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>

bool CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >::is_part_of_region | ( | const Item | query,
|  | const Region & |
| ) |  | const

implements `RegionType::is_part_of_region()`.

This function determines if the face `query` is within the `maximum_distance` from the corresponding plane and if the angle between its normal and the plane's normal is below the `maximum_angle`. If both conditions are satisfied, it returns `true`, otherwise `false`.

Parameters

  query | item of the query face

Precondition
  `query` is a valid face_descriptor (`boost::graph_traits<PolygonMesh>::face_descriptor`) of `pmesh`

## ◆ is_valid_region()

template<typename GeomTraits , typename PolygonMesh , typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>

bool CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >::is_valid_region | ( | const Region & | region | ) | const

implements `RegionType::is_valid_region()`.

This function controls if the `region` contains at least `minimum_region_size` faces.

Parameters

  region | Faces of the region represented as `Items`.

## ◆ primitive()

template<typename GeomTraits , typename PolygonMesh , typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>

Primitive CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >::primitive | ( |  | ) | const

implements `RegionType::primitive()`.

This function provides the support plane of the seed face.

Returns
  Primitive parameters that fits the region.

Precondition
  is_valid_region(region)
  update(region)

## ◆ region_index_map()

template<typename GeomTraits , typename PolygonMesh , typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>

Region_index_map CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >::region_index_map | ( |  | ) |

implements `RegionType::region_index_map()`.

This function creates an empty property map that maps each face to a `std::size_t`.

## ◆ update()

template<typename GeomTraits , typename PolygonMesh , typename VertexToPointMap = typename boost::property_map<PolygonMesh, CGAL::vertex_point_t>::const_type>

bool CGAL::Shape_detection::Polygon_mesh::Plane_face_region< GeomTraits, PolygonMesh, VertexToPointMap >::update | ( | const Region & | region | ) |

implements `RegionType::update()`.

This function uses the support plane of the seed face as primitive.

Parameters

  region | Faces of the region represented as `Items`.

Returns
  Boolean `true` if the seed face is not degenerated and `false` otherwise

Precondition
  `region.size() > 0`