CGAL 5.5.2 - Shape Detection
CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query< PolygonMesh, FaceRange > Class Template Reference

#include <CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/One_ring_neighbor_query.h>

Definition

template<typename PolygonMesh, typename FaceRange = typename PolygonMesh::Face_range>
class CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query< PolygonMesh, FaceRange >

Edge-adjacent faces connectivity in a polygon mesh.

This class returns all faces, which are edge-adjacent to a query face in a polygon mesh being a PolygonMesh.

Template Parameters
PolygonMeshmust be a model of FaceListGraph.
FaceRangemust be a model of ConstRange whose iterator type is RandomAccessIterator and value type is the face type of a polygon mesh.
Is Model Of:
NeighborQuery
Examples:
Shape_detection/region_growing_planes_on_polygon_mesh.cpp.

Initialization

 One_ring_neighbor_query (const PolygonMesh &pmesh)
 initializes all internal data structures. More...
 

Access

void operator() (const std::size_t query_index, std::vector< std::size_t > &neighbors) const
 implements NeighborQuery::operator()(). More...
 

Constructor & Destructor Documentation

◆ One_ring_neighbor_query()

template<typename PolygonMesh , typename FaceRange = typename PolygonMesh::Face_range>
CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query< PolygonMesh, FaceRange >::One_ring_neighbor_query ( const PolygonMesh &  pmesh)

initializes all internal data structures.

Parameters
pmeshan instance of a PolygonMesh that represents a polygon mesh
Precondition
faces(pmesh).size() > 0

Member Function Documentation

◆ operator()()

template<typename PolygonMesh , typename FaceRange = typename PolygonMesh::Face_range>
void CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query< PolygonMesh, FaceRange >::operator() ( const std::size_t  query_index,
std::vector< std::size_t > &  neighbors 
) const

implements NeighborQuery::operator()().

This operator retrieves indices of all faces, which are edge-adjacent to the face with the index query_index. These indices are returned in neighbors.

Parameters
query_indexindex of the query face
neighborsindices of faces, which are neighbors of the query face
Precondition
query_index >= 0 && query_index < faces(pmesh).size()