Warning, file /include/orange/orangeinp/CsgObject.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <string>
0011 #include <vector>
0012
0013 #include "ObjectInterface.hh"
0014
0015 namespace celeritas
0016 {
0017 namespace orangeinp
0018 {
0019
0020
0021
0022
0023 class NegatedObject : public ObjectInterface
0024 {
0025 public:
0026
0027 explicit NegatedObject(SPConstObject obj);
0028
0029
0030 NegatedObject(std::string&& label, SPConstObject obj);
0031
0032
0033 SPConstObject const& daughter() const { return obj_; }
0034
0035
0036 std::string_view label() const final { return label_; }
0037
0038
0039 NodeId build(VolumeBuilder&) const final;
0040
0041
0042 void output(JsonPimpl*) const final;
0043
0044 private:
0045 std::string label_;
0046 SPConstObject obj_;
0047 };
0048
0049
0050
0051
0052
0053 template<OperatorToken Op>
0054 class JoinObjects : public ObjectInterface
0055 {
0056 static_assert(Op == op_and || Op == op_or);
0057
0058 public:
0059
0060
0061 using VecObject = std::vector<SPConstObject>;
0062
0063
0064
0065 static constexpr OperatorToken op_token = Op;
0066
0067 public:
0068
0069 static SPConstObject or_object(std::string&& label, VecObject&& objects);
0070
0071
0072 JoinObjects(std::string&& label, VecObject&& objects);
0073
0074
0075 VecObject const& daughters() const { return objects_; }
0076
0077
0078 std::string_view label() const final { return label_; }
0079
0080
0081 NodeId build(VolumeBuilder&) const final;
0082
0083
0084 void output(JsonPimpl*) const final;
0085
0086 private:
0087 std::string label_;
0088 VecObject objects_;
0089 };
0090
0091
0092
0093
0094
0095
0096 using AnyObjects = JoinObjects<op_or>;
0097
0098 using AllObjects = JoinObjects<op_and>;
0099
0100
0101 using SPConstObject = std::shared_ptr<ObjectInterface const>;
0102
0103 using VecSenseObj = std::vector<std::pair<Sense, SPConstObject>>;
0104
0105
0106
0107
0108
0109
0110 std::shared_ptr<AllObjects const>
0111 make_subtraction(std::string&& label,
0112 SPConstObject const& minuend,
0113 SPConstObject const& subtrahend);
0114
0115
0116 std::shared_ptr<AllObjects const>
0117 make_rdv(std::string&& label, VecSenseObj&& rdv);
0118
0119
0120 }
0121 }