CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe, which represents a collection of cells that can be defined repeatedly within a separate container of cells. More...
#include <CSGUniverse.h>
Public Member Functions | |
| CSGUniverse (const std::string &name, bool is_root=false) | |
| Construct a new CSGUniverse object. More... | |
| CSGUniverse (const std::string &name, std::vector< CSGCell *> &cells, bool is_root=false) | |
| Construct a new CSGUniverse object from list of cells. More... | |
| virtual | ~CSGUniverse ()=default |
| Destructor. More... | |
| const CSGCell & | getCell (const std::string &name) |
| Get the CSGCell object by name. More... | |
| bool | hasCell (const std::string &name) const |
| check if cell of provided name is present in universe More... | |
| const std::vector< std::reference_wrapper< const CSGCell > > & | getAllCells () const |
| Get list of the all cells in the universe. More... | |
| const std::string & | getName () const |
| Get the name of the universe. More... | |
| bool | isRoot () const |
| return true if the universe is the root universe More... | |
| bool | operator== (const CSGUniverse &other) const |
| Operator overload for checking if two CSGUniverse objects are equal. More... | |
| bool | operator!= (const CSGUniverse &other) const |
| Operator overload for checking if two CSGUniverse objects are not equal. More... | |
Protected Member Functions | |
| void | addCell (const CSGCell &cell) |
| add cell to universe More... | |
| void | removeCell (const std::string &name) |
| remove a cell of the specified name from the universe More... | |
| void | removeAllCells () |
| remove all cells from the universe More... | |
| void | setName (const std::string &name) |
| FRIEND_TEST (CSGUniverseTest, testGetCell) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGUniverseTest, testAddCell) | |
| FRIEND_TEST (CSGUniverseTest, testRemoveCell) | |
| FRIEND_TEST (CSGUniverseTest, testRemoveAllCells) | |
| FRIEND_TEST (CSGUniverseTest, testSetName) | |
Protected Attributes | |
| std::string | _name |
| Name of universe. More... | |
| std::vector< std::reference_wrapper< const CSGCell > > | _cells |
| list of references to cells in universe More... | |
| bool | _is_root |
| whether or not this universe is the root universe More... | |
Friends | |
| class | CSGUniverseList |
| class | CSGBase |
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe, which represents a collection of cells that can be defined repeatedly within a separate container of cells.
Definition at line 26 of file CSGUniverse.h.
| CSG::CSGUniverse::CSGUniverse | ( | const std::string & | name, |
| bool | is_root = false |
||
| ) |
Construct a new CSGUniverse object.
| name | unique name of universe |
| is_root | true to set universe as the root universe (default false) |
Definition at line 15 of file CSGUniverse.C.
| CSG::CSGUniverse::CSGUniverse | ( | const std::string & | name, |
| std::vector< CSGCell *> & | cells, | ||
| bool | is_root = false |
||
| ) |
Construct a new CSGUniverse object from list of cells.
| name | unique name of universe |
| cells | list of cells to add to universe |
| is_root | true to set universe as the root universe (default false) |
Definition at line 17 of file CSGUniverse.C.
|
virtualdefault |
Destructor.
add cell to universe
| reference | to cell to add |
Definition at line 25 of file CSGUniverse.C.
Referenced by CSG::CSGBase::addCellToUniverse(), and CSGUniverse().
|
protected |
Friends for unit testing.
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
Get list of the all cells in the universe.
Definition at line 72 of file CSGUniverse.h.
Referenced by CSG::CSGBase::getLinkedUniverses(), and operator==().
| const CSGCell & CSG::CSGUniverse::getCell | ( | const std::string & | name | ) |
Get the CSGCell object by name.
| name | name of cell |
Definition at line 36 of file CSGUniverse.C.
|
inline |
Get the name of the universe.
Definition at line 79 of file CSGUniverse.h.
Referenced by addCell(), CSG::CSGBase::addCellToUniverse(), CSG::CSGBase::checkUniverseInBase(), CSG::CSGBase::getLinkedUniverses(), operator==(), CSG::CSGBase::removeCellFromUniverse(), and CSG::CSGUniverseList::renameUniverse().
| bool CSG::CSGUniverse::hasCell | ( | const std::string & | name | ) | const |
check if cell of provided name is present in universe
| name | name of cell |
Definition at line 47 of file CSGUniverse.C.
Referenced by addCell(), getCell(), and removeCell().
|
inline |
return true if the universe is the root universe
Definition at line 86 of file CSGUniverse.h.
| bool CSG::CSGUniverse::operator!= | ( | const CSGUniverse & | other | ) | const |
Operator overload for checking if two CSGUniverse objects are not equal.
Definition at line 93 of file CSGUniverse.C.
| bool CSG::CSGUniverse::operator== | ( | const CSGUniverse & | other | ) | const |
Operator overload for checking if two CSGUniverse objects are equal.
Definition at line 70 of file CSGUniverse.C.
|
inlineprotected |
remove all cells from the universe
Definition at line 112 of file CSGUniverse.h.
|
protected |
remove a cell of the specified name from the universe
| name | name of cell to remove |
Definition at line 56 of file CSGUniverse.C.
Referenced by CSG::CSGBase::removeCellFromUniverse().
|
inlineprotected |
Definition at line 116 of file CSGUniverse.h.
|
friend |
Definition at line 131 of file CSGUniverse.h.
|
friend |
Definition at line 128 of file CSGUniverse.h.
|
protected |
list of references to cells in universe
Definition at line 122 of file CSGUniverse.h.
Referenced by addCell(), getAllCells(), getCell(), hasCell(), removeAllCells(), and removeCell().
|
protected |
whether or not this universe is the root universe
Definition at line 125 of file CSGUniverse.h.
Referenced by isRoot().
|
protected |
Name of universe.
Definition at line 119 of file CSGUniverse.h.
Referenced by getCell(), getName(), removeCell(), and setName().
1.8.14