48 template < index_t DIMENSION >
51 : builder_( builder ),
52 geomodel_( geomodel ),
53 geomodel_access_( geomodel )
55 nb_mesh_entity_types_ = geomodel_.entity_type_manager()
56 .mesh_entity_manager.nb_mesh_entity_types();
57 nb_geological_entity_types_ = geomodel_.nb_geological_entity_types();
58 nb_entity_types_ = nb_geological_entity_types_ + nb_mesh_entity_types_;
61 template < index_t DIMENSION >
63 const std::set< gmme_id >& entities )
65 if( entities.empty() )
69 initialize_for_removal( entities );
70 do_delete_flagged_mesh_entities();
71 geomodel_.mesh.vertices.clear();
72 update_mesh_entity_connectivity();
73 flag_geological_entities_without_children();
74 do_delete_flagged_geological_entities();
75 update_geological_entity_connectivity();
78 template < index_t DIMENSION >
80 const std::set< gmge_id >& entities )
82 std::set< gmme_id > mesh_entities;
83 for(
const gmge_id& it : entities )
86 geomodel_.geological_entity( it );
89 mesh_entities.insert( cur_gmge.
child( i ).gmme() );
92 remove_mesh_entities( mesh_entities );
95 template < index_t DIMENSION >
99 for(
auto i :
range( nb_geological_entity_types_ ) )
102 index_to_geological_entity_type( i );
104 range( geomodel_.nb_geological_entities( entity_type ) ) )
106 if( old_2_new_geological_entity_[i][j] == NO_ID )
108 builder_.geology.delete_geological_entity( entity_type, j );
111 clear_null_geological_entities( i );
115 template < index_t DIMENSION >
117 index_t type, index_t index )
119 const MeshEntityType& type_name = index_to_mesh_entity_type( type );
120 gmme_id id( type_name, index );
121 builder_.topology.delete_mesh_entity( type_name, index );
124 template < index_t DIMENSION >
130 return geological_entity_type_to_index( type );
133 template < index_t DIMENSION >
142 template < index_t DIMENSION >
145 index_t new_index_in_geomodel )
152 template < index_t DIMENSION >
156 index_t old_id = ME.
index();
157 index_t type = mesh_entity_type_index( ME );
158 index_t new_id = old_2_new_mesh_entity_[type][old_id];
160 set_mesh_entity_index( ME, new_id );
163 template < index_t DIMENSION >
168 index_t old_id = GE.
index();
169 index_t type = geological_entity_type_index( GE );
170 index_t new_id = old_2_new_geological_entity_[type][old_id];
172 set_geological_entity_index( GE, new_id );
175 template < index_t DIMENSION >
180 if( type_index == NO_ID )
187 index_t new_boundary =
188 old_2_new_mesh_entity_[type_index][old_boundary];
189 builder_.topology.set_mesh_entity_boundary(
190 ME.
gmme(), i, new_boundary );
194 template < index_t DIMENSION >
199 geomodel_.entity_type_manager().mesh_entity_manager;
202 bool valid_type = manager.
is_valid_type( incident_entity_type );
207 index_t incident_entity_type_index =
208 mesh_entity_type_to_index( incident_entity_type );
213 old_2_new_mesh_entity_[incident_entity_type_index][old_id];
214 builder_.topology.set_mesh_entity_incident_entity(
215 E.
gmme(), i, new_id );
219 template < index_t DIMENSION >
227 index_t parent_type_index =
228 geological_entity_type_to_index( parent_type );
232 old_2_new_geological_entity_[parent_type_index][old_id];
233 builder_.geology.set_mesh_entity_parent(
234 id, p,
gmge_id( parent_type, new_id ) );
238 template < index_t DIMENSION >
245 index_t child_type = children_type_index( E.
entity_type() );
249 index_t new_id = old_2_new_mesh_entity_[child_type][old_id];
250 builder_.geology.set_geological_entity_child(
251 E.
gmge(), i, new_id );
256 template < index_t DIMENSION >
259 for(
auto i :
range( nb_childs_.size() ) )
261 for(
auto j :
range( nb_childs_[i].size() ) )
266 index_to_geological_entity_type( i ), j )
272 template < index_t DIMENSION >
286 GeoModelMeshEntity3D& ME )
288 GeoModelBuilderRemovalBase3D::update_mesh_entity( ME );
290 if( ME.mesh_entity_type() == Region3D::type_name_static() )
292 auto& R =
dynamic_cast< Region3D&
>( ME );
293 update_region_boundary_signs( R );
294 delete_invalid_signs( R );
index_t nb_incident_entities() const
const GeoModelMeshEntity< DIMENSION > & child(index_t x) const
Abstract base class for GeoModelMeshEntity.
GeologicalEntityType entity_type() const
virtual GeologicalEntityType type_name() const
The GeologicalEntityType described the type of the Geological entities User can defined there own Geo...
index_t nb_boundaries() const
const gmme_id & boundary_gmme(index_t x) const
GeoModelBuilderRemovalBase(GeoModelBuilder< DIMENSION > &builder, GeoModel< DIMENSION > &geomodel)
index_t & modifiable_index()
virtual void update_mesh_entity(GeoModelMeshEntity< DIMENSION > &ME)
const gmge_id & parent_gmge(index_t id) const
index_t nb_parents() const
const gmme_id & incident_entity_gmme(index_t x) const
const gmme_id & child_gmme(index_t x) const
bool is_valid_type(const MeshEntityType &type) const
Builder tools to remove entities from a GeoModel.
#define ringmesh_assert(x)
GeoModelBuilderRemoval(GeoModelBuilder< DIMENSION > &builder, GeoModel< DIMENSION > &geomodel)
index_t & modifiable_index()
index_t nb_children() const
const MeshEntityType & incident_entity_type(const MeshEntityType &mesh_entity_type) const
The MeshEntityType described the type of the meshed entities There are 4 MeshEntityTypes correspondin...
This template is a specialization of a gme_id to the GeoModelGeologicalEntity.
Classes to build GeoModel from various inputs.
This template is a specialization of a gme_id to the GeoModelMeshEntity.
MeshEntityType mesh_entity_type() const