https://mooseframework.inl.gov
CSGBase.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 "CSGSurfaceList.h"
13 #include "CSGRegion.h"
14 #include "CSGCellList.h"
15 #include "CSGUniverseList.h"
16 #include "CSGLatticeList.h"
18 #include "nlohmann/json.h"
19 
20 #ifdef MOOSE_UNIT_TEST
21 #include "gtest/gtest.h"
22 #endif
23 
24 namespace CSG
25 {
26 
30 enum class RotationAxisType
31 {
32  X = 0, // X axis
33  Y = 1, // Y axis
34  Z = 2 // Z axis
35 };
36 
40 typedef std::variant<std::reference_wrapper<const CSGSurface>,
41  std::reference_wrapper<const CSGCell>,
42  std::reference_wrapper<const CSGUniverse>,
43  std::reference_wrapper<const CSGRegion>,
44  std::reference_wrapper<const CSGLattice>>
46 
51 class CSGBase
52 {
53 public:
57  CSGBase();
58 
62  CSGBase(const CSGBase & other_base);
63 
67  ~CSGBase();
68 
70  std::unique_ptr<CSGBase> clone() const { return std::make_unique<CSGBase>(*this); }
71 
79  const CSGSurface & addSurface(std::unique_ptr<CSGSurface> surf)
80  {
81  return _surface_list.addSurface(std::move(surf));
82  }
83 
90  void deleteSurface(const CSGSurface & surface);
91 
97  std::vector<std::reference_wrapper<const CSGSurface>> getAllSurfaces() const
98  {
100  }
101 
108  const CSGSurface & getSurfaceByName(const std::string & name) const
109  {
110  return _surface_list.getSurface(name);
111  }
112 
119  bool hasSurface(const std::string & name) const { return _surface_list.hasSurface(name); }
120 
127  void renameSurface(const CSGSurface & surface, const std::string & name)
128  {
129  _surface_list.renameSurface(surface, name);
130  }
131 
142  const CSGCell & createCell(const std::string & name,
143  const std::string & mat_name,
144  const CSGRegion & region,
145  const CSGUniverse * add_to_univ = nullptr);
146 
156  const CSGCell & createCell(const std::string & name,
157  const CSGRegion & region,
158  const CSGUniverse * add_to_univ = nullptr);
159 
170  const CSGCell & createCell(const std::string & name,
171  const CSGUniverse & fill_univ,
172  const CSGRegion & region,
173  const CSGUniverse * add_to_univ = nullptr);
174 
185  const CSGCell & createCell(const std::string & name,
186  const CSGLattice & fill_lattice,
187  const CSGRegion & region,
188  const CSGUniverse * add_to_univ = nullptr);
189 
196  void deleteCell(const CSGCell & cell);
197 
203  std::vector<std::reference_wrapper<const CSGCell>> getAllCells() const
204  {
205  return _cell_list.getAllCells();
206  }
207 
214  const CSGCell & getCellByName(const std::string & name) const { return _cell_list.getCell(name); }
215 
222  bool hasCell(const std::string & name) const { return _cell_list.hasCell(name); }
223 
230  void renameCell(const CSGCell & cell, const std::string & name)
231  {
232  _cell_list.renameCell(cell, name);
233  }
234 
241  void updateCellRegion(const CSGCell & cell, const CSGRegion & region);
242 
248  void resetCellFill(const CSGCell & cell);
249 
256  void updateCellFill(const CSGCell & cell, const std::string & mat_name);
257 
264  void updateCellFill(const CSGCell & cell, const CSGUniverse * univ);
265 
272  void updateCellFill(const CSGCell & cell, const CSGLattice * lattice);
273 
279  const CSGUniverse & getRootUniverse() const { return _universe_list.getRoot(); }
280 
286  void renameRootUniverse(const std::string & name)
287  {
289  }
290 
297  void renameUniverse(const CSGUniverse & universe, const std::string & name)
298  {
300  }
301 
308  const CSGUniverse & createUniverse(const std::string & name)
309  {
311  }
312 
320  const CSGUniverse & createUniverse(const std::string & name,
321  std::vector<std::reference_wrapper<const CSGCell>> & cells);
322 
329  void deleteUniverse(const CSGUniverse & univ);
330 
337  void addCellToUniverse(const CSGUniverse & universe, const CSGCell & cell);
338 
345  void addCellsToUniverse(const CSGUniverse & universe,
346  std::vector<std::reference_wrapper<const CSGCell>> & cells);
347 
354  void removeCellFromUniverse(const CSGUniverse & universe, const CSGCell & cell);
355 
362  void removeCellsFromUniverse(const CSGUniverse & universe,
363  std::vector<std::reference_wrapper<const CSGCell>> & cells);
364 
370  std::vector<std::reference_wrapper<const CSGUniverse>> getAllUniverses() const
371  {
373  }
374 
381  const CSGUniverse & getUniverseByName(const std::string & name)
382  {
384  }
385 
392  bool hasUniverse(const std::string & name) const { return _universe_list.hasUniverse(name); }
393 
402  template <typename LatticeType = CSGLattice>
403  const LatticeType & addLattice(std::unique_ptr<LatticeType> lattice)
404  {
405  static_assert(std::is_base_of_v<CSGLattice, LatticeType>, "Is not a CSGLattice");
406  // make sure all universes are a part of this base instance
407  auto universes = lattice->getUniverses();
408  for (auto univ_list : universes)
409  for (const CSGUniverse & univ : univ_list)
410  if (!checkUniverseInBase(univ))
411  mooseError("Cannot add lattice " + lattice->getName() + " of type " + lattice->getType() +
412  ". Universe " + univ.getName() + " is not in the CSGBase instance.");
413 
414  if (lattice->getOuterType() == "UNIVERSE")
415  {
416  const CSGUniverse & outer_univ = lattice->getOuterUniverse();
417  if (!checkUniverseInBase(outer_univ))
418  mooseError("Cannot add lattice " + lattice->getName() + " of type " + lattice->getType() +
419  ". Outer universe " + outer_univ.getName() + " is not in the CSGBase instance.");
420  }
421  auto & lat_ref = _lattice_list.addLattice(std::move(lattice));
422  return dynamic_cast<LatticeType &>(lat_ref);
423  }
424 
431  void deleteLattice(const CSGLattice & lattice);
432 
440  void setUniverseAtLatticeIndex(const CSGLattice & lattice,
441  const CSGUniverse & universe,
442  std::pair<int, int> index);
443 
451  void setLatticeUniverses(
452  const CSGLattice & lattice,
453  std::vector<std::vector<std::reference_wrapper<const CSGUniverse>>> & universes);
454 
461  void renameLattice(const CSGLattice & lattice, const std::string & name)
462  {
463  _lattice_list.renameLattice(lattice, name);
464  }
465 
473  void setLatticeOuter(const CSGLattice & lattice, const std::string & outer_name);
474 
482  void setLatticeOuter(const CSGLattice & lattice, const CSGUniverse & outer_univ);
483 
489  void resetLatticeOuter(const CSGLattice & lattice);
490 
496  std::vector<std::reference_wrapper<const CSGLattice>> getAllLattices() const
497  {
498  return _lattice_list.getAllLattices();
499  }
500 
512  template <typename LatticeType = CSGLattice>
513  const LatticeType & getLatticeByName(const std::string & name)
514  {
515  const CSGLattice & lattice = _lattice_list.getLattice(name);
516  const LatticeType * typed_lattice = dynamic_cast<const LatticeType *>(&lattice);
517  if (!typed_lattice)
518  mooseError("Cannot get lattice " + name + ". Lattice is not of specified type " +
519  MooseUtils::prettyCppType<LatticeType>());
520  return *typed_lattice;
521  }
522 
529  bool hasLattice(const std::string & name) const { return _lattice_list.hasLattice(name); }
530 
540  void joinOtherBase(std::unique_ptr<CSGBase> base, const bool ignore_identical_components);
541 
554  void joinOtherBase(std::unique_ptr<CSGBase> base,
555  const bool ignore_identical_components,
556  const std::string & new_root_name_join);
557 
572  void joinOtherBase(std::unique_ptr<CSGBase> base,
573  const bool ignore_identical_components,
574  const std::string & new_root_name_base,
575  const std::string & new_root_name_join);
576 
582  nlohmann::json generateOutput() const;
583 
585  bool operator==(const CSGBase & other) const;
586 
588  bool operator!=(const CSGBase & other) const;
589 
597  void addTransformation(const CSGObjectVariant & csg_object,
598  TransformationType type,
599  const std::tuple<Real, Real, Real> & values);
600 
607  void applyTranslation(const CSGObjectVariant & csg_object,
608  const std::tuple<Real, Real, Real> & distances)
609  {
610  addTransformation(csg_object, TransformationType::TRANSLATION, distances);
611  }
612 
619  void applyRotation(const CSGObjectVariant & csg_object,
620  const std::tuple<Real, Real, Real> & angles)
621  {
622  addTransformation(csg_object, TransformationType::ROTATION, angles);
623  }
624 
632  void
633  applyAxisRotation(const CSGObjectVariant & csg_object, RotationAxisType axis, const Real angle);
634 
641  void applyScaling(const CSGObjectVariant & csg_object,
642  const std::tuple<Real, Real, Real> & values)
643  {
644  addTransformation(csg_object, TransformationType::SCALE, values);
645  }
646 
647 private:
657  CSGSurface & getSurface(const std::string & name) { return _surface_list.getSurface(name); }
658 
660  void checkUniverseLinking() const;
661 
669  void getLinkedUniverses(const CSGUniverse & univ,
670  std::vector<std::string> & linked_universe_names,
671  std::vector<std::string> & linked_cell_names) const;
672 
678  const CSGSurfaceList & getSurfaceList() const { return _surface_list; }
679 
686 
692  const CSGCellList & getCellList() const { return _cell_list; }
693 
700 
706  const CSGUniverseList & getUniverseList() const { return _universe_list; }
707 
714 
720  const CSGLatticeList & getLatticeList() const { return _lattice_list; }
721 
728 
736  void updateIncomingCSGReferences(CSGBase & incoming_base);
737 
747  std::map<std::string, std::reference_wrapper<const CSGSurface>> & identical_surface_refs,
748  CSGBase & base);
749 
759  std::map<std::string, std::reference_wrapper<const CSGCell>> & identical_cell_refs,
760  CSGBase & base);
761 
772  std::map<std::string, std::reference_wrapper<const CSGUniverse>> & identical_universe_refs,
773  CSGBase & base);
774 
784  std::map<std::string, std::reference_wrapper<const CSGLattice>> & identical_lattice_refs,
785  CSGBase & base);
786 
794  void joinSurfaceList(CSGSurfaceList & surf_list, const bool ignore_identical_surfaces);
795 
803  void joinCellList(CSGCellList & cell_list, const bool ignore_identical_cells);
804 
812  void joinLatticeList(CSGLatticeList & lattice_list, const bool ignore_identical_lattices);
813 
822  void joinUniverseList(CSGUniverseList & univ_list, const bool ignore_identical_universes);
823 
835  void joinUniverseList(CSGUniverseList & univ_list,
836  const bool ignore_identical_universes,
837  const std::string & new_root_name_incoming);
838 
852  void joinUniverseList(CSGUniverseList & univ_list,
853  const bool ignore_identical_universes,
854  const std::string & new_root_name_base,
855  const std::string & new_root_name_incoming);
856 
857  // check that surfaces used in this region are a part of this CSGBase instance
858  void checkRegionSurfaces(const CSGRegion & region) const;
859 
860  // check that surface being accessed is a part of this CSGBase instance
861  bool checkSurfaceInBase(const CSGSurface & surface) const;
862 
863  // check that cell being accessed is a part of this CSGBase instance
864  bool checkCellInBase(const CSGCell & cell) const;
865 
866  // check that universe being accessed is a part of this CSGBase instance
867  bool checkUniverseInBase(const CSGUniverse & universe) const;
868 
869  // check that lattice being accessed is a part of this CSGBase instance
870  bool checkLatticeInBase(const CSGLattice & lattice) const;
871 
878  const CSGCell & addCellToList(const CSGCell & cell);
879 
886  const CSGUniverse & addUniverseToList(const CSGUniverse & univ);
887 
894  const CSGLattice & addLatticeToList(const CSGLattice & lattice);
895 
898 
901 
904 
907 
908 #ifdef MOOSE_UNIT_TEST
909  FRIEND_TEST(CSGBaseTest, testCheckRegionSurfaces);
912  FRIEND_TEST(CSGBaseTest, testAddGetSurface);
913  FRIEND_TEST(CSGBaseTest, testUniverseLinking);
915 #endif
916 };
917 } // namespace CSG
std::string name(const ElemQuality q)
void updateIncomingCSGReferences(CSGBase &incoming_base)
update references of incoming CSGbase to point to those of existing CSGBase object.
Definition: CSGBase.C:708
bool hasUniverse(const std::string &name) const
Check if a universe with given name exists in CSGBase object.
Definition: CSGBase.h:392
bool hasSurface(const std::string &name) const
return whether surface with given name exists in surface list
bool checkLatticeInBase(const CSGLattice &lattice) const
Definition: CSGBase.C:976
void setUniverseAtLatticeIndex(const CSGLattice &lattice, const CSGUniverse &universe, std::pair< int, int > index)
set location in the lattice to be the provided universe
Definition: CSGBase.C:510
CSGLattice & addLattice(std::unique_ptr< CSGLattice > lattice, const bool ignore_identical_lattice=false)
add an existing lattice to list.
void renameUniverse(const CSGUniverse &universe, const std::string &name)
rename the specified universe
Definition: CSGBase.h:297
void applyScaling(const CSGObjectVariant &csg_object, const std::tuple< Real, Real, Real > &values)
Scale a CSG object in the specified x, y, and z directions.
Definition: CSGBase.h:641
CSGCell & getCell(const std::string &name) const
Get the CSGCell by name.
Definition: CSGCellList.C:44
std::vector< std::reference_wrapper< const CSGUniverse > > getAllUniverses() const
Get all the universes in CSGBase instance.
std::vector< std::reference_wrapper< const CSGUniverse > > getAllUniverses() const
Get all universe objects.
Definition: CSGBase.h:370
void replaceUniverseRefsByName(std::map< std::string, std::reference_wrapper< const CSGUniverse >> &identical_universe_refs, CSGBase &base)
update universe references of incoming CSGbase to point to those of existing CSGBase object based on ...
Definition: CSGBase.C:783
CSGUniverseList _universe_list
List of universes associated with CSG object.
Definition: CSGBase.h:903
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection...
Definition: CSGRegion.h:22
CSGCellList creates a container for CSGCell objects to pass to CSGBase object.
Definition: CSGCellList.h:20
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::unique_ptr< CSGBase > clone() const
Create a deep copy of this CSGBase instance.
Definition: CSGBase.h:70
void renameLattice(const CSGLattice &lattice, const std::string &name)
rename the lattice
Definition: CSGBase.h:461
const CSGLatticeList & getLatticeList() const
Get a const reference to the CSGLatticeList object.
Definition: CSGBase.h:720
const CSGCell & createCell(const std::string &name, const std::string &mat_name, const CSGRegion &region, const CSGUniverse *add_to_univ=nullptr)
Create a Material Cell object.
Definition: CSGBase.C:199
void setLatticeOuter(const CSGLattice &lattice, const std::string &outer_name)
Set the outer fill for the lattice to the material name provided.
Definition: CSGBase.C:474
void joinSurfaceList(CSGSurfaceList &surf_list, const bool ignore_identical_surfaces)
join a separate CSGSurfaceList object to this one
Definition: CSGBase.C:839
void deleteLattice(const CSGLattice &lattice)
Remove a Lattice object passed in by reference from the stored lattice list.
Definition: CSGBase.C:176
const CSGSurface & getSurfaceByName(const std::string &name) const
Get a Surface object by name.
Definition: CSGBase.h:108
std::vector< std::reference_wrapper< const CSGCell > > getAllCells() const
Get all the cells in CSGBase instance.
Definition: CSGCellList.C:83
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
Definition: CSGUniverse.h:27
std::vector< std::reference_wrapper< const CSGLattice > > getAllLattices() const
Get all lattice objects.
Definition: CSGBase.h:496
bool operator==(const CSGBase &other) const
Operator overload for checking if two CSGBase objects are equal.
Definition: CSGBase.C:1133
std::vector< std::reference_wrapper< const CSGLattice > > getAllLattices() const
Get all the lattices in CSGBase instance.
CSGSurface & getSurface(const std::string &name) const
Get a surface by name.
void applyAxisRotation(const CSGObjectVariant &csg_object, RotationAxisType axis, const Real angle)
Apply a rotation to a CSG object about a specified axis (X, Y, Z).
Definition: CSGBase.C:633
void renameLattice(const CSGLattice &lattice, const std::string &name)
rename the specified lattice
CSGSurfaceList _surface_list
List of surfaces associated with CSG object.
Definition: CSGBase.h:897
TransformationType
Enumeration of transformation types that can be applied to CSG objects.
void addTransformation(const CSGObjectVariant &csg_object, TransformationType type, const std::tuple< Real, Real, Real > &values)
Apply a transformation to a CSG object.
Definition: CSGBase.C:545
nlohmann::json generateOutput() const
generate the JSON representation output for the CSG object
Definition: CSGBase.C:1041
CSGLatticeList creates a container for CSGLattice objects to pass to CSGBase.
void updateCellFill(const CSGCell &cell, const std::string &mat_name)
change the fill of the specified cell to a material fill
Definition: CSGBase.C:328
void applyRotation(const CSGObjectVariant &csg_object, const std::tuple< Real, Real, Real > &angles)
Apply a rotation to a CSG object using (phi, theta, psi) angle notation (in degrees).
Definition: CSGBase.h:619
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get list of references to all surfaces in surface list.
void getLinkedUniverses(const CSGUniverse &univ, std::vector< std::string > &linked_universe_names, std::vector< std::string > &linked_cell_names) const
Recursive method to retrieve all universes and cells linked to current universe.
Definition: CSGBase.C:1010
void joinLatticeList(CSGLatticeList &lattice_list, const bool ignore_identical_lattices)
join a separate CSGLatticeList object to this one
Definition: CSGBase.C:855
CSGUniverse & getUniverse(const std::string &name) const
Get a Universe from the list by its name.
CSGLattice is the abstract class for defining lattices.
Definition: CSGLattice.h:34
bool hasLattice(const std::string &name) const
return whether lattice with given name exists in lattice list
const std::string & getName() const
Get the name of the universe.
Definition: CSGUniverse.h:80
void addCellsToUniverse(const CSGUniverse &universe, std::vector< std::reference_wrapper< const CSGCell >> &cells)
Add a list of cells to an existing universe.
Definition: CSGBase.C:441
const CSGUniverse & getRootUniverse() const
Get the Root Universe object.
Definition: CSGBase.h:279
void updateCellRegion(const CSGCell &cell, const CSGRegion &region)
change the region of the specified cell
Definition: CSGBase.C:305
CSGUniverseList creates a container for CSGUniverse objects to pass to CSGBase.
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
void joinOtherBase(std::unique_ptr< CSGBase > base, const bool ignore_identical_components)
Join another CSGBase object to this one.
Definition: CSGBase.C:663
FRIEND_TEST(CSGBaseTest, testCheckRegionSurfaces)
Friends for unit testing.
void renameCell(const CSGCell &cell, const std::string &name)
rename the specified cell
Definition: CSGBase.h:230
const CSGUniverse & getRoot() const
Get the root universe.
void joinCellList(CSGCellList &cell_list, const bool ignore_identical_cells)
join a separate CSGCellList object to this one
Definition: CSGBase.C:847
CSGLatticeList & getLatticeList()
Get the CSGLatticeList object.
Definition: CSGBase.h:727
const LatticeType & addLattice(std::unique_ptr< LatticeType > lattice)
add a unique lattice pointer to this base instance; universes that make the lattice must already be a...
Definition: CSGBase.h:403
const CSGUniverse & addUniverseToList(const CSGUniverse &univ)
Add a new universe to the universe list based on a universe reference.
Definition: CSGBase.C:120
void renameRootUniverse(const std::string &name)
rename the root universe for this instance (default is ROOT_UNIVERSE)
Definition: CSGBase.h:286
CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf, const bool ignore_identical_surface=false)
add a surface object to existing SurfaceList.
const CSGSurface & addSurface(std::unique_ptr< CSGSurface > surf)
add a unique surface pointer to this base instance
Definition: CSGBase.h:79
void removeCellsFromUniverse(const CSGUniverse &universe, std::vector< std::reference_wrapper< const CSGCell >> &cells)
Remove a list of cells from an existing universe.
Definition: CSGBase.C:466
void setLatticeUniverses(const CSGLattice &lattice, std::vector< std::vector< std::reference_wrapper< const CSGUniverse >>> &universes)
Set provided universes as the layout of the lattice.
Definition: CSGBase.C:526
void replaceLatticeRefsByName(std::map< std::string, std::reference_wrapper< const CSGLattice >> &identical_lattice_refs, CSGBase &base)
update lattice references of incoming CSGbase to point to those of existing CSGBase object based on C...
Definition: CSGBase.C:820
void replaceSurfaceRefsByName(std::map< std::string, std::reference_wrapper< const CSGSurface >> &identical_surface_refs, CSGBase &base)
update surface references of incoming CSGBase to point to those of existing CSGBase object based on C...
Definition: CSGBase.C:758
bool hasSurface(const std::string &name) const
Check if a surface with given name exists in CSGBase object.
Definition: CSGBase.h:119
CSGSurface & getSurface(const std::string &name)
Get a Surface object by name.
Definition: CSGBase.h:657
void joinUniverseList(CSGUniverseList &univ_list, const bool ignore_identical_universes)
join a separate CSGUniverseList object to this one; root universes from univ_list will be combined in...
Definition: CSGBase.C:863
bool hasCell(const std::string &name) const
Check if a cell with given name exists in CSGBase object.
Definition: CSGBase.h:222
CSGUniverse & addUniverse(const std::string &name)
create an empty universe
bool checkUniverseInBase(const CSGUniverse &universe) const
Definition: CSGBase.C:966
bool hasLattice(const std::string &name) const
Check if a lattice with given name exists in CSGBase object.
Definition: CSGBase.h:529
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
Definition: CSGCell.h:29
bool operator!=(const CSGBase &other) const
Operator overload for checking if two CSGBase objects are not equal.
Definition: CSGBase.C:1148
void checkRegionSurfaces(const CSGRegion &region) const
Definition: CSGBase.C:934
std::variant< std::reference_wrapper< const CSGSurface >, std::reference_wrapper< const CSGCell >, std::reference_wrapper< const CSGUniverse >, std::reference_wrapper< const CSGRegion >, std::reference_wrapper< const CSGLattice > > CSGObjectVariant
Define a variant type that can hold references to different CSG object types.
Definition: CSGBase.h:45
bool checkSurfaceInBase(const CSGSurface &surface) const
Definition: CSGBase.C:946
void applyTranslation(const CSGObjectVariant &csg_object, const std::tuple< Real, Real, Real > &distances)
Apply a translation to a CSG object in the specified x, y, and z directions.
Definition: CSGBase.h:607
CSGCellList _cell_list
List of cells associated with CSG object.
Definition: CSGBase.h:900
void deleteUniverse(const CSGUniverse &univ)
Remove a Universe object passed in by reference from the stored universe list.
Definition: CSGBase.C:380
CSGCellList & getCellList()
Get a non-const reference to the CSGCellList object.
Definition: CSGBase.h:699
CSGLatticeList _lattice_list
List of lattices associated with CSG object.
Definition: CSGBase.h:906
const CSGCell & getCellByName(const std::string &name) const
Get a Cell object by name.
Definition: CSGBase.h:214
void renameUniverse(const CSGUniverse &universe, const std::string &name)
rename the specified universe
void resetLatticeOuter(const CSGLattice &lattice)
reset the outer fill for the lattice to VOID
Definition: CSGBase.C:499
const LatticeType & getLatticeByName(const std::string &name)
Get a lattice object of the specified type by name This is a templated method with a default type of ...
Definition: CSGBase.h:513
CSGUniverseList & getUniverseList()
Get a non-const reference to the CSGUniverseList object.
Definition: CSGBase.h:713
const CSGSurfaceList & getSurfaceList() const
Get a const reference to the CSGSurfaceList object.
Definition: CSGBase.h:678
void renameCell(const CSGCell &cell, const std::string &name)
rename the specified cell
Definition: CSGCellList.C:92
bool checkCellInBase(const CSGCell &cell) const
Definition: CSGBase.C:956
CSGSurfaceList is a container for storing CSGSurface objects in the CSGBase object.
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface...
Definition: CSGSurface.h:26
bool hasUniverse(const std::string &name) const
return whether universe with given name exists in universe list
CSGBase()
Default constructor.
Definition: CSGBase.C:17
const CSGCell & addCellToList(const CSGCell &cell)
Add a new cell to the cell list based on a cell reference.
Definition: CSGBase.C:85
const CSGUniverse & createUniverse(const std::string &name)
Create an empty Universe object.
Definition: CSGBase.h:308
void replaceCellRefsByName(std::map< std::string, std::reference_wrapper< const CSGCell >> &identical_cell_refs, CSGBase &base)
update cell references of incoming CSGbase to point to those of existing CSGBase object based on CSGC...
Definition: CSGBase.C:768
const CSGCellList & getCellList() const
Get a const reference to the CSGCellList object.
Definition: CSGBase.h:692
void deleteCell(const CSGCell &cell)
Remove a Cell object passed in by reference from the stored cell list.
Definition: CSGBase.C:275
void addCellToUniverse(const CSGUniverse &universe, const CSGCell &cell)
Add a cell to an existing universe.
Definition: CSGBase.C:424
CSGSurfaceList & getSurfaceList()
Get a non-const reference to the CSGSurfaceList object.
Definition: CSGBase.h:685
const CSGLattice & addLatticeToList(const CSGLattice &lattice)
Add a new lattice to the lattice list based on a lattice reference.
Definition: CSGBase.C:138
void checkUniverseLinking() const
Check universes linked to root universe match universes defined in _universe_list.
Definition: CSGBase.C:986
std::vector< std::reference_wrapper< const CSGCell > > getAllCells() const
Get all cell objects.
Definition: CSGBase.h:203
~CSGBase()
Destructor.
Definition: CSGBase.C:56
void renameSurface(const CSGSurface &surface, const std::string &name)
rename the specified surface
Definition: CSGBase.h:127
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
Definition: CSGBase.h:51
void deleteSurface(const CSGSurface &surface)
Remove a Surface object passed in by reference from the stored surface list.
Definition: CSGBase.C:59
const CSGUniverseList & getUniverseList() const
Get a const reference to the CSGUniverseList object.
Definition: CSGBase.h:706
bool hasCell(const std::string &name) const
return whether cell with given name exists in cell list
Definition: CSGCellList.h:85
void resetCellFill(const CSGCell &cell)
reset the fill of the specified cell to void
Definition: CSGBase.C:317
const CSGUniverse & getUniverseByName(const std::string &name)
Get a universe object by name.
Definition: CSGBase.h:381
CSGLattice & getLattice(const std::string &name) const
Get a Lattice from the list by its name.
RotationAxisType
Enumeration of axis types for rotations.
Definition: CSGBase.h:30
void removeCellFromUniverse(const CSGUniverse &universe, const CSGCell &cell)
Remove a cell from an existing universe.
Definition: CSGBase.C:449
std::vector< std::reference_wrapper< const CSGSurface > > getAllSurfaces() const
Get all surface objects.
Definition: CSGBase.h:97