![]() |
|
|||
File indexing completed on 2025-09-18 09:24:50
0001 //------------------------------- -*- C++ -*- -------------------------------// 0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details 0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT) 0004 //---------------------------------------------------------------------------// 0005 //! \file orange/orangeinp/ProtoInterface.hh 0006 //---------------------------------------------------------------------------// 0007 #pragma once 0008 0009 #include <memory> 0010 #include <vector> 0011 0012 #include "orange/OrangeInput.hh" 0013 0014 namespace celeritas 0015 { 0016 //---------------------------------------------------------------------------// 0017 struct JsonPimpl; 0018 struct OrangeInput; 0019 0020 namespace orangeinp 0021 { 0022 class ObjectInterface; 0023 0024 namespace detail 0025 { 0026 class ProtoBuilder; 0027 } // namespace detail 0028 0029 //---------------------------------------------------------------------------// 0030 /*! 0031 * Construct a universe as part of an ORANGE geometry. 0032 * 0033 * Each Proto (for proto-universe) will result in a unique UniverseId and can 0034 * be placed into multiple other universes. Each universe has: 0035 * - a label for descriptive output, 0036 * - an "interior" CSG object that describes its boundary, so that it can be 0037 * placed in other universes, and 0038 * - a list of daughter Protos that are placed inside the current one. 0039 * 0040 * The graph of Proto daughters must be acyclic. 0041 */ 0042 class ProtoInterface 0043 { 0044 public: 0045 //!@{ 0046 //! \name Type aliases 0047 using SPConstObject = std::shared_ptr<ObjectInterface const>; 0048 using SPConstProto = std::shared_ptr<ProtoInterface const>; 0049 using VecProto = std::vector<ProtoInterface const*>; 0050 using ProtoBuilder = detail::ProtoBuilder; 0051 //!@} 0052 0053 public: 0054 //! Short unique name of this object 0055 virtual std::string_view label() const = 0; 0056 0057 //! Get the boundary of this universe as an object 0058 virtual SPConstObject interior() const = 0; 0059 0060 //! Get a non-owning set of all daughters referenced by this proto 0061 virtual VecProto daughters() const = 0; 0062 0063 //! Construct a universe input from this object 0064 virtual void build(ProtoBuilder&) const = 0; 0065 0066 //! Write the proto to a JSON object 0067 virtual void output(JsonPimpl*) const = 0; 0068 0069 protected: 0070 //!@{ 0071 //! Allow construction and assignment only through subclasses 0072 ProtoInterface() = default; 0073 ~ProtoInterface() = default; 0074 CELER_DEFAULT_COPY_MOVE(ProtoInterface); 0075 //!@} 0076 }; 0077 0078 //---------------------------------------------------------------------------// 0079 // Get a JSON string representing a proto 0080 std::string to_string(ProtoInterface const&); 0081 0082 //---------------------------------------------------------------------------// 0083 } // namespace orangeinp 0084 } // namespace celeritas
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |