A connected component of a SurfaceMesh.
More...
#include <easy3d/algo/surface_mesh_components.h>
|
| SurfaceMeshComponent (SurfaceMesh *mesh) |
| Constructor that initializes the component with a given mesh.
|
|
const std::vector< Face > & | faces () const |
| Returns the list of faces in this component.
|
|
const std::vector< Vertex > & | vertices () const |
| Returns the list of vertices in this component.
|
|
const std::vector< Edge > & | edges () const |
| Returns the list of edges in this component.
|
|
const std::vector< Halfedge > & | halfedges () const |
| Returns the list of halfedges in this component.
|
|
std::size_t | n_faces () const |
| Returns the number of faces in this component.
|
|
std::size_t | n_vertices () const |
| Returns the number of vertices in this component.
|
|
std::size_t | n_edges () const |
| Returns the number of edges in this component.
|
|
std::size_t | n_halfedges () const |
| Returns the number of halfedges in this component.
|
|
SurfaceMesh * | mesh () const |
| Returns the surface mesh to which this component belongs.
|
|
float | area () const |
| Returns the surface area of this component.
|
|
float | border_length () const |
| Returns the total border length of this component.
|
|
Box3 | bbox () const |
| Returns the bounding box of this component.
|
|
void | translate (const vec3 &offset) |
| Translates this component by an offset vector.
|
|
SurfaceMesh * | to_mesh () const |
| Constructs a surface mesh from this component.
|
|
A connected component of a SurfaceMesh.
Internally, A connected component of a SurfaceMesh stores four lists of SurfaceMesh elements, i.e., vertices, faces, edges, and halfedges.
◆ SurfaceMeshComponent()
Constructor that initializes the component with a given mesh.
- Parameters
-
mesh | The surface mesh to which this component belongs. |
◆ area()
Returns the surface area of this component.
Internally it triangulates the face using the tessellator. So this method also works for concave faces.
- Returns
- The surface area.
◆ bbox()
Returns the bounding box of this component.
- Returns
- The bounding box.
◆ border_length()
float border_length |
( |
| ) |
const |
Returns the total border length of this component.
- Returns
- The total border length.
◆ edges()
const std::vector< Edge > & edges |
( |
| ) |
const |
|
inline |
Returns the list of edges in this component.
- Returns
- A constant reference to the vector of edges.
◆ extract() [1/3]
Extracts connected components from the given mesh.
- Parameters
-
mesh | The surface mesh from which to extract components. |
descending | If true, the components are sorted in descending order by the number of faces. |
- Returns
- A vector of extracted SurfaceMeshComponent objects.
- Examples
- Tutorial_204_Viewer_Qt/main.cpp.
◆ extract() [2/3]
Extracts a single connected component from the given seed face.
- Parameters
-
mesh | The surface mesh from which to extract the component. |
seed | The seed face to start the extraction. |
- Returns
- The extracted SurfaceMeshComponent object.
◆ extract() [3/3]
Extracts a single connected component from the given seed vertex.
- Parameters
-
mesh | The surface mesh from which to extract the component. |
seed | The seed vertex to start the extraction. |
- Returns
- The extracted SurfaceMeshComponent object.
◆ faces()
const std::vector< Face > & faces |
( |
| ) |
const |
|
inline |
Returns the list of faces in this component.
- Returns
- A constant reference to the vector of faces.
◆ halfedges()
const std::vector< Halfedge > & halfedges |
( |
| ) |
const |
|
inline |
Returns the list of halfedges in this component.
- Returns
- A constant reference to the vector of halfedges.
◆ mesh()
Returns the surface mesh to which this component belongs.
- Returns
- A pointer to the surface mesh.
◆ n_edges()
std::size_t n_edges |
( |
| ) |
const |
|
inline |
Returns the number of edges in this component.
- Returns
- The number of edges.
◆ n_faces()
std::size_t n_faces |
( |
| ) |
const |
|
inline |
Returns the number of faces in this component.
- Returns
- The number of faces.
◆ n_halfedges()
std::size_t n_halfedges |
( |
| ) |
const |
|
inline |
Returns the number of halfedges in this component.
- Returns
- The number of halfedges.
◆ n_vertices()
std::size_t n_vertices |
( |
| ) |
const |
|
inline |
Returns the number of vertices in this component.
- Returns
- The number of vertices.
◆ to_mesh()
Constructs a surface mesh from this component.
- Returns
- A pointer to the constructed surface mesh.
◆ translate()
void translate |
( |
const vec3 & | offset | ) |
|
Translates this component by an offset vector.
- Parameters
-
◆ vertices()
const std::vector< Vertex > & vertices |
( |
| ) |
const |
|
inline |
Returns the list of vertices in this component.
- Returns
- A constant reference to the vector of vertices.
The documentation for this class was generated from the following files: