https://mooseframework.inl.gov
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 
19 namespace CSG
20 {
21 
22 class CSGBase; // forward declaration
23 
38 class CSGCellEngUnit : public CSGCell, public CSGEngUnit
39 {
40 public:
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>>>
59  getTransformationsAsStrings() const override
60  {
62  }
63 
64 protected:
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
CSGCellEngUnit is an abstract base class for "engineering units" that are cell-like.
bool operator==(const CSGEngUnit &other) const
Operator overload for checking if two CSGEngUnit objects are equal.
Definition: CSGEngUnit.C:34
const std::string & getName() const
Get the cell name.
Definition: CSGCell.h:112
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGCell::getName())
CSGRegions creates an internal representation of a CSG region, which can refer to an intersection...
Definition: CSGRegion.h:22
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
Definition: CSGUniverse.h:27
bool isEngUnit() const override
Engineering units report true so comparisons can skip the dynamic_cast fast path. ...
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations() const override
Delegate to CSGCell (CSGTransformationHelper)
CSGLattice is the abstract class for defining lattices.
Definition: CSGLattice.h:34
bool operator==(const CSGCellEngUnit &other) const
Disambiguate == and != by forwarding to CSGEngUnit (name/property-based comparison) ...
bool operator!=(const CSGEngUnit &other) const
Operator overload for checking if two CSGEngUnit objects are not equal.
Definition: CSGEngUnit.C:50
void resetCellFill()=delete
Cell fill and region updates are not permitted on engineering units.
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
Definition: CSGCell.h:29
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings() const override
Delegate to CSGCell (CSGTransformationHelper)
void updateCellFill(const std::string &)=delete
bool operator!=(const CSGCellEngUnit &other) const
void updateRegion(const CSGRegion &)=delete
void expandUnit() override=0
Create the CSGCell and any other necessary components in _internal_base.
virtual std::unique_ptr< CSGCellEngUnit > clone() const =0
Create a deep copy of this engineering unit for use in a different CSGBase instance.
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings() const
Get the transformations of this object with string representations for types.
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model...
Definition: CSGBase.h:53
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations() const
Get the list of transformations.
CSGEngUnit is the abstract base class for all "engineering unit" types in the CSG system...
Definition: CSGEngUnit.h:32
const CSGCell & getExpandedCell() const
Return the single cell in _internal_base&#39;s root, which IS the expanded cell.
CSGCellEngUnit(const std::string &name)
Constructor for derived classes.