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... | |
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & | getTransformations () const |
| Get the list of transformations. More... | |
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > | getTransformationsAsStrings () const |
| Get the transformations of this object with string representations for types. More... | |
Static Public Member Functions | |
| static bool | isValidTransformationValue (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Check if the transformation value is valid for the given type. More... | |
| static std::string | getTransformationTypeString (TransformationType type) |
| Get the string representation of the transformation type. 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) |
| void | addTransformation (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Add a transformation to the list of transformations. More... | |
| Point | applyReverseTransformsToPoint (Point p) const |
| update the value of point p by applying the inverse of the list of transformations to the point More... | |
| 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) | |
| FRIEND_TEST (CSGUniverseTest, testUniverseEquality) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
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... | |
| std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > | _transformations |
| List of transformations applied to this object. 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 27 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 17 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 19 of file CSGUniverse.C.
|
virtualdefault |
Destructor.
add cell to universe
| reference | to cell to add |
Definition at line 28 of file CSGUniverse.C.
Referenced by CSG::CSGBase::addCellToUniverse(), and CSGUniverse().
|
protectedinherited |
Add a transformation to the list of transformations.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 16 of file CSGTransformationHelper.C.
|
protectedinherited |
update the value of point p by applying the inverse of the list of transformations to the point
| p | point to transform |
Definition at line 74 of file CSGTransformationHelper.C.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint().
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protected |
Friends for unit testing.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
Get list of the all cells in the universe.
Definition at line 73 of file CSGUniverse.h.
Referenced by CSG::CSGBase::addUniverseToList(), CSG::CSGBase::CSGBase(), 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 39 of file CSGUniverse.C.
|
inline |
Get the name of the universe.
Definition at line 80 of file CSGUniverse.h.
Referenced by addCell(), CSG::CSGBase::addCellToUniverse(), CSG::CSGBase::addLattice(), CSG::CSGBase::addTransformation(), CSG::CSGBase::addUniverseToList(), CSG::CSGBase::checkUniverseInBase(), CSG::CSGBase::deleteUniverse(), CSG::CSGCell::getFillName(), CSG::CSGBase::getLinkedUniverses(), CSG::CSGLattice::getUniverseIndices(), operator==(), CSG::CSGBase::removeCellFromUniverse(), CSG::CSGUniverseList::renameUniverse(), CSG::CSGBase::setLatticeOuter(), CSG::CSGBase::setUniverseAtLatticeIndex(), and CSG::CSGBase::updateCellFill().
|
inlineinherited |
Get the list of transformations.
Definition at line 47 of file CSGTransformationHelper.h.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint(), operator==(), CSG::CSGSurface::operator==(), CSG::CSGCell::operator==(), and CSG::CSGLattice::operator==().
|
inherited |
Get the transformations of this object with string representations for types.
Definition at line 65 of file CSGTransformationHelper.C.
|
staticinherited |
Get the string representation of the transformation type.
| type | The transformation type |
Definition at line 56 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
| 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 50 of file CSGUniverse.C.
Referenced by addCell(), getCell(), and removeCell().
|
inline |
return true if the universe is the root universe
Definition at line 87 of file CSGUniverse.h.
|
staticinherited |
Check if the transformation value is valid for the given type.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 26 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation().
| 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 73 of file CSGUniverse.C.
|
inlineprotected |
remove all cells from the universe
Definition at line 113 of file CSGUniverse.h.
|
protected |
remove a cell of the specified name from the universe
| name | name of cell to remove |
Definition at line 59 of file CSGUniverse.C.
Referenced by CSG::CSGBase::deleteCell(), and CSG::CSGBase::removeCellFromUniverse().
|
inlineprotected |
Definition at line 117 of file CSGUniverse.h.
|
friend |
Definition at line 132 of file CSGUniverse.h.
|
friend |
Definition at line 129 of file CSGUniverse.h.
|
protected |
list of references to cells in universe
Definition at line 123 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 126 of file CSGUniverse.h.
Referenced by isRoot().
|
protected |
Name of universe.
Definition at line 120 of file CSGUniverse.h.
Referenced by getCell(), getName(), removeCell(), and setName().
|
protectedinherited |
List of transformations applied to this object.
Definition at line 92 of file CSGTransformationHelper.h.
Referenced by CSG::CSGTransformationHelper::addTransformation(), CSG::CSGTransformationHelper::applyReverseTransformsToPoint(), CSG::CSGTransformationHelper::getTransformations(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
1.8.14