CSGSurfaceEngUnit is an abstract base class for "engineering units" that can be used as surfaces in cell region definitions. More...
#include <CSGSurfaceEngUnit.h>
Public Types | |
| enum | Halfspace { Halfspace::POSITIVE, Halfspace::NEGATIVE } |
| Enum for the sign of the half-space being represented by a point and surface. More... | |
Public Member Functions | |
| CSGSurfaceEngUnit (const std::string &name) | |
| Construct a new CSGSurfaceEngUnit. More... | |
| std::unordered_map< std::string, Real > | getCoeffs () const override |
| Always throws – coefficients are not defined for a surface engineering unit. More... | |
| Real | evaluateSurfaceEquationAtPoint (const Point &p) const override=0 |
| Evaluate the surface equation at the given point. More... | |
| const std::string & | getName () const override |
| Satisfy CSGEngUnit::getName() – resolved via CSGSurface::getName() More... | |
| bool | isEngUnit () const override |
| Engineering units report true so comparisons can skip the dynamic_cast fast path. More... | |
| bool | operator== (const CSGSurfaceEngUnit &other) const |
| Disambiguate == and != by forwarding to CSGEngUnit (name/property-based comparison) More... | |
| bool | operator!= (const CSGSurfaceEngUnit &other) const |
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & | getTransformations () const override |
| Delegate to CSGSurface (CSGTransformationHelper) More... | |
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > | getTransformationsAsStrings () const override |
| Delegate to CSGSurface (CSGTransformationHelper) More... | |
| const std::string | getSurfaceType () const |
| Get the Surface Type. More... | |
| CSGSurface::Halfspace | getHalfspaceFromPoint (const Point &p) const |
| given a point, determine if it is in the positive or negative half-space for the surface More... | |
| bool | operator== (const CSGSurface &other) const |
| Operator overload for checking if two CSGSurface objects are equal. More... | |
| bool | operator!= (const CSGSurface &other) const |
| Operator overload for checking if two CSGSurface objects are not equal. More... | |
| const std::string | getBehavior () const |
| Get the behavior of this engineering unit (surface (i.e. More... | |
| const std::string | getUnitType () const |
| Get the type name of this engineering unit. More... | |
| virtual std::unordered_map< std::string, AttributeVariant > | getAttributes () const =0 |
| Get the attributes that define this engineering unit. More... | |
| bool | operator== (const CSGEngUnit &other) const |
| Operator overload for checking if two CSGEngUnit objects are equal. More... | |
| bool | operator!= (const CSGEngUnit &other) const |
| Operator overload for checking if two CSGEngUnit objects are not equal. 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 | expandUnit () override=0 |
| Create and add the concrete CSGSurface(s) in _internal_base. More... | |
| CSGRegion | getExpandedRegion () const |
| Return the CSGRegion formed by the expanded CSGSurfaces. More... | |
| std::unique_ptr< CSGSurface > | clone () const override=0 |
| clone() is pure virtual – derived classes must implement 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... | |
| CSGBase & | getBase () |
| Get the internal CSGBase owned by this engineering unit. More... | |
| std::unique_ptr< CSGBase > | releaseBase () |
| Transfer ownership of the internal CSGBase out of this unit. More... | |
| FRIEND_TEST (CSGEngUnitTest, testSurfUnit) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testSetName) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testSurfaceEquality) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
| FRIEND_TEST (CSGEngUnitTest, testEngUnitEqual) | |
Protected Attributes | |
| CSGRegion | _expanded_region |
| Stores the result of expandUnit(); EMPTY until then. More... | |
| std::string | _name |
| Name of surface. More... | |
| std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > | _transformations |
| List of transformations applied to this object. More... | |
| std::unique_ptr< CSGBase > | _internal_base |
| CSGBase populated by expandUnit(); joined into the parent CSGBase by expandEngUnit() More... | |
| MooseEnum | _behavior {"SURFACE CELL UNIVERSE"} |
| The basic CSG type this unit produces: "SURFACE", "CELL", or "UNIVERSE". More... | |
Friends | |
| class | CSGBase |
CSGSurfaceEngUnit is an abstract base class for "engineering units" that can be used as surfaces in cell region definitions.
Derived classes define domain-specific surface attributes and implement expandUnit() and expandedRegion() methods to produce the equivalent representation using the basic CSGSurface components.
Derived classes must implement:
Definition at line 42 of file CSGSurfaceEngUnit.h.
|
stronginherited |
Enum for the sign of the half-space being represented by a point and surface.
| Enumerator | |
|---|---|
| POSITIVE | |
| NEGATIVE | |
Definition at line 30 of file CSGSurface.h.
| CSG::CSGSurfaceEngUnit::CSGSurfaceEngUnit | ( | const std::string & | name | ) |
Construct a new CSGSurfaceEngUnit.
| name | unique name of surface (will be preserved on the registered surface) |
Definition at line 15 of file CSGSurfaceEngUnit.C.
|
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.
Referenced by CSG::CSGBase::expandEngUnit().
|
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().
|
overrideprotectedpure virtual |
clone() is pure virtual – derived classes must implement
Implements CSG::CSGSurface.
Implemented in CSG::CSGNPolygonUnit.
|
overridepure virtual |
Evaluate the surface equation at the given point.
Derived classes must implement this to allow callers to determine whether a point lies in the negative or positive half-space of the engineering unit without requiring prior expansion.
| p | point to evaluate |
Implements CSG::CSGSurface.
Implemented in CSG::CSGNPolygonUnit.
|
overrideprotectedpure virtual |
Create and add the concrete CSGSurface(s) in _internal_base.
Called exclusively by CSGBase. The implementation must:
Implements CSG::CSGEngUnit.
Implemented in CSG::CSGNPolygonUnit.
Referenced by CSG::CSGBase::expandEngUnit().
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protected |
Friends for unit testing.
|
pure virtualinherited |
Get the attributes that define this engineering unit.
Returns a map of domain-specific parameter names to their values, describing the EngUnit in meaningful engineering terms.
Implemented in CSG::CSGNPolygonUnit.
Referenced by CSG::CSGEngUnit::operator==().
|
inlineprotectedinherited |
Get the internal CSGBase owned by this engineering unit.
Definition at line 117 of file CSGEngUnit.h.
|
inlineinherited |
Get the behavior of this engineering unit (surface (i.e.
region), cell, or universe).
Returns "SURFACE", "CELL", or "UNIVERSE" depending on which intermediate EngUnit class the concrete type derives from. Set automatically at construction.
Definition at line 56 of file CSGEngUnit.h.
Referenced by CSG::CSGEngUnit::operator==().
|
overridevirtual |
Always throws – coefficients are not defined for a surface engineering unit.
A surface engineering unit is described by its attributes (see getAttributes()), not by surface-equation coefficients, so this inherited CSGSurface method has no meaningful value on a unit. Expansion does not make it callable either: CSGBase::expandEngUnit() replaces the unit with plain CSGSurface object(s), and getCoeffs() is valid on those resulting surfaces, never on the unit itself.
The override exists only to satisfy the pure-virtual CSGSurface::getCoeffs()
Implements CSG::CSGSurface.
Definition at line 21 of file CSGSurfaceEngUnit.C.
|
protected |
Return the CSGRegion formed by the expanded CSGSurfaces.
Checks that expandUnit() has already been called (via _expanded_region) before returning the stored result. Throws if called before expansion.
Definition at line 30 of file CSGSurfaceEngUnit.C.
|
inherited |
given a point, determine if it is in the positive or negative half-space for the surface
| p | point |
Definition at line 23 of file CSGSurface.C.
|
inlineoverridevirtual |
Satisfy CSGEngUnit::getName() – resolved via CSGSurface::getName()
Implements CSG::CSGEngUnit.
Definition at line 81 of file CSGSurfaceEngUnit.h.
Referenced by CSG::CSGBase::expandEngUnit(), CSG::CSGNPolygonUnit::expandUnit(), getCoeffs(), and getExpandedRegion().
|
inlineinherited |
Get the Surface Type.
Definition at line 53 of file CSGSurface.h.
Referenced by CSG::CSGSurface::operator==().
|
inlineoverridevirtual |
Delegate to CSGSurface (CSGTransformationHelper)
Implements CSG::CSGEngUnit.
Definition at line 92 of file CSGSurfaceEngUnit.h.
|
inlineoverridevirtual |
Delegate to CSGSurface (CSGTransformationHelper)
Implements CSG::CSGEngUnit.
Definition at line 99 of file CSGSurfaceEngUnit.h.
|
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().
|
inlineinherited |
Get the type name of this engineering unit.
Definition at line 63 of file CSGEngUnit.h.
Referenced by CSG::CSGCellEngUnit::getExpandedCell(), CSG::CSGUniverseEngUnit::getExpandedUniverse(), and CSG::CSGEngUnit::operator==().
|
inlineoverridevirtual |
Engineering units report true so comparisons can skip the dynamic_cast fast path.
Reimplemented from CSG::CSGSurface.
Definition at line 84 of file CSGSurfaceEngUnit.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().
|
inline |
Definition at line 88 of file CSGSurfaceEngUnit.h.
|
inherited |
Operator overload for checking if two CSGEngUnit objects are not equal.
Definition at line 50 of file CSGEngUnit.C.
Referenced by CSG::CSGCellEngUnit::operator!=(), CSG::CSGUniverseEngUnit::operator!=(), and operator!=().
|
inherited |
Operator overload for checking if two CSGSurface objects are not equal.
Definition at line 65 of file CSGSurface.C.
|
inherited |
Operator overload for checking if two CSGEngUnit objects are equal.
Definition at line 34 of file CSGEngUnit.C.
Referenced by CSG::CSGCellEngUnit::operator==(), CSG::CSGUniverseEngUnit::operator==(), and operator==().
|
inline |
Disambiguate == and != by forwarding to CSGEngUnit (name/property-based comparison)
Definition at line 87 of file CSGSurfaceEngUnit.h.
|
inherited |
Operator overload for checking if two CSGSurface objects are equal.
Definition at line 45 of file CSGSurface.C.
|
protectedinherited |
Transfer ownership of the internal CSGBase out of this unit.
Called once by CSGBase::expandEngUnit() to join the internal base into the parent. After this call _internal_base is null.
Definition at line 28 of file CSGEngUnit.C.
|
inlineprotectedinherited |
Definition at line 119 of file CSGSurface.h.
|
friend |
Definition at line 133 of file CSGSurfaceEngUnit.h.
|
protectedinherited |
The basic CSG type this unit produces: "SURFACE", "CELL", or "UNIVERSE".
Definition at line 133 of file CSGEngUnit.h.
Referenced by CSG::CSGEngUnit::CSGEngUnit(), and CSG::CSGEngUnit::getBehavior().
|
protected |
Stores the result of expandUnit(); EMPTY until then.
Definition at line 129 of file CSGSurfaceEngUnit.h.
Referenced by CSG::CSGNPolygonUnit::expandUnit(), and getExpandedRegion().
|
protectedinherited |
CSGBase populated by expandUnit(); joined into the parent CSGBase by expandEngUnit()
Definition at line 130 of file CSGEngUnit.h.
Referenced by CSG::CSGNPolygonUnit::expandUnit(), CSG::CSGEngUnit::getBase(), CSG::CSGCellEngUnit::getExpandedCell(), CSG::CSGUniverseEngUnit::getExpandedUniverse(), and CSG::CSGEngUnit::releaseBase().
|
protectedinherited |
Name of surface.
Definition at line 122 of file CSGSurface.h.
Referenced by CSG::CSGXCylinder::clone(), CSG::CSGZCylinder::clone(), CSG::CSGYCylinder::clone(), CSG::CSGSphere::clone(), CSG::CSGPlane::clone(), CSG::CSGNPolygonUnit::clone(), CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGSurface::getName(), and CSG::CSGSurface::setName().
|
protectedinherited |
List of transformations applied to this object.
Definition at line 96 of file CSGTransformationHelper.h.
Referenced by CSG::CSGTransformationHelper::addTransformation(), CSG::CSGTransformationHelper::applyReverseTransformsToPoint(), CSG::CSGTransformationHelper::getTransformations(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
1.8.14