RINGMesh  Version 5.0.0
A programming library for geological model meshes
RINGMesh::GeoModelMeshPolygonsBase< DIMENSION > Class Template Reference

#include <geomodel_mesh.h>

Inheritance diagram for RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >:
RINGMesh::GeoModelMeshCommon< DIMENSION > RINGMesh::GeoModelMeshPolygons< DIMENSION >

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 >
 

Detailed Description

template<index_t DIMENSION>
class RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >

Definition at line 538 of file geomodel_mesh.h.

Constructor & Destructor Documentation

◆ ~GeoModelMeshPolygonsBase()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::~GeoModelMeshPolygonsBase ( )
virtual

Definition at line 2016 of file geomodel_mesh.cpp.

◆ GeoModelMeshPolygonsBase()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::GeoModelMeshPolygonsBase ( GeoModelMesh< DIMENSION > &  gmm,
GeoModel< DIMENSION > &  gm,
std::unique_ptr< SurfaceMesh< DIMENSION > > &  mesh 
)
protected

Definition at line 2006 of file geomodel_mesh.cpp.

Member Function Documentation

◆ aabb()

template<index_t DIMENSION>
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.

◆ adjacent()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::adjacent ( const PolygonLocalEdge polygon_local_edge) const

Get the adjacent polygon index in the GeoModelMesh

Parameters
[in]polygon_local_edgein the polygon
Returns
the adjacent polygon index

Definition at line 2071 of file geomodel_mesh.cpp.

◆ area()

template<index_t DIMENSION>
double RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::area ( index_t  polygon) const

Get the area of the polygon

Parameters
[in]pthe polygon index

Definition at line 2536 of file geomodel_mesh.cpp.

◆ attribute_manager()

template<index_t DIMENSION>
GEO::AttributesManager& RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::attribute_manager ( ) const
inline

Definition at line 551 of file geomodel_mesh.h.

◆ center()

template<index_t DIMENSION>
vecn< DIMENSION > RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::center ( index_t  polygon) const

Get the center of the given polygon

Parameters
[in]polygonthe polygon index

Definition at line 2528 of file geomodel_mesh.cpp.

◆ clear()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::clear ( )

Clear the polygons of the GeoModelMesh

Definition at line 2299 of file geomodel_mesh.cpp.

◆ clear_polygones_data()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::clear_polygones_data ( )
private

Clear edge data: surface_id_ and polygon_id_

Definition at line 2029 of file geomodel_mesh.cpp.

◆ disconnect_along_lines()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::disconnect_along_lines ( )
private

Removes polygon adjacencies along lines.

Definition at line 2502 of file geomodel_mesh.cpp.

◆ index_in_surface()

template<index_t DIMENSION>
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

Parameters
[in]pthe polygon index
Returns
the polygon index varying from 0 to nb_polygons in the surface owing p

Definition at line 2092 of file geomodel_mesh.cpp.

◆ initialize()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::initialize ( )
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.

◆ is_initialized()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::is_initialized ( ) const

Test if the mesh polygons are initialized

Definition at line 2036 of file geomodel_mesh.cpp.

◆ nb()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb ( ) const

Number of polygons stored.

Definition at line 2042 of file geomodel_mesh.cpp.

◆ nb_polygons() [1/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_polygons ( PolygonType  type = PolygonType::UNDEFINED) const

Get the number of polygons of the corresponding type

Parameters
[in]typethe corresponding type
Returns
the number of polygons

Definition at line 2123 of file geomodel_mesh.cpp.

◆ nb_polygons() [2/2]

template<index_t DIMENSION>
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

Parameters
[in]surfacethe surface index
[in]typethe corresponding type
Returns
the number of polygons

Definition at line 2144 of file geomodel_mesh.cpp.

◆ nb_quad() [1/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_quad ( ) const

Get the number of quads in the GeoModelMesh

Returns
the number of quads

Definition at line 2230 of file geomodel_mesh.cpp.

◆ nb_quad() [2/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_quad ( index_t  surface) const

Get the number of quads in the given surface

Parameters
[in]surfacethe surface index
Returns
the number of quads

Definition at line 2237 of file geomodel_mesh.cpp.

◆ nb_triangle() [1/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_triangle ( ) const

Get the number of triangles in the GeoModelMesh

Returns
the number of triangles

Definition at line 2196 of file geomodel_mesh.cpp.

◆ nb_triangle() [2/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_triangle ( index_t  surface) const

Get the number of triangles in the given surface

Parameters
[in]surfacethe surface index
Returns
the number of triangles

Definition at line 2203 of file geomodel_mesh.cpp.

◆ nb_unclassified_polygon() [1/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_unclassified_polygon ( ) const

Get the number of unclassified polygons in the GeoModelMesh

Returns
the number of unclassified polygons

Definition at line 2264 of file geomodel_mesh.cpp.

◆ nb_unclassified_polygon() [2/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_unclassified_polygon ( index_t  surface) const

Get the number of polygons in the given surface

Parameters
[in]surfacethe surface index
Returns
the number of polygons

Definition at line 2271 of file geomodel_mesh.cpp.

◆ nb_vertices()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_vertices ( index_t  polygon) const

Get the number of vertices in the polygon

Parameters
[in]polygonthe polygon index
Returns
the number of vertices

Definition at line 2049 of file geomodel_mesh.cpp.

◆ nn_search()

template<index_t DIMENSION>
const NNSearch< DIMENSION >& RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nn_search ( ) const
inline

Definition at line 734 of file geomodel_mesh.h.

◆ polygon()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::polygon ( index_t  surface,
index_t  polygon,
PolygonType  type = PolygonType::UNDEFINED 
) const

Get the polygon index in the GeoModelMesh

Parameters
[in]surfacethe surface index owing the polygon
[in]polygonthe polygon index varying from 0 to the number of polygons of type type in the surface surface.
Warning
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_).
Note
to find the polygon id of the GeoModelMeshPolygons from a surface and a polygon id of this surface, you need to perform a search using NNSearch and the barycenter of the polygon for instance.
Parameters
[in]typeit 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.
Returns
the polygon index

Definition at line 2171 of file geomodel_mesh.cpp.

◆ quad()

template<index_t DIMENSION>
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

Parameters
[in]surfacethe surface index
[in]quadthe quadth quad index varying from 0 to nb_quads( surface )
Returns
the polygon index

Definition at line 2251 of file geomodel_mesh.cpp.

◆ resize_polygones_data()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::resize_polygones_data ( )
private

Resize edge data: surface_id_ and polygon_id_

Definition at line 2022 of file geomodel_mesh.cpp.

◆ ringmesh_disable_copy_and_move()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::ringmesh_disable_copy_and_move ( GeoModelMeshPolygonsBase< DIMENSION >  )
private

◆ sort_polygons()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::sort_polygons ( )
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.

◆ surface()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::surface ( index_t  polygon) const

Get the surface index in the GeoModel according the polygon index in the GeoModelMesh

Parameters
[in]polygonthe polygon index
Returns
the surface index

Definition at line 2084 of file geomodel_mesh.cpp.

◆ test_and_initialize()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::test_and_initialize ( ) const

Definition at line 2310 of file geomodel_mesh.cpp.

◆ triangle()

template<index_t DIMENSION>
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

Parameters
[in]surfacethe surface index
[in]trianglethe triangleth triangle index varying from 0 to nb_triangles( surface )
Returns
the polygon index

Definition at line 2217 of file geomodel_mesh.cpp.

◆ type()

template<index_t DIMENSION>
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

Parameters
[in]polygonthe polygon index
Returns
the type of the polygon 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.

◆ unclassified_polygon()

template<index_t DIMENSION>
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

Parameters
[in]surfacethe surface index
[in]polygonthe polygonth polygon index varying from 0 to nb_polygons( s )
Returns
the polygon index

Definition at line 2286 of file geomodel_mesh.cpp.

◆ vertex()

template<index_t DIMENSION>
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

Parameters
[in]pthe polygon index
[in]vertexthe local vertex index [0, nb_vertices_in_polygon[
Returns
the vertex index

Definition at line 2058 of file geomodel_mesh.cpp.

Friends And Related Function Documentation

◆ GeoModelMesh< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMesh< DIMENSION >
friend

Definition at line 547 of file geomodel_mesh.h.

◆ GeoModelMeshBase< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshBase< DIMENSION >
friend

Definition at line 546 of file geomodel_mesh.h.

Member Data Documentation

◆ mesh_

template<index_t DIMENSION>
std::unique_ptr< SurfaceMesh< DIMENSION > >& RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::mesh_
protected

Attached Mesh.

Definition at line 784 of file geomodel_mesh.h.

◆ nb_quads_

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_quads_ { 0 }
protected

Number of quads in the GeoModelMesh.

Definition at line 803 of file geomodel_mesh.h.

◆ nb_triangles_

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_triangles_ { 0 }
protected

Number of triangles in the GeoModelMesh.

Definition at line 801 of file geomodel_mesh.h.

◆ nb_unclassified_polygons_

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::nb_unclassified_polygons_ { 0 }
protected

Number of unclassified polygons in the GeoModelMesh.

Definition at line 805 of file geomodel_mesh.h.

◆ polygon_id_

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::polygon_id_
protected

Vector storing the polygon index in surface per polygon.

Definition at line 789 of file geomodel_mesh.h.

◆ polygon_surface_att_name

template<index_t DIMENSION>
const std::string RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::polygon_surface_att_name
staticprivate
Initial value:
=
"polygon_surface"

Definition at line 543 of file geomodel_mesh.h.

◆ surface_att_name

template<index_t DIMENSION>
const std::string RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::surface_att_name
staticprivate
Initial value:
=
"surface"

Definition at line 542 of file geomodel_mesh.h.

◆ surface_id_

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::surface_id_
protected

Vector storing the surface index per polygon.

Definition at line 787 of file geomodel_mesh.h.

◆ surface_polygon_ptr_

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshPolygonsBase< DIMENSION >::surface_polygon_ptr_
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.


The documentation for this class was generated from the following files: