74 const std::string & region_type);
131 std::vector<std::reference_wrapper<const CSGSurface>>
getSurfaces()
const;
140 std::map<std::string, std::reference_wrapper<const CSGSurface>> & identical_surface_refs);
172 const std::size_t postfix_token_index)
const;
static char halfspaceSymbol(const CSGSurface::Halfspace halfspace)
std::vector< std::string > toPostfixStringList() const
gets the list of postfix tokens of the region in string representation
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection...
CSGRegion()
Default Constructor.
std::variant< std::reference_wrapper< const CSGSurface >, RegionType, CSGSurface::Halfspace > PostfixTokenVariant
Type definition for a variant that represents the datatypes for entries within the list that represen...
static char regionSymbol(const RegionType region_type)
Halfspace
Enum for the sign of the half-space being represented by a point and surface.
const CSGRegion operator|(const CSGRegion ®ion_a, const CSGRegion ®ion_b)
Overload for creating a region from the union (|) of two regions.
virtual ~CSGRegion()=default
Destructor.
T getEnum() const
get the current value cast to the enum type T
bool operator!=(const CSGRegion &other) const
Operator overload for checking if two CSGRegion objects are not equal.
std::vector< PostfixTokenVariant > _postfix_tokens
List of tokens representing the region in postfix notation.
std::vector< std::reference_wrapper< const CSGSurface > > getSurfaces() const
Get the list of surfaces associated with the region.
bool nextRegionOpIsIdentical(const RegionType region, const std::size_t postfix_token_index) const
Iterate through postfix tokens and check if next region operator matches the given operator...
const CSGRegion operator+(const CSGSurface &surf)
Operation overloads for operation based region construction.
const std::vector< PostfixTokenVariant > & getPostfixTokens() const
Get the list of postfix tokens associated with the region.
CSGRegion & operator|=(const CSGRegion &other_region)
Operator overload for |= which creates a union of the current region with the other_region.
bool operator==(const CSGRegion &other) const
Operator overload for checking if two CSGRegion objects are equal.
const CSGRegion operator &(const CSGRegion ®ion_a, const CSGRegion ®ion_b)
Overload for creating a region from the the intersection (&) of two regions.
void updateSurfaceReferences(std::map< std::string, std::reference_wrapper< const CSGSurface >> &identical_surface_refs)
Update surface references of region based on map of input surface references.
RegionType getRegionType() const
Get the region type.
CSGRegion & operator &=(const CSGRegion &other_region)
Operator overload for &= which creates an intersection between the current region and the other_regio...
MooseEnum _region_type
An enum for type of type of operation that defines region.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
RegionType
Enum for representing region types, defined to match _region_type MooseEnum.
std::string postfixTokenToString(const PostfixTokenVariant &token) const
converts postfix token from PostfixTokenVariant to string representation
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface...
const CSGRegion operator~(const CSGRegion ®ion)
Overload for creating a region from the complement (~) of another region.
nlohmann::json toInfixJSON() const
gets the infix JSON representation of the region, which involves converting region representation fro...
bool checkRegionEquality(const std::vector< PostfixTokenVariant > &other_tokens) const
Loop through postfix tokens and check equality with another list of postfix tokens.
const std::string getRegionTypeString() const
Get the region type as a string.
const CSGRegion operator-(const CSGSurface &surf)
Overload for creating a region from the negative half-space (-) of a surface.