https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
19namespace CSG
20{
21
22class CSGBase; // forward declaration
23
39{
40public:
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>>>
64
65protected:
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
CSGBase creates an internal representation of a Constructive Solid Geometry (CSG) model.
Definition CSGBase.h:54
CSGCell creates an internal representation of a Constructive Solid Geometry (CSG) cell,...
Definition CSGCell.h:30
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
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.
CSGUniverseEngUnit is an abstract base class for "engineering units" that are universe-like.
bool isEngUnit() const override
Engineering units report true so comparisons can skip the dynamic_cast fast path.
void expandUnit() override=0
Populate _internal_base with the CSGUniverse and any supporting objects.
std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > getTransformationsAsStrings() const override
Delegate to CSGUniverse (CSGTransformationHelper)
bool operator==(const CSGUniverseEngUnit &other) const
Disambiguate == and != by forwarding to CSGEngUnit (name/property-based comparison)
virtual std::unique_ptr< CSGUniverseEngUnit > clone() const =0
Create a deep copy of this engineering unit for use in a different CSGBase instance.
void addCell(const CSGCell &)=delete
addCell updates are not permitted on engineering units.
const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & getTransformations() const override
Delegate to CSGUniverse (CSGTransformationHelper)
const CSGUniverse & getExpandedUniverse() const
Return the root universe of _internal_base, which IS the expanded universe.
bool operator!=(const CSGUniverseEngUnit &other) const
const std::string & getName() const override
Satisfy CSGEngUnit::getName() (resolved via CSGUniverse::getName())
CSGUniverse creates an internal representation of a Constructive Solid Geometry (CSG) universe,...
Definition CSGUniverse.h:28
const std::string & getName() const
Get the name of the universe.
Definition CSGUniverse.h:80