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

#include <geomodel_builder_geometry.h>

Inheritance diagram for RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >:
RINGMesh::GeoModelBuilderGeometry< DIMENSION >

Public Member Functions

virtual ~GeoModelBuilderGeometryBase ()=default
 
void clear_geomodel_mesh ()
 
void change_mesh_data_structure (const gmme_id &id, const MeshType type)
 Transfer general mesh information from one mesh data structure to another one. More...
 
std::unique_ptr< PointSetMeshBuilder< DIMENSION > > create_corner_builder (index_t corner_id)
 Create a PointMeshBuilder for a given corner. More...
 
std::unique_ptr< LineMeshBuilder< DIMENSION > > create_line_builder (index_t line_id)
 Create a LineMeshBuilder for a given line. More...
 
std::unique_ptr< SurfaceMeshBuilder< DIMENSION > > create_surface_builder (index_t surface_id)
 Create a Mesh2DBuilder for a given surface. More...
 
virtual void copy_meshes (const GeoModel< DIMENSION > &from)
 Copy all entity meshes from the input geomodel. More...
 
void copy_meshes (const GeoModel< DIMENSION > &from, const MeshEntityType &entity_type)
 
void copy_mesh (const GeoModel< DIMENSION > &from, const gmme_id &mesh_entity)
 
void assign_mesh_to_entity (const MeshBase< DIMENSION > &mesh, const gmme_id &to)
 
Set entity geometry from geometrical positions
void set_mesh_entity_vertex (const gmme_id &entity_id, index_t v, const vecn< DIMENSION > &point, bool update)
 Sets a vertex coordinates of a GeoModelMeshEntity. More...
 
void set_mesh_entity_vertices (const gmme_id &entity_id, const std::vector< vecn< DIMENSION > > &points, bool clear)
 Adds vertices to the mesh. More...
 
void set_corner (index_t corner_id, const vecn< DIMENSION > &point)
 Sets the coordinates of a given existing Corner. More...
 
void set_line (index_t line_id, const std::vector< vecn< DIMENSION > > &vertices)
 Sets the mesh of a given existing Line. More...
 
void set_surface_geometry (index_t surface_id, const std::vector< vecn< DIMENSION > > &surface_vertices, const std::vector< index_t > &surface_polygons, const std::vector< index_t > &surface_polygon_ptr)
 Sets the points and polygons for a surface. More...
 
Set entity geometry using global GeoModel vertices
void set_mesh_entity_vertex (const gmme_id &entity_id, index_t v, index_t geomodel_vertex)
 Sets the geometrical position of a vertex from a geomodel vertex. More...
 
void set_mesh_entity_vertices (const gmme_id &entity_id, const std::vector< index_t > &geomodel_vertices, bool clear)
 Adds vertices to the mesh. More...
 
void set_corner (index_t corner_id, index_t geomodel_vertex_id)
 Sets the vertex for a Corner. Store the info in the geomodel vertices. More...
 
void set_line (index_t line_id, const std::vector< index_t > &unique_vertices)
 Sets one Line vertices. Store the info in the geomodel vertices. More...
 
Set entity geometry using GeoModelMeshEntity vertices
void set_surface_geometry (index_t surface_id, const std::vector< index_t > &polygons, const std::vector< index_t > &polygon_ptr)
 Sets the polygons of a surface. More...
 
void set_surface_element_geometry (index_t surface_id, index_t polygon_id, const std::vector< index_t > &corners)
 
Create entity element
index_t create_mesh_entity_vertices (const gmme_id &entity_id, index_t nb_vertices)
 Creates new vertices to the mesh. More...
 
index_t create_surface_polygon (index_t surface_id, const std::vector< index_t > &vertex_indices)
 
Delete mesh element entities
void delete_mesh_entity_mesh (const gmme_id &E_id)
 
virtual void delete_mesh_entity_isolated_vertices (const gmme_id &E_id)
 
void delete_mesh_entity_vertices (const gmme_id &E_id, const std::vector< bool > &to_delete)
 
void delete_corner_vertex (index_t corner_id)
 
void delete_line_edges (index_t line_id, const std::vector< bool > &to_delete, bool remove_isolated_vertices)
 
void delete_surface_polygons (index_t surface_id, const std::vector< bool > &to_delete, bool remove_isolated_vertices)
 

Private Member Functions

 ringmesh_disable_copy_and_move (GeoModelBuilderGeometryBase)
 
 ringmesh_template_assert_2d_or_3d (DIMENSION)
 

Friends

class GeoModelBuilderBase< DIMENSION >
 
class GeoModelBuilder< DIMENSION >
 

Misc

GeoModelBuilder< DIMENSION > & builder_
 
GeoModel< DIMENSION > & geomodel_
 
GeoModelAccess< DIMENSION > geomodel_access_
 
void set_surface_element_adjacency (index_t surface_id, index_t polygon_id, const std::vector< index_t > &adjacents)
 
void compute_surface_adjacencies (index_t surface_id, bool recompute_adjacency=true)
 Computes and sets the adjacencies between the polygons. More...
 
void cut_surfaces_by_internal_lines ()
 
void cut_surface_by_line (index_t surface_id, index_t line_id)
 Cuts a Surface along a Line assuming that the edges of the Line are edges of the Surface. More...
 
 GeoModelBuilderGeometryBase (GeoModelBuilder< DIMENSION > &builder, GeoModel< DIMENSION > &geomodel)
 
void duplicate_surface_vertices_along_line (index_t surface_id, index_t line_id)
 Duplicates the surface vertices along the fake boundary (NO_ID adjacencies but shared vertices) and duplicate the vertices. More...
 
index_t disconnect_surface_polygons_along_line_edges (index_t surface_id, index_t line_id)
 
void update_polygon_vertex (index_t surface_id, const std::vector< index_t > &polygons, index_t old_vertex, index_t new_vertex)
 

Detailed Description

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

Definition at line 60 of file geomodel_builder_geometry.h.

Constructor & Destructor Documentation

◆ ~GeoModelBuilderGeometryBase()

template<index_t DIMENSION>
virtual RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::~GeoModelBuilderGeometryBase ( )
virtualdefault

◆ GeoModelBuilderGeometryBase()

template<index_t DIMENSION>
RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::GeoModelBuilderGeometryBase ( GeoModelBuilder< DIMENSION > &  builder,
GeoModel< DIMENSION > &  geomodel 
)
protected

Definition at line 264 of file geomodel_builder_geometry.cpp.

Member Function Documentation

◆ assign_mesh_to_entity()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::assign_mesh_to_entity ( const MeshBase< DIMENSION > &  mesh,
const gmme_id to 
)

Definition at line 807 of file geomodel_builder_geometry.cpp.

◆ change_mesh_data_structure()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::change_mesh_data_structure ( const gmme_id id,
const MeshType  type 
)
inline

Transfer general mesh information from one mesh data structure to another one.

Parameters
[in]idthe GeoModelMeshEntity id to operate on
[in]typethe new mesh data structure type

Definition at line 77 of file geomodel_builder_geometry.h.

◆ clear_geomodel_mesh()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::clear_geomodel_mesh ( )

Definition at line 273 of file geomodel_builder_geometry.cpp.

◆ compute_surface_adjacencies()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::compute_surface_adjacencies ( index_t  surface_id,
bool  recompute_adjacency = true 
)

Computes and sets the adjacencies between the polygons.

The adjacent polygon is given for each vertex of each polygon for the edge starting at this vertex. If there is no neighbor inside the same Surface adjacent is set to NO_ID

Parameters
[in]surface_idIndex of the surface
[in]recompute_adjacencyIf true, recompute the existing adjacencies

Definition at line 613 of file geomodel_builder_geometry.cpp.

◆ copy_mesh()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::copy_mesh ( const GeoModel< DIMENSION > &  from,
const gmme_id mesh_entity 
)

Definition at line 798 of file geomodel_builder_geometry.cpp.

◆ copy_meshes() [1/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::copy_meshes ( const GeoModel< DIMENSION > &  from)
virtual

Copy all entity meshes from the input geomodel.

Precondition
The geomodel under construction has exaclty the same number of entities than the input geomodel.

Definition at line 279 of file geomodel_builder_geometry.cpp.

◆ copy_meshes() [2/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::copy_meshes ( const GeoModel< DIMENSION > &  from,
const MeshEntityType entity_type 
)

Definition at line 788 of file geomodel_builder_geometry.cpp.

◆ create_corner_builder()

template<index_t DIMENSION>
std::unique_ptr< PointSetMeshBuilder< DIMENSION > > RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::create_corner_builder ( index_t  corner_id)
inline

Create a PointMeshBuilder for a given corner.

Parameters
[in]corner_idthe corner index
Returns
The created Mesh0DBuilder The client code is responsible for the memory unallocation. You can use the smartpointer Mesh0DBuilder_var.

Definition at line 93 of file geomodel_builder_geometry.h.

◆ create_line_builder()

template<index_t DIMENSION>
std::unique_ptr< LineMeshBuilder< DIMENSION > > RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::create_line_builder ( index_t  line_id)
inline

Create a LineMeshBuilder for a given line.

Parameters
[in]line_idthe line index
Returns
The created LineMeshBuilder The client code is responsible for the memory unallocation. You can use the smartpointer LineMeshBuilder_var.

Definition at line 112 of file geomodel_builder_geometry.h.

◆ create_mesh_entity_vertices()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::create_mesh_entity_vertices ( const gmme_id entity_id,
index_t  nb_vertices 
)

Creates new vertices to the mesh.

Parameters
[in]entity_idEntity index
[in]nb_verticesNumber of vertices to create
Returns
the first vertex index created

Definition at line 358 of file geomodel_builder_geometry.cpp.

◆ create_surface_builder()

template<index_t DIMENSION>
std::unique_ptr< SurfaceMeshBuilder< DIMENSION > > RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::create_surface_builder ( index_t  surface_id)
inline

Create a Mesh2DBuilder for a given surface.

Parameters
[in]surface_idthe surface index
Returns
The created Mesh2DBuilder The client code is responsible for the memory unallocation. You can use the smartpointer Mesh2DBuilder_var.

Definition at line 132 of file geomodel_builder_geometry.h.

◆ create_surface_polygon()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::create_surface_polygon ( index_t  surface_id,
const std::vector< index_t > &  vertex_indices 
)

Definition at line 502 of file geomodel_builder_geometry.cpp.

◆ cut_surface_by_line()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::cut_surface_by_line ( index_t  surface_id,
index_t  line_id 
)

Cuts a Surface along a Line assuming that the edges of the Line are edges of the Surface.

Precondition
Surface is not already cut. Line L does not cut the Surface S into 2 connected components.

Definition at line 656 of file geomodel_builder_geometry.cpp.

◆ cut_surfaces_by_internal_lines()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::cut_surfaces_by_internal_lines ( )

Definition at line 636 of file geomodel_builder_geometry.cpp.

◆ delete_corner_vertex()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::delete_corner_vertex ( index_t  corner_id)

Definition at line 566 of file geomodel_builder_geometry.cpp.

◆ delete_line_edges()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::delete_line_edges ( index_t  line_id,
const std::vector< bool > &  to_delete,
bool  remove_isolated_vertices 
)

Definition at line 575 of file geomodel_builder_geometry.cpp.

◆ delete_mesh_entity_isolated_vertices()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::delete_mesh_entity_isolated_vertices ( const gmme_id E_id)
virtual

Reimplemented in RINGMesh::GeoModelBuilderGeometry< 3 >.

Definition at line 524 of file geomodel_builder_geometry.cpp.

◆ delete_mesh_entity_mesh()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::delete_mesh_entity_mesh ( const gmme_id E_id)

Definition at line 511 of file geomodel_builder_geometry.cpp.

◆ delete_mesh_entity_vertices()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::delete_mesh_entity_vertices ( const gmme_id E_id,
const std::vector< bool > &  to_delete 
)

Definition at line 554 of file geomodel_builder_geometry.cpp.

◆ delete_surface_polygons()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::delete_surface_polygons ( index_t  surface_id,
const std::vector< bool > &  to_delete,
bool  remove_isolated_vertices 
)

Definition at line 585 of file geomodel_builder_geometry.cpp.

◆ disconnect_surface_polygons_along_line_edges()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::disconnect_surface_polygons_along_line_edges ( index_t  surface_id,
index_t  line_id 
)
protected

Definition at line 722 of file geomodel_builder_geometry.cpp.

◆ duplicate_surface_vertices_along_line()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::duplicate_surface_vertices_along_line ( index_t  surface_id,
index_t  line_id 
)
protected

Duplicates the surface vertices along the fake boundary (NO_ID adjacencies but shared vertices) and duplicate the vertices.

Definition at line 675 of file geomodel_builder_geometry.cpp.

◆ ringmesh_disable_copy_and_move()

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

◆ ringmesh_template_assert_2d_or_3d()

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

◆ set_corner() [1/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_corner ( index_t  corner_id,
const vecn< DIMENSION > &  point 
)

Sets the coordinates of a given existing Corner.

Parameters
[in]corner_idthe index of the corner in the GeoModel
[in]pointthe coordinates to set

Definition at line 398 of file geomodel_builder_geometry.cpp.

◆ set_corner() [2/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_corner ( index_t  corner_id,
index_t  geomodel_vertex_id 
)

Sets the vertex for a Corner. Store the info in the geomodel vertices.

Parameters
[in]corner_idIndex of the corner
[in]geomodel_vertex_idIndex of the vertex in the geomodel

Definition at line 453 of file geomodel_builder_geometry.cpp.

◆ set_line() [1/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_line ( index_t  line_id,
const std::vector< vecn< DIMENSION > > &  vertices 
)

Sets the mesh of a given existing Line.

Parameters
[in]line_idthe index of the line in the GeoModel
[in]verticesthe coordinates to set
Warning
the vertices should be ordered from the first boundary corner to the second one

Definition at line 408 of file geomodel_builder_geometry.cpp.

◆ set_line() [2/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_line ( index_t  line_id,
const std::vector< index_t > &  unique_vertices 
)

Sets one Line vertices. Store the info in the geomodel vertices.

Parameters
[in]idLine index
[in]unique_verticesIndices in the geomodel of the unique vertices with which to build the Line

Definition at line 463 of file geomodel_builder_geometry.cpp.

◆ set_mesh_entity_vertex() [1/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_mesh_entity_vertex ( const gmme_id entity_id,
index_t  v,
const vecn< DIMENSION > &  point,
bool  update 
)

Sets a vertex coordinates of a GeoModelMeshEntity.

Parameters
[in]entity_idthe entity to edit
[in]vthe index of the vertex in the entity
[in]pointthe coordinates to set
[in]updateif true, updates all the colocated vertices to the new coordinates (i.e. if edit a Corner coordinates, it will updates its Lines, Surfaces...)

Definition at line 288 of file geomodel_builder_geometry.cpp.

◆ set_mesh_entity_vertex() [2/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_mesh_entity_vertex ( const gmme_id entity_id,
index_t  v,
index_t  geomodel_vertex 
)

Sets the geometrical position of a vertex from a geomodel vertex.

Parameters
[in]entity_idEntity index
[in]vIndex of the vertex to modify
[in]geomodel_vertexIndex in GeoModelMeshVertices of the vertex giving the new position

Definition at line 315 of file geomodel_builder_geometry.cpp.

◆ set_mesh_entity_vertices() [1/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_mesh_entity_vertices ( const gmme_id entity_id,
const std::vector< vecn< DIMENSION > > &  points,
bool  clear 
)

Adds vertices to the mesh.

No update of the geomodel vertices is done

Parameters
[in]idEntity index
[in]pointsGeometric positions of the vertices to add
[in]clearIf true the mesh is cleared, keeping its attributes

Definition at line 329 of file geomodel_builder_geometry.cpp.

◆ set_mesh_entity_vertices() [2/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_mesh_entity_vertices ( const gmme_id entity_id,
const std::vector< index_t > &  geomodel_vertices,
bool  clear 
)

Adds vertices to the mesh.

No update of the geomodel vertices is done

Parameters
[in]entity_idEntity index
[in]geomodel_verticesGeometric positions of the vertices to add
[in]clearIf true the mesh if cleared, keeping its attributes

Definition at line 371 of file geomodel_builder_geometry.cpp.

◆ set_surface_element_adjacency()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_surface_element_adjacency ( index_t  surface_id,
index_t  polygon_id,
const std::vector< index_t > &  adjacents 
)

Definition at line 597 of file geomodel_builder_geometry.cpp.

◆ set_surface_element_geometry()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_surface_element_geometry ( index_t  surface_id,
index_t  polygon_id,
const std::vector< index_t > &  corners 
)

Definition at line 486 of file geomodel_builder_geometry.cpp.

◆ set_surface_geometry() [1/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_surface_geometry ( index_t  surface_id,
const std::vector< vecn< DIMENSION > > &  surface_vertices,
const std::vector< index_t > &  surface_polygons,
const std::vector< index_t > &  surface_polygon_ptr 
)

Sets the points and polygons for a surface.

If polygon_adjacencies are not given they are computed.

Parameters
[in]surface_idIndex of the surface
[in]surface_verticesCoordinates of the vertices
[in]surface_polygonsIndices in the vertices vector to build polygons
[in]surface_polygon_ptrPointer to the beginning of a polygon in surface_polygons

Definition at line 427 of file geomodel_builder_geometry.cpp.

◆ set_surface_geometry() [2/2]

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::set_surface_geometry ( index_t  surface_id,
const std::vector< index_t > &  polygons,
const std::vector< index_t > &  polygon_ptr 
)

Sets the polygons of a surface.

Parameters
[in]surface_idIndex of the surface
[in]polygonsIndices of the mesh vertices defining the polygons
[in]polygon_ptrPointer to the beginning of a polygon in polygons

Definition at line 441 of file geomodel_builder_geometry.cpp.

◆ update_polygon_vertex()

template<index_t DIMENSION>
void RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::update_polygon_vertex ( index_t  surface_id,
const std::vector< index_t > &  polygons,
index_t  old_vertex,
index_t  new_vertex 
)
protected

Definition at line 763 of file geomodel_builder_geometry.cpp.

Friends And Related Function Documentation

◆ GeoModelBuilder< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelBuilder< DIMENSION >
friend

Definition at line 65 of file geomodel_builder_geometry.h.

◆ GeoModelBuilderBase< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelBuilderBase< DIMENSION >
friend

Definition at line 64 of file geomodel_builder_geometry.h.

Member Data Documentation

◆ builder_

template<index_t DIMENSION>
GeoModelBuilder< DIMENSION >& RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::builder_
protected

Definition at line 386 of file geomodel_builder_geometry.h.

◆ geomodel_

template<index_t DIMENSION>
GeoModel< DIMENSION >& RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::geomodel_
protected

Definition at line 387 of file geomodel_builder_geometry.h.

◆ geomodel_access_

template<index_t DIMENSION>
GeoModelAccess< DIMENSION > RINGMesh::GeoModelBuilderGeometryBase< DIMENSION >::geomodel_access_
protected

Definition at line 388 of file geomodel_builder_geometry.h.


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