43 #include <geogram/basic/command_line.h> 52 template < index_t DIMENSION >
53 void compute_mesh_entity_bbox(
62 template < index_t DIMENSION >
63 double compute_percentage_bbox_diagonal(
71 compute_mesh_entity_bbox( gm.
surface( s ), bbox );
78 compute_mesh_entity_bbox( gm.
line( l ), bbox );
90 * GEO::CmdLine::get_arg_double(
"epsilon" );
96 template < index_t DIMENSION >
102 template < index_t DIMENSION >
107 template < index_t DIMENSION >
112 entity_type_manager().mesh_entity_manager;
123 return nb_surfaces();
129 template < index_t DIMENSION >
134 entity_type_manager().mesh_entity_manager;
136 index_t index =
id.index();
139 return line( index );
143 return corner( index );
147 return surface( index );
153 template < index_t DIMENSION >
154 const std::vector< std::unique_ptr< GeoModelMeshEntity< DIMENSION > > >&
159 entity_type_manager().mesh_entity_manager;
176 template < index_t DIMENSION >
178 index_t index )
const 182 corners_[index].get() );
184 template < index_t DIMENSION >
186 index_t index )
const 191 template < index_t DIMENSION >
193 index_t index )
const 197 surfaces_[index].get() );
200 template < index_t DIMENSION >
207 template < index_t DIMENSION >
212 epsilon_ = compute_percentage_bbox_diagonal( *
this );
217 template < index_t DIMENSION >
241 return *
static_cast< const Region3D*
>( regions_[index].get() );
244 const std::vector< std::unique_ptr< GeoModelMeshEntity3D > >&
251 return GeoModelBase3D::mesh_entities( type );
258 index_t index =
id.index();
261 return region( index );
263 return GeoModelBase3D::mesh_entity(
id );
274 return GeoModelBase3D::nb_mesh_entities( type );
280 auto& voi_surfaces = surface_side.
surfaces_;
282 auto& voi_surface_region_side = surface_side.
sides_;
285 for(
const auto& cur_surface :
surfaces() )
287 if( cur_surface.is_on_voi() )
290 voi_surfaces.push_back( cur_surface.index() );
291 const auto& incident_region = cur_surface.incident_entity( 0 );
293 index_t local_boundary_id{ NO_ID };
294 for(
auto region_boundary_i :
295 range( incident_region.nb_boundaries() ) )
297 if( incident_region.boundary_gmme( region_boundary_i )
299 == cur_surface.index() )
301 local_boundary_id = region_boundary_i;
307 voi_surface_region_side.push_back(
308 incident_region.side( local_boundary_id ) );
318 auto& voi_lines = line_side.
lines_;
320 auto& voi_line_surface_side = line_side.
sides_;
321 voi_line_surface_side.reserve(
nb_lines() );
323 for(
const auto& cur_line :
lines() )
325 if( cur_line.is_on_voi() )
328 voi_lines.push_back( cur_line.index() );
329 const auto& incident_surface = cur_line.incident_entity( 0 );
331 index_t local_boundary_id{ NO_ID };
332 for(
auto surface_boundary_i :
333 range( incident_surface.nb_boundaries() ) )
335 if( incident_surface.boundary_gmme( surface_boundary_i )
337 == cur_line.index() )
339 local_boundary_id = surface_boundary_i;
345 voi_line_surface_side.push_back(
346 incident_surface.side( local_boundary_id ) );
Abstract base class for GeoModelMeshEntity.
std::vector< bool > sides_
const EntityTypeManager< DIMENSION > & entity_type_manager() const
Gets the EntityTypeManager associated to the GeoModel.
const vecn< DIMENSION > & vertex(index_t vertex_index) const
Coordinates of the vertex_index.
virtual const GeoModelMeshEntity< DIMENSION > & mesh_entity(const gmme_id &id) const
Generic access to a meshed entity.
GeoModelBase(GeoModel< DIMENSION > &geomodel)
Constructs an empty GeoModel.
std::vector< bool > sides_
A GeoModelEntity of type CORNER.
bool is_line(const MeshEntityType &type) const
const Corner< DIMENSION > & corner(index_t index) const
bool is_surface(const MeshEntityType &type) const
void add_point(const vecn< DIMENSION > &p)
bool is_corner(const MeshEntityType &type) const
const Line< DIMENSION > & line(index_t index) const
const Surface< DIMENSION > & surface(index_t index) const
std::vector< index_t > surfaces_
std::vector< index_t > lines_
virtual const std::vector< std::unique_ptr< GeoModelMeshEntity< DIMENSION > > > & mesh_entities(const MeshEntityType &type) const
Generic accessor to the storage of mesh entities of the given type.
line_range< DIMENSION > lines() const
index_t nb_corners() const
#define ringmesh_assert(x)
index_t nb_surfaces() const
vecn< DIMENSION > diagonal() const
The MeshEntityType described the type of the meshed entities There are 4 MeshEntityTypes correspondin...
Classes to build GeoModel from various inputs.
surface_range< DIMENSION > surfaces() const
A GeoModelEntity of type LINE.
virtual index_t nb_mesh_entities(const MeshEntityType &type) const
Returns the number of mesh entities of the given type.
This template is a specialization of a gme_id to the GeoModelMeshEntity.
index_t nb_vertices() const
#define ringmesh_assert_not_reached