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

A GeoModelEntity of type SURFACE. More...

#include <geomodel_mesh_entity.h>

Inheritance diagram for RINGMesh::SurfaceBase< DIMENSION >:
RINGMesh::GeoModelMeshEntity< DIMENSION > RINGMesh::GeoModelEntity< DIMENSION > RINGMesh::Surface< DIMENSION >

Public Member Functions

virtual ~SurfaceBase ()
 
MeshEntityType type_name () const final
 
const Line< DIMENSION > & boundary (index_t x) const
 
const Region< DIMENSION > & incident_entity (index_t x) const
 
bool is_simplicial () const
 
const SurfaceAABBTree< DIMENSION > & polygon_aabb () const
 
const NNSearch< DIMENSION > & polygon_nn_search () const
 Return the NNSearch for the polygons of the surface. More...
 
GEO::AttributesManager & polygon_attribute_manager () const
 
Accessors to Surface polygons, edges and vertices
index_t nb_mesh_elements () const final
 
index_t nb_mesh_element_vertices (index_t polygon_index) const final
 
index_t mesh_element_vertex_index (const ElementLocalVertex &element_local_vertex) const final
 Index of the vertex in the Surface from its index in a polygon of the mesh. More...
 
index_t polygon_adjacent_index (const PolygonLocalEdge &polygon_local_edge) const
 Gets the polygon adjacent along an edge of a polygon. More...
 
- Public Member Functions inherited from RINGMesh::GeoModelMeshEntity< DIMENSION >
virtual ~GeoModelMeshEntity ()
 
gmme_id gmme () const
 
MeshEntityType mesh_entity_type () const
 
bool is_valid () const final
 Global validity of the entity. More...
 
virtual bool is_connectivity_valid () const
 
bool is_parent_connectivity_valid () const
 
void save (const std::string &filename) const
 
const NNSearch< DIMENSION > & vertex_nn_search () const
 Return the NNSearch for the Entity vertices. More...
 
GEO::AttributesManager & vertex_attribute_manager () const
 
index_t nb_boundaries () const
 
const gmme_idboundary_gmme (index_t x) const
 
const GeoModelMeshEntity< DIMENSION > & boundary (index_t x) const
 
index_t nb_incident_entities () const
 
const gmme_idincident_entity_gmme (index_t x) const
 
const GeoModelMeshEntity< DIMENSION > & incident_entity (index_t x) const
 
bool has_inside_border () const
 Check if one entity is twice in the boundary. More...
 
bool is_inside_border (const GeoModelMeshEntity &rhs) const
 Check if this entity is an inside border of rhs. More...
 
bool has_parent () const
 
bool has_parent (const GeologicalEntityType &parent_type) const
 Check if the entity has a parent of the given type. More...
 
index_t nb_parents () const
 
const gmge_idparent_gmge (index_t id) const
 
const gmge_id parent_gmge (const GeologicalEntityType &parent_type) const
 Returns the gmge_id of the parent of the given type. More...
 
const GeoModelGeologicalEntity< DIMENSION > & parent (index_t parent_index) const
 
const GeoModelGeologicalEntity< DIMENSION > & parent (const GeologicalEntityType &parent_type) const
 
index_t nb_vertices () const
 
const vecn< DIMENSION > & vertex (index_t vertex_index) const
 Coordinates of the vertex_index. More...
 
const vecn< DIMENSION > & mesh_element_vertex (const ElementLocalVertex &element_local_vertex) const
 Coordinates of a vertex of a mesh element. More...
 
vecn< DIMENSION > entity_barycenter () const
 
virtual double size () const
 
- Public Member Functions inherited from RINGMesh::GeoModelEntity< DIMENSION >
virtual ~GeoModelEntity ()=default
 
virtual bool is_on_voi () const =0
 
const GeoModel< DIMENSION > & geomodel () const
 
const std::string & name () const
 
index_t index () const
 

Static Public Member Functions

static MeshEntityType type_name_static ()
 

Private Member Functions

 ringmesh_disable_copy_and_move (SurfaceBase)
 
 ringmesh_template_assert_2d_or_3d (DIMENSION)
 

Friends

class GeoModelMeshEntityAccess< DIMENSION >
 
std::shared_ptr< SurfaceMesh< DIMENSION > > surface_mesh_ {}
 
void update_mesh_storage_type (std::unique_ptr< SurfaceMesh< DIMENSION > > mesh)
 
void change_mesh_data_structure (const MeshType &type) final
 
vecn< DIMENSION > mesh_element_barycenter (index_t polygon_index) const final
 
double mesh_element_size (index_t polygon_index) const final
 
const SurfaceMesh< DIMENSION > & mesh () const
 Get the low level mesh data structure. More...
 
 SurfaceBase (const GeoModel< DIMENSION > &geomodel, index_t id, const MeshType type)
 
bool is_mesh_valid () const final
 Check that the mesh of the Surface is valid. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RINGMesh::GeoModelMeshEntity< DIMENSION >
 GeoModelMeshEntity (const GeoModel< DIMENSION > &geomodel, index_t id)
 
virtual void copy_mesh_entity (const GeoModelMeshEntity< DIMENSION > &from)
 
virtual bool is_index_valid () const final
 
void set_mesh (std::shared_ptr< MeshBase< DIMENSION > > mesh)
 
bool is_boundary_connectivity_valid () const
 
bool is_incident_entity_connectivity_valid () const
 
bool are_geomodel_vertex_indices_valid () const
 Check that geomodel vertex indices are consistent with what is stored at the GeoModel level. More...
 
void unbind_vertex_mapping_attribute () const
 
void bind_vertex_mapping_attribute () const
 
- Protected Member Functions inherited from RINGMesh::GeoModelEntity< DIMENSION >
 GeoModelEntity (const GeoModel< DIMENSION > &geomodel, index_t id)
 
void copy_name (const GeoModelEntity< DIMENSION > &from)
 
- Protected Attributes inherited from RINGMesh::GeoModelMeshEntity< DIMENSION >
std::vector< index_t > boundaries_ {}
 Boundary relations of this entity. More...
 
std::vector< index_t > incident_entities_ {}
 Incident-entity relations of this entity. More...
 
std::vector< index_t > parents_ {}
 Parents relations of this entity. More...
 
- Protected Attributes inherited from RINGMesh::GeoModelEntity< DIMENSION >
const GeoModel< DIMENSION > & geomodel_
 Reference to the GeoModel owning this entity. More...
 
std::string name_ = std::string{ "Unnamed" }
 Name of the entity - default is "Unnamed". More...
 
index_t id_ { NO_ID }
 Index of the entity. More...
 

Detailed Description

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

A GeoModelEntity of type SURFACE.

One connected component (part) of a 2-manifold surface (all edges of the polygons are in at most 2 polygons)

Definition at line 682 of file geomodel_mesh_entity.h.

Constructor & Destructor Documentation

◆ ~SurfaceBase()

template<index_t DIMENSION>
virtual RINGMesh::SurfaceBase< DIMENSION >::~SurfaceBase ( )
inlinevirtual

Definition at line 690 of file geomodel_mesh_entity.h.

◆ SurfaceBase()

template<index_t DIMENSION>
RINGMesh::SurfaceBase< DIMENSION >::SurfaceBase ( const GeoModel< DIMENSION > &  geomodel,
index_t  id,
const MeshType  type 
)
inlineprotected

Definition at line 818 of file geomodel_mesh_entity.h.

Member Function Documentation

◆ boundary()

template<index_t DIMENSION>
const Line< DIMENSION > & RINGMesh::SurfaceBase< DIMENSION >::boundary ( index_t  x) const

Definition at line 803 of file geomodel_mesh_entity.cpp.

◆ change_mesh_data_structure()

template<index_t DIMENSION>
void RINGMesh::SurfaceBase< DIMENSION >::change_mesh_data_structure ( const MeshType type)
finalprivatevirtual

◆ incident_entity()

template<index_t DIMENSION>
const Region< DIMENSION >& RINGMesh::SurfaceBase< DIMENSION >::incident_entity ( index_t  x) const

◆ is_mesh_valid()

template<index_t DIMENSION>
bool RINGMesh::SurfaceBase< DIMENSION >::is_mesh_valid ( ) const
finalprotectedvirtual

Check that the mesh of the Surface is valid.

Check that

  • the GEO::Mesh has more than 2 vertices, at least 1 polygon, no cells.
  • global indices of vertices in the geomodel are in a valid range
  • no degenerate polygon
  • one connected component

Some tests are not performed here but globally on the GeoModel

  • intersection of polygons
  • non-manifold edges
  • duplicated vertices are on a boundary Line ending in the Surface

Some tests are not performed

  • non-manifold points
  • surface orientability
  • planarity of polygonal polygons

Reimplemented from RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 763 of file geomodel_mesh_entity.cpp.

◆ is_simplicial()

template<index_t DIMENSION>
bool RINGMesh::SurfaceBase< DIMENSION >::is_simplicial ( ) const
inline

Definition at line 709 of file geomodel_mesh_entity.h.

◆ mesh()

template<index_t DIMENSION>
const SurfaceMesh< DIMENSION >& RINGMesh::SurfaceBase< DIMENSION >::mesh ( ) const
inline

Get the low level mesh data structure.

Definition at line 812 of file geomodel_mesh_entity.h.

◆ mesh_element_barycenter()

template<index_t DIMENSION>
vecn< DIMENSION > RINGMesh::SurfaceBase< DIMENSION >::mesh_element_barycenter ( index_t  polygon_index) const
inlinefinalvirtual
Returns
Polygon barycenter.

Implements RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 793 of file geomodel_mesh_entity.h.

◆ mesh_element_size()

template<index_t DIMENSION>
double RINGMesh::SurfaceBase< DIMENSION >::mesh_element_size ( index_t  polygon_index) const
inlinefinalvirtual
Returns
Area of a polygon.

Implements RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 803 of file geomodel_mesh_entity.h.

◆ mesh_element_vertex_index()

template<index_t DIMENSION>
index_t RINGMesh::SurfaceBase< DIMENSION >::mesh_element_vertex_index ( const ElementLocalVertex element_local_vertex) const
inlinefinalvirtual

Index of the vertex in the Surface from its index in a polygon of the mesh.

Implements RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 758 of file geomodel_mesh_entity.h.

◆ nb_mesh_element_vertices()

template<index_t DIMENSION>
index_t RINGMesh::SurfaceBase< DIMENSION >::nb_mesh_element_vertices ( index_t  polygon_index) const
inlinefinalvirtual

Number of vertices of a polygon

Implements RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 748 of file geomodel_mesh_entity.h.

◆ nb_mesh_elements()

template<index_t DIMENSION>
index_t RINGMesh::SurfaceBase< DIMENSION >::nb_mesh_elements ( ) const
inlinefinalvirtual

Number of polygons of the Surface.

Implements RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 740 of file geomodel_mesh_entity.h.

◆ polygon_aabb()

template<index_t DIMENSION>
const SurfaceAABBTree< DIMENSION >& RINGMesh::SurfaceBase< DIMENSION >::polygon_aabb ( ) const
inline

Definition at line 714 of file geomodel_mesh_entity.h.

◆ polygon_adjacent_index()

template<index_t DIMENSION>
index_t RINGMesh::SurfaceBase< DIMENSION >::polygon_adjacent_index ( const PolygonLocalEdge polygon_local_edge) const
inline

Gets the polygon adjacent along an edge of a polygon.

Parameters
polygon_indexin the polygon
edge_indexin the edge
Note
The edge index is assumed to be the index of the vertex at which it is starting.

Definition at line 776 of file geomodel_mesh_entity.h.

◆ polygon_attribute_manager()

template<index_t DIMENSION>
GEO::AttributesManager& RINGMesh::SurfaceBase< DIMENSION >::polygon_attribute_manager ( ) const
inline

Definition at line 728 of file geomodel_mesh_entity.h.

◆ polygon_nn_search()

template<index_t DIMENSION>
const NNSearch< DIMENSION >& RINGMesh::SurfaceBase< DIMENSION >::polygon_nn_search ( ) const
inline

Return the NNSearch for the polygons of the surface.

The barycenter of the polygons is used.

Definition at line 723 of file geomodel_mesh_entity.h.

◆ ringmesh_disable_copy_and_move()

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

◆ ringmesh_template_assert_2d_or_3d()

template<index_t DIMENSION>
RINGMesh::SurfaceBase< DIMENSION >::ringmesh_template_assert_2d_or_3d ( DIMENSION  )
private

◆ type_name()

template<index_t DIMENSION>
MeshEntityType RINGMesh::SurfaceBase< DIMENSION >::type_name ( ) const
inlinefinalvirtual

Implements RINGMesh::GeoModelMeshEntity< DIMENSION >.

Definition at line 695 of file geomodel_mesh_entity.h.

◆ type_name_static()

template<index_t DIMENSION>
static MeshEntityType RINGMesh::SurfaceBase< DIMENSION >::type_name_static ( )
inlinestatic

Definition at line 700 of file geomodel_mesh_entity.h.

◆ update_mesh_storage_type()

template<index_t DIMENSION>
void RINGMesh::SurfaceBase< DIMENSION >::update_mesh_storage_type ( std::unique_ptr< SurfaceMesh< DIMENSION > >  mesh)
inlineprivate

Definition at line 852 of file geomodel_mesh_entity.h.

Friends And Related Function Documentation

◆ GeoModelMeshEntityAccess< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshEntityAccess< DIMENSION >
friend

Definition at line 688 of file geomodel_mesh_entity.h.

Member Data Documentation

◆ surface_mesh_

template<index_t DIMENSION>
std::shared_ptr< SurfaceMesh< DIMENSION > > RINGMesh::SurfaceBase< DIMENSION >::surface_mesh_ {}
private

Definition at line 862 of file geomodel_mesh_entity.h.


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