forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProtoInterface.hh
71 lines (61 loc) · 2.23 KB
/
ProtoInterface.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//----------------------------------*-C++-*----------------------------------//
// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file orange/orangeinp/ProtoInterface.hh
//---------------------------------------------------------------------------//
#pragma once
#include <memory>
#include <vector>
#include "orange/OrangeInput.hh"
namespace celeritas
{
namespace orangeinp
{
class ObjectInterface;
class GlobalBuilder;
//---------------------------------------------------------------------------//
/*!
* Construct a universe for building ORANGE geometry.
*
* Each Proto (for proto-universe) will result in a unique UniverseId and can
* be placed into multiple other universes. Each universe has:
* - a label for descriptive output,
* - an "interior" CSG object that describes its boundary, so that it can be
* placed in other universes, and
* - a list of daughter Protos that are placed inside the current one.
*
* The graph of Proto daughters must be acyclic.
*
* \todo GLOBAL BUILDER IS NOT YET IMPLEMENTED.
*/
class ProtoInterface
{
public:
//!@{
//! \name Type aliases
using SPConstObject = std::shared_ptr<ObjectInterface const>;
using SPConstProto = std::shared_ptr<ProtoInterface const>;
using VecProto = std::vector<ProtoInterface const*>;
//!@}
public:
//! Short unique name of this object
virtual std::string_view label() const = 0;
//! Get the boundary of this universe as an object
virtual SPConstObject interior() const = 0;
//! Get a non-owning set of all daughters referenced by this proto
virtual VecProto daughters() const = 0;
//! Construct a universe input from this object
virtual void build(GlobalBuilder&) const = 0;
protected:
//!@{
//! Allow construction and assignment only through daughter classes
ProtoInterface() = default;
virtual ~ProtoInterface() = default;
CELER_DEFAULT_COPY_MOVE(ProtoInterface);
//!@}
};
//---------------------------------------------------------------------------//
} // namespace orangeinp
} // namespace celeritas