27 mooseError(
"No surface by name " +
name +
" exists in the geometry.");
29 return *(surf->second);
32 std::vector<std::reference_wrapper<const CSGSurface>>
35 std::vector<std::reference_wrapper<const CSGSurface>> surfaces;
37 surfaces.push_back(*(it->second));
44 auto surf_name = surf->
getName();
45 auto [it, inserted] =
_surfaces.emplace(surf_name, std::move(surf));
47 mooseError(
"Surface with name " + surf_name +
" already exists in geometry.");
55 auto prev_name = surface.
getName();
57 if (it ==
_surfaces.end() || it->second.get() != &surface)
58 mooseError(
"Surface " + prev_name +
" cannot be renamed to " +
name +
59 " as it does not exist in this CSGBase instance.");
61 auto existing_surface = std::move(it->second);
62 existing_surface->setName(
name);
std::string name(const ElemQuality q)
const std::string & getName() const
Get the name of surface.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
CSGSurface & getSurface(const std::string &name) const
Get a surface by name.
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get list of references to all surfaces in surface list.
std::unordered_map< std::string, std::unique_ptr< CSGSurface > > _surfaces
Mapping of surface names to pointers of stored surface objects.
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
CSGSurfaceList()
Default constructor.
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface...
CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf)
add a surface object to existing SurfaceList.