https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CSGCellEngUnit.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#ifdef MOOSE_UNIT_TEST
13#include "gtest/gtest.h"
14#endif
15
16#include "CSGCell.h"
17#include "CSGEngUnit.h"
18
19namespace CSG
20{
21
22class CSGBase; // forward declaration
23
38class CSGCellEngUnit : public CSGCell, public CSGEngUnit
39{
40public:
42 const std::string & getName() const override { return CSGCell::getName(); }
43
45 bool isEngUnit() const override { return true; }
46
48 bool operator==(const CSGCellEngUnit & other) const { return CSGEngUnit::operator==(other); }
49 bool operator!=(const CSGCellEngUnit & other) const { return CSGEngUnit::operator!=(other); }
51 const std::vector<std::pair<TransformationType, std::tuple<Real, Real, Real>>> &
52 getTransformations() const override
53 {
55 }
56
58 std::vector<std::pair<std::string, std::tuple<Real, Real, Real>>>
63
64protected:
72 CSGCellEngUnit(const std::string & name);
73
77 void resetCellFill() = delete;
78 void updateCellFill(const std::string &) = delete;
79 void updateCellFill(const CSGUniverse *) = delete;
80 void updateCellFill(const CSGLattice *) = delete;
81 void updateRegion(const CSGRegion &) = delete;
83
92 virtual std::unique_ptr<CSGCellEngUnit> clone() const = 0;
93
103 void expandUnit() override = 0;
104
114 const CSGCell & getExpandedCell() const;
115
116 // Only CSGBase should be calling expandUnit() and getExpandedCell()
117 friend class CSGBase;
118};
119
120} // namespace CSG
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model.
Definition CSGBase.h:54
CSGCellEngUnit is an abstract base class for "engineering units" that are cell-like.
bool operator==(const CSGCellEngUnit &other) const
Disambiguate == and != by forwarding to CSGEngUnit (name/property-based comparison)
void updateCellFill(const CSGLattice *)=delete
void updateRegion(const CSGRegion &)=delete
void expandUnit() override=0
Create the CSGCell and any other necessary components in _internal_base.
bool operator!=(const CSGCellEngUnit &other) const
void resetCellFill()=delete
Cell fill and region updates are not permitted on engineering units.
bool isEngUnit() const override
Engineering units report true so comparisons can skip the dynamic_cast fast path.
virtual std::unique_ptr< CSGCellEngUnit > clone() const =0
Create a deep copy of this engineering unit for use in a different CSGBase instance.
void updateCellFill(const CSGUniverse *)=delete
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations() const override
Delegate to CSGCell (CSGTransformationHelper)
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings() const override
Delegate to CSGCell (CSGTransformationHelper)
const CSGCell & getExpandedCell() const
Return the single cell in _internal_base's root, which IS the expanded cell.
void updateCellFill(const std::string &)=delete
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGCell::getName())
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell,...
Definition CSGCell.h:30
const std::string & getName() const
Get the cell name.
Definition CSGCell.h:112
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system.
Definition CSGEngUnit.h:33
bool operator!=(const CSGEngUnit &other) const
Operator overload for checking if two CSGEngUnit objects are not equal.
Definition CSGEngUnit.C:50
bool operator==(const CSGEngUnit &other) const
Operator overload for checking if two CSGEngUnit objects are equal.
Definition CSGEngUnit.C:34
CSGLattice is the abstract class for defining lattices.
Definition CSGLattice.h:35
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection,...
Definition CSGRegion.h:23
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations() const
Get the list of transformations.
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings() const
Get the transformations of this object with string representations for types.
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe,...
Definition CSGUniverse.h:28