RINGMesh
Version 5.0.0
A programming library for geological model meshes
|
#include <mesh_builder.h>
Public Member Functions | |
void | remove_isolated_vertices () |
Remove vertices not connected to any mesh element. More... | |
Polygon related methods | |
void | create_polygons (const std::vector< index_t > &polygons, const std::vector< index_t > &polygon_ptr) |
index_t | create_polygon (const std::vector< index_t > &vertices) |
Creates a polygon. More... | |
index_t | create_triangles (index_t nb_triangles) |
Creates a contiguous chunk of triangles. More... | |
index_t | create_quads (index_t nb_quads) |
Creates a contiguous chunk of quads. More... | |
void | set_polygon_vertex (const PolygonLocalEdge &polygon_local_edge, index_t vertex_id) |
Sets a vertex of a polygon by local vertex index. More... | |
void | set_polygon_adjacent (const PolygonLocalEdge &polygon_local_edge, index_t specifies) |
Sets an adjacent polygon by both its polygon. More... | |
void | clear_polygons (bool keep_attributes, bool keep_memory) |
Removes all the polygons and attributes. More... | |
void | connect_polygons () |
Retrieve the adjacencies of polygons. More... | |
void | connect_polygons (const std::vector< index_t > &polygons_to_connect) |
void | permute_polygons (const std::vector< index_t > &permutation) |
void | delete_polygons (const std::vector< bool > &to_delete, bool remove_isolated_vertices) |
Deletes a set of polygons. More... | |
SurfaceMesh algorithms | |
virtual void | remove_small_connected_components (double min_area, index_t min_polygons)=0 |
Removes the connected components that have an area smaller than a given threshold. More... | |
virtual void | triangulate (const SurfaceMeshBase< DIMENSION > &surface_in)=0 |
Public Member Functions inherited from RINGMesh::MeshBaseBuilder< DIMENSION > | |
virtual | ~MeshBaseBuilder ()=default |
template<> | |
std::unique_ptr< MeshBaseBuilder< 2 > > RINGMESH_API | create_builder (MeshBase< 2 > &mesh) |
template<> | |
std::unique_ptr< MeshBaseBuilder< 3 > > RINGMESH_API | create_builder (MeshBase< 3 > &mesh) |
void | copy (const MeshBase< DIMENSION > &rhs, bool copy_attributes) |
Copy a mesh into this one. More... | |
virtual void | load_mesh (const std::string &filename)=0 |
void | clear (bool keep_attributes, bool keep_memory) |
Removes all the entities and attributes of this mesh. More... | |
void | repair (GEO::MeshRepairMode mode, double colocate_epsilon) |
Fixes some defaults in a mesh. More... | |
void | set_vertex (index_t v_id, const vecn< DIMENSION > &vertex) |
Sets a point. More... | |
index_t | create_vertex () |
Creates a new vertex. More... | |
index_t | create_vertex (const vecn< DIMENSION > &vertex) |
Creates a new vertex. More... | |
index_t | create_vertices (index_t nb) |
Creates a contiguous chunk of vertices. More... | |
void | assign_vertices (const std::vector< double > &point_coordinates) |
set vertex coordinates from a std::vector of coordinates More... | |
void | delete_vertices (const std::vector< bool > &to_delete) |
Deletes a set of vertices. More... | |
void | clear_vertices (bool keep_attributes, bool keep_memory) |
Removes all the vertices and attributes. More... | |
void | permute_vertices (const std::vector< index_t > &permutation) |
Static Public Member Functions | |
static std::unique_ptr< SurfaceMeshBuilder< DIMENSION > > | create_builder (SurfaceMesh< DIMENSION > &mesh) |
Static Public Member Functions inherited from RINGMesh::MeshBaseBuilder< DIMENSION > | |
static std::unique_ptr< MeshBaseBuilder< DIMENSION > > | create_builder (MeshBase< DIMENSION > &mesh) |
Protected Member Functions | |
SurfaceMeshBuilder (SurfaceMeshBase< DIMENSION > &mesh) | |
Protected Member Functions inherited from RINGMesh::MeshBaseBuilder< DIMENSION > | |
MeshBaseBuilder (MeshBase< DIMENSION > &mesh) | |
void | delete_vertex_nn_search () |
Protected Attributes | |
SurfaceMeshBase< DIMENSION > & | surface_mesh_ |
Protected Attributes inherited from RINGMesh::MeshBaseBuilder< DIMENSION > | |
MeshBase< DIMENSION > & | mesh_base_ |
Private Member Functions | |
void | delete_polygon_nn_search () |
Deletes the NNSearch on polygons. More... | |
void | delete_polygon_aabb () |
Deletes the AABB on polygons. More... | |
void | clear_vertex_linked_objects () override |
Deletes the NNSearch on vertices. More... | |
void | clear_polygon_linked_objects () |
virtual void | do_create_polygons (const std::vector< index_t > &polygons, const std::vector< index_t > &polygon_ptr)=0 |
virtual index_t | do_create_polygon (const std::vector< index_t > &vertices)=0 |
Creates a polygon. More... | |
virtual index_t | do_create_triangles (index_t nb_triangles)=0 |
Creates a contiguous chunk of triangles. More... | |
virtual index_t | do_create_quads (index_t nb_quads)=0 |
Creates a contiguous chunk of quads. More... | |
virtual void | do_set_polygon_vertex (const PolygonLocalEdge &polygon_local_edge, index_t vertex_id)=0 |
Sets a vertex of a polygon by local vertex index. More... | |
virtual void | do_set_polygon_adjacent (const PolygonLocalEdge &polygon_local_edge, index_t specifies)=0 |
Sets an adjacent polygon by both its polygon. More... | |
virtual void | do_clear_polygons (bool keep_attributes, bool keep_memory)=0 |
Removes all the polygons and attributes. More... | |
virtual void | do_permute_polygons (const std::vector< index_t > &permutation)=0 |
virtual void | do_delete_polygons (const std::vector< bool > &to_delete)=0 |
Deletes a set of polygons. More... | |
Definition at line 515 of file mesh_builder.h.
|
inlineexplicitprotected |
Definition at line 777 of file mesh_builder.h.
|
inlineprivate |
Definition at line 805 of file mesh_builder.h.
|
inline |
Removes all the polygons and attributes.
[in] | keep_attributes | if true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed. |
[in] | keep_memory | if true, then memory is kept and can be reused by subsequent mesh entity creations. |
Definition at line 609 of file mesh_builder.h.
|
inlineoverrideprivatevirtual |
Deletes the NNSearch on vertices.
Implements RINGMesh::MeshBaseBuilder< DIMENSION >.
Definition at line 799 of file mesh_builder.h.
|
inline |
Retrieve the adjacencies of polygons.
Definition at line 617 of file mesh_builder.h.
|
inline |
Definition at line 625 of file mesh_builder.h.
|
static |
Definition at line 178 of file mesh_builder.cpp.
|
inline |
Creates a polygon.
[in] | vertices | a const reference to a vector that contains the vertices |
Definition at line 543 of file mesh_builder.h.
|
inline |
brief create polygons
[in] | polygons | is the vector of vertex index for each polygon |
[in] | polygon_ptr | is the vector addressing the first polygon vertex for each polygon. |
Definition at line 531 of file mesh_builder.h.
|
inline |
Creates a contiguous chunk of quads.
[in] | nb_quads | number of quads to create |
Definition at line 565 of file mesh_builder.h.
|
inline |
Creates a contiguous chunk of triangles.
[in] | nb_triangles | number of triangles to create |
Definition at line 554 of file mesh_builder.h.
|
inlineprivate |
Deletes the AABB on polygons.
Definition at line 794 of file mesh_builder.h.
|
inlineprivate |
Deletes the NNSearch on polygons.
Definition at line 786 of file mesh_builder.h.
|
inline |
Deletes a set of polygons.
[in] | to_delete | a vector of size nb(). If to_delete[e] is true, then entity e will be destroyed, else it will be kept. |
[in] | remove_isolated_vertices | if true, then the vertices that are no longer incident to any entity are deleted. |
Definition at line 730 of file mesh_builder.h.
|
privatepure virtual |
Removes all the polygons and attributes.
[in] | keep_attributes | if true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed. |
[in] | keep_memory | if true, then memory is kept and can be reused by subsequent mesh entity creations. |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Creates a polygon.
[in] | vertices | a const reference to a vector that contains the vertices |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
brief create polygons
[in] | polygons | is the vector of vertex index for each polygon |
[in] | polygon_ptr | is the vector addressing the first polygon vertex for each polygon. |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Creates a contiguous chunk of quads.
[in] | nb_quads | number of quads to create |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Creates a contiguous chunk of triangles.
[in] | nb_triangles | number of triangles to create |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Deletes a set of polygons.
[in] | to_delete | a vector of size nb(). If to_delete[e] is true, then entity e will be destroyed, else it will be kept. |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Sets an adjacent polygon by both its polygon.
polygon_id | and its local edge index | |
edge_id. | ||
[in] | polygon_local_edge | the polygon index and the local index of an edge. |
[in] | specifies | the polygon adjacent to |
polygon_id | along edge | |
edge_id | or GEO::NO_FACET if the parameter | |
edge_id | is on the border. |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
privatepure virtual |
Sets a vertex of a polygon by local vertex index.
[in] | polygon_local_edge | the polygon index and the local index of an edge. Local index between 0 and nb_vertices(cell_id) - 1. |
[in] | vertex_id | specifies the vertex |
local_vertex_id | of the polygon | |
polygon_id. | Index between 0 and nb() - 1. |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
inline |
Definition at line 716 of file mesh_builder.h.
|
inline |
Remove vertices not connected to any mesh element.
Definition at line 761 of file mesh_builder.h.
|
pure virtual |
Removes the connected components that have an area smaller than a given threshold.
[in] | min_area | the connected components with an area smaller than this threshold are removed |
[in] | min_polygons | the connected components with less than |
min_polygons | polygons are removed |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
inline |
Sets an adjacent polygon by both its polygon.
polygon_id | and its local edge index | |
edge_id. | ||
[in] | polygon_local_edge | the polygon index and local index of an edge. |
[in] | specifies | the polygon adjacent to |
polygon_id | along edge | |
edge_id | or GEO::NO_FACET if the parameter | |
edge_id | is on the border. |
Definition at line 596 of file mesh_builder.h.
|
inline |
Sets a vertex of a polygon by local vertex index.
[in] | polygon_local_edge | the polygon index and local index of an edge. Local index between 0 and nb_vertices(cell_id) - 1. |
[in] | vertex_id | specifies the vertex |
local_vertex_id | of the polygon | |
polygon_id. | Index between 0 and nb() - 1. |
Definition at line 580 of file mesh_builder.h.
|
pure virtual |
Implemented in RINGMesh::GeogramSurfaceMeshBuilder< DIMENSION >.
|
protected |
Definition at line 884 of file mesh_builder.h.