RINGMesh
Version 5.0.0
A programming library for geological model meshes
|
#include <geomodel_mesh.h>
Public Member Functions | |
virtual | ~GeoModelMeshPolygonsBase () |
GEO::AttributesManager & | attribute_manager () const |
bool | is_initialized () const |
void | test_and_initialize () const |
index_t | nb () const |
Number of polygons stored. More... | |
index_t | nb_vertices (index_t polygon) const |
index_t | vertex (const ElementLocalVertex &polygon_local_vertex) const |
index_t | adjacent (const PolygonLocalEdge &polygon_local_edge) const |
index_t | surface (index_t polygon) const |
index_t | index_in_surface (index_t polygon) const |
std::tuple< PolygonType, index_t > | type (index_t polygon) const |
index_t | nb_polygons (PolygonType type=PolygonType::UNDEFINED) const |
index_t | nb_polygons (index_t surface, PolygonType type=PolygonType::UNDEFINED) const |
index_t | polygon (index_t surface, index_t polygon, PolygonType type=PolygonType::UNDEFINED) const |
index_t | nb_triangle () const |
index_t | nb_triangle (index_t surface) const |
index_t | triangle (index_t surface, index_t triangle) const |
index_t | nb_quad () const |
index_t | nb_quad (index_t surface) const |
index_t | quad (index_t surface, index_t quad) const |
index_t | nb_unclassified_polygon () const |
index_t | nb_unclassified_polygon (index_t surface) const |
index_t | unclassified_polygon (index_t surface, index_t polygon) const |
void | clear () |
vecn< DIMENSION > | center (index_t polygon) const |
double | area (index_t polygon) const |
const NNSearch< DIMENSION > & | nn_search () const |
const SurfaceAABBTree< DIMENSION > & | aabb () const |
return the AABB tree for the polygons of the mesh More... | |
Protected Member Functions | |
GeoModelMeshPolygonsBase (GeoModelMesh< DIMENSION > &gmm, GeoModel< DIMENSION > &gm, std::unique_ptr< SurfaceMesh< DIMENSION > > &mesh) | |
Protected Member Functions inherited from RINGMesh::GeoModelMeshCommon< DIMENSION > | |
GeoModelMeshCommon (GeoModelMesh< DIMENSION > &gmm, GeoModel< DIMENSION > &geomodel) | |
virtual | ~GeoModelMeshCommon ()=default |
void | set_mesh (MeshBase< DIMENSION > *mesh) |
void | save_mesh (const std::string &filename) const |
Protected Attributes | |
std::unique_ptr< SurfaceMesh< DIMENSION > > & | mesh_ |
Attached Mesh. More... | |
std::vector< index_t > | surface_id_ |
Vector storing the surface index per polygon. More... | |
std::vector< index_t > | polygon_id_ |
Vector storing the polygon index in surface per polygon. More... | |
std::vector< index_t > | surface_polygon_ptr_ |
index_t | nb_triangles_ { 0 } |
Number of triangles in the GeoModelMesh. More... | |
index_t | nb_quads_ { 0 } |
Number of quads in the GeoModelMesh. More... | |
index_t | nb_unclassified_polygons_ { 0 } |
Number of unclassified polygons in the GeoModelMesh. More... | |
Protected Attributes inherited from RINGMesh::GeoModelMeshCommon< DIMENSION > | |
GeoModelMesh< DIMENSION > & | gmm_ |
Attached GeoModelMesh. More... | |
GeoModel< DIMENSION > & | geomodel_ |
Attached GeoModel. More... | |
MeshBase< DIMENSION > * | mesh_base_ |
Attached MeshBase. More... | |
Private Member Functions | |
ringmesh_disable_copy_and_move (GeoModelMeshPolygonsBase) | |
void | initialize () |
void | resize_polygones_data () |
void | clear_polygones_data () |
void | disconnect_along_lines () |
Removes polygon adjacencies along lines. More... | |
void | sort_polygons () |
Sorts the polygons by surface and type Permute polygons to sort them per surface and per type Example for a mesh with two surfaces and only triangles and quads [TRGL,TRGL, .. , QUAD, QUAD .. , TRGL, TRGL, ... , QUAD, QUAD ..] | surface 0 | surface 1 |. More... | |
Static Private Attributes | |
static const std::string | surface_att_name |
static const std::string | polygon_surface_att_name |
Friends | |
class | GeoModelMeshBase< DIMENSION > |
class | GeoModelMesh< DIMENSION > |
Definition at line 538 of file geomodel_mesh.h.
|
virtual |
Definition at line 2016 of file geomodel_mesh.cpp.
|
protected |
Definition at line 2006 of file geomodel_mesh.cpp.
const SurfaceAABBTree< DIMENSION > & RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::aabb | ( | ) | const |
return the AABB tree for the polygons of the mesh
Definition at line 2544 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::adjacent | ( | const PolygonLocalEdge & | polygon_local_edge | ) | const |
Get the adjacent polygon index in the GeoModelMesh
[in] | polygon_local_edge | in the polygon |
Definition at line 2071 of file geomodel_mesh.cpp.
double RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::area | ( | index_t | polygon | ) | const |
Get the area of the polygon
[in] | p | the polygon index |
Definition at line 2536 of file geomodel_mesh.cpp.
|
inline |
Definition at line 551 of file geomodel_mesh.h.
vecn< DIMENSION > RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::center | ( | index_t | polygon | ) | const |
Get the center of the given polygon
[in] | polygon | the polygon index |
Definition at line 2528 of file geomodel_mesh.cpp.
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::clear | ( | ) |
Clear the polygons of the GeoModelMesh
Definition at line 2299 of file geomodel_mesh.cpp.
|
private |
Clear edge data: surface_id_ and polygon_id_
Definition at line 2029 of file geomodel_mesh.cpp.
|
private |
Removes polygon adjacencies along lines.
Definition at line 2502 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::index_in_surface | ( | index_t | polygon | ) | const |
Get the polygon index in the GeoModelMesh restricted to the surface owing the polygon
[in] | p | the polygon index |
p
Definition at line 2092 of file geomodel_mesh.cpp.
|
private |
Initialize the polygons of the GeoModelMesh and sort them per surface and polygon type Example for a mesh with two surfaces and only triangles and quads [TRGL,TRGL, .. , QUAD, QUAD .. , TRGL, TRGL, ... , QUAD, QUAD ..] | surface 0 | surface 1 |
Definition at line 2319 of file geomodel_mesh.cpp.
bool RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::is_initialized | ( | ) | const |
Test if the mesh polygons are initialized
Definition at line 2036 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb | ( | ) | const |
Number of polygons stored.
Definition at line 2042 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_polygons | ( | PolygonType | type = PolygonType::UNDEFINED | ) | const |
Get the number of polygons of the corresponding type
[in] | type | the corresponding type |
Definition at line 2123 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_polygons | ( | index_t | surface, |
PolygonType | type = PolygonType::UNDEFINED |
||
) | const |
Get the number of polygons of the corresponding type in the given surface of the GeoModel
[in] | surface | the surface index |
[in] | type | the corresponding type |
Definition at line 2144 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_quad | ( | ) | const |
Get the number of quads in the GeoModelMesh
Definition at line 2230 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_quad | ( | index_t | surface | ) | const |
Get the number of quads in the given surface
[in] | surface | the surface index |
Definition at line 2237 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_triangle | ( | ) | const |
Get the number of triangles in the GeoModelMesh
Definition at line 2196 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_triangle | ( | index_t | surface | ) | const |
Get the number of triangles in the given surface
[in] | surface | the surface index |
Definition at line 2203 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_unclassified_polygon | ( | ) | const |
Get the number of unclassified polygons in the GeoModelMesh
Definition at line 2264 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_unclassified_polygon | ( | index_t | surface | ) | const |
Get the number of polygons in the given surface
[in] | surface | the surface index |
Definition at line 2271 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_vertices | ( | index_t | polygon | ) | const |
Get the number of vertices in the polygon
[in] | polygon | the polygon index |
Definition at line 2049 of file geomodel_mesh.cpp.
|
inline |
Definition at line 734 of file geomodel_mesh.h.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::polygon | ( | index_t | surface, |
index_t | polygon, | ||
PolygonType | type = PolygonType::UNDEFINED |
||
) | const |
Get the polygon index in the GeoModelMesh
[in] | surface | the surface index owing the polygon |
[in] | polygon | the polygon index varying from 0 to the number of polygons of type type in the surface surface . |
polygon
is NOT a polygon id of the surface surface
. It is pth polygon of type type
in the internal storage of the GeoModelMeshPolygons (see GeoModelMeshPolygons::surface_polygon_ptr_). [in] | type | it can specify the polygon type used. For example, if type = QUAD then polygon represents the fth quad in the surface surface and polygon can vary from 0 to nb_quads( s ). If type is PolygonType::ALL, all the polygon types are taken into account. |
Definition at line 2171 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::quad | ( | index_t | surface, |
index_t | quad | ||
) | const |
Get the polygon index in the GeoModelMesh corresponding to the asked quad in the surface
[in] | surface | the surface index |
[in] | quad | the quadth quad index varying from 0 to nb_quads( surface ) |
Definition at line 2251 of file geomodel_mesh.cpp.
|
private |
Resize edge data: surface_id_ and polygon_id_
Definition at line 2022 of file geomodel_mesh.cpp.
|
private |
|
private |
Sorts the polygons by surface and type Permute polygons to sort them per surface and per type Example for a mesh with two surfaces and only triangles and quads [TRGL,TRGL, .. , QUAD, QUAD .. , TRGL, TRGL, ... , QUAD, QUAD ..] | surface 0 | surface 1 |.
Definition at line 2483 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::surface | ( | index_t | polygon | ) | const |
Get the surface index in the GeoModel according the polygon index in the GeoModelMesh
[in] | polygon | the polygon index |
Definition at line 2084 of file geomodel_mesh.cpp.
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::test_and_initialize | ( | ) | const |
Definition at line 2310 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::triangle | ( | index_t | surface, |
index_t | triangle | ||
) | const |
Get the polygon index in the GeoModelMesh corresponding to the asked triangle in the surface
[in] | surface | the surface index |
[in] | triangle | the triangleth triangle index varying from 0 to nb_triangles( surface ) |
Definition at line 2217 of file geomodel_mesh.cpp.
std::tuple< PolygonType, index_t > RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::type | ( | index_t | polygon | ) | const |
Get the polygon index in the GeoModelMesh restricted to the surface owing the polygon and its type
[in] | polygon | the polygon index |
p
and the polygon index varying from 0 to nb_polygons of the corresponding type of p
in the owing surface. Definition at line 2102 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::unclassified_polygon | ( | index_t | surface, |
index_t | polygon | ||
) | const |
Get the polygon index in the GeoModelMesh corresponding to the asked polygon in the surface
[in] | surface | the surface index |
[in] | polygon | the polygonth polygon index varying from 0 to nb_polygons( s ) |
Definition at line 2286 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::vertex | ( | const ElementLocalVertex & | polygon_local_vertex | ) | const |
Get the vertex index of a vertex in a polygon in the GeoModelMesh
[in] | p | the polygon index |
[in] | vertex | the local vertex index [0, nb_vertices_in_polygon[ |
Definition at line 2058 of file geomodel_mesh.cpp.
|
friend |
Definition at line 547 of file geomodel_mesh.h.
|
friend |
Definition at line 546 of file geomodel_mesh.h.
|
protected |
Attached Mesh.
Definition at line 784 of file geomodel_mesh.h.
|
protected |
Number of quads in the GeoModelMesh.
Definition at line 803 of file geomodel_mesh.h.
|
protected |
Number of triangles in the GeoModelMesh.
Definition at line 801 of file geomodel_mesh.h.
|
protected |
Number of unclassified polygons in the GeoModelMesh.
Definition at line 805 of file geomodel_mesh.h.
|
protected |
Vector storing the polygon index in surface per polygon.
Definition at line 789 of file geomodel_mesh.h.
|
staticprivate |
Definition at line 543 of file geomodel_mesh.h.
|
staticprivate |
Definition at line 542 of file geomodel_mesh.h.
|
protected |
Vector storing the surface index per polygon.
Definition at line 787 of file geomodel_mesh.h.
|
protected |
Vector storing the index of the starting polygon index for a given surface and a given polygon type. For example: the 2nd quad index of the surface index S will be found here: surface_polygon_ptr_[ALL*S + QUAD] + 2
Definition at line 798 of file geomodel_mesh.h.