https://mooseframework.inl.gov
CSGUniverseEngUnit.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 "CSGUniverse.h"
17 #include "CSGEngUnit.h"
18 
19 namespace CSG
20 {
21 
22 class CSGBase; // forward declaration
23 
39 {
40 public:
42  const std::string & getName() const override { return CSGUniverse::getName(); }
43 
45  bool isEngUnit() const override { return true; }
46 
48  bool operator==(const CSGUniverseEngUnit & other) const { return CSGEngUnit::operator==(other); }
49  bool operator!=(const CSGUniverseEngUnit & other) const { return CSGEngUnit::operator!=(other); }
50 
52  const std::vector<std::pair<TransformationType, std::tuple<Real, Real, Real>>> &
53  getTransformations() const override
54  {
56  }
57 
59  std::vector<std::pair<std::string, std::tuple<Real, Real, Real>>>
60  getTransformationsAsStrings() const override
61  {
63  }
64 
65 protected:
72  CSGUniverseEngUnit(const std::string & name, bool is_root = false);
73 
77  void addCell(const CSGCell &) = delete;
79 
88  virtual std::unique_ptr<CSGUniverseEngUnit> clone() const = 0;
89 
100  void expandUnit() override = 0;
101 
110  const CSGUniverse & getExpandedUniverse() const;
111 
112  // Only CSGBase should be calling expandUnit() and getExpandedUniverse()
113  friend class CSGBase;
114 };
115 
116 } // namespace CSG
bool operator==(const CSGEngUnit &other) const
Operator overload for checking if two CSGEngUnit objects are equal.
Definition: CSGEngUnit.C:34
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings() const override
Delegate to CSGUniverse (CSGTransformationHelper)
void expandUnit() override=0
Populate _internal_base with the CSGUniverse and any supporting objects.
bool isEngUnit() const override
Engineering units report true so comparisons can skip the dynamic_cast fast path. ...
void addCell(const CSGCell &)=delete
addCell updates are not permitted on engineering units.
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe...
Definition: CSGUniverse.h:27
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGUniverse::getName())
const CSGUniverse & getExpandedUniverse() const
Return the root universe of _internal_base, which IS the expanded universe.
const std::string & getName() const
Get the name of the universe.
Definition: CSGUniverse.h:80
virtual std::unique_ptr< CSGUniverseEngUnit > clone() const =0
Create a deep copy of this engineering unit for use in a different CSGBase instance.
CSGUniverseEngUnit(const std::string &name, bool is_root=false)
Constructor for derived classes.
bool operator!=(const CSGUniverseEngUnit &other) const
bool operator!=(const CSGEngUnit &other) const
Operator overload for checking if two CSGEngUnit objects are not equal.
Definition: CSGEngUnit.C:50
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell...
Definition: CSGCell.h:29
CSGUniverseEngUnit is an abstract base class for "engineering units" that are universe-like.
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations() const override
Delegate to CSGUniverse (CSGTransformationHelper)
bool operator==(const CSGUniverseEngUnit &other) const
Disambiguate == and != by forwarding to CSGEngUnit (name/property-based comparison) ...
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