https://mooseframework.inl.gov
CSGUniverseList.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "CSGUniverse.h"
13 
14 namespace CSG
15 {
16 
21 {
22 protected:
27 
31  virtual ~CSGUniverseList() = default;
32 
39  CSGUniverse & addUniverse(const std::string & name);
40 
46  std::unordered_map<std::string, std::unique_ptr<CSGUniverse>> & getUniverseListMap()
47  {
48  return _universes;
49  }
50 
56  std::vector<std::reference_wrapper<const CSGUniverse>> getAllUniverses() const;
57 
64  CSGUniverse & getUniverse(const std::string & name) const;
65 
71  const CSGUniverse & getRoot() const { return *_root_universe; };
72 
80  CSGUniverse & addUniverse(std::unique_ptr<CSGUniverse> universe);
81 
88  void renameUniverse(const CSGUniverse & universe, const std::string & name);
89 
91  std::unordered_map<std::string, std::unique_ptr<CSGUniverse>> _universes;
92 
95 
96  // Only CSGBase should be calling the methods in CSGUniverseList
97  friend class CSGBase;
98 };
99 } // namespace CSG
std::string name(const ElemQuality q)
std::vector< std::reference_wrapper< const CSGUniverse > > getAllUniverses() const
Get all the universes in CSGBase instance.
const CSGUniverse * _root_universe
root universe for the CSGBase instance
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
Definition: CSGUniverse.h:26
CSGUniverse & getUniverse(const std::string &name) const
Get a Universe from the list by its name.
CSGUniverseList creates a container for CSGUniverse objects to pass to CSGBase.
const CSGUniverse & getRoot() const
Get the root universe.
CSGUniverse & addUniverse(const std::string &name)
create an empty universe
void renameUniverse(const CSGUniverse &universe, const std::string &name)
rename the specified universe
std::unordered_map< std::string, std::unique_ptr< CSGUniverse > > _universes
Mapping of universe names to pointers of stored universe objects.
CSGUniverseList()
Default constructor.
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
Definition: CSGBase.h:29
virtual ~CSGUniverseList()=default
Destructor.
std::unordered_map< std::string, std::unique_ptr< CSGUniverse > > & getUniverseListMap()
Get map of all names to universes in universe list.