8#ifndef VOLUMEBUILDERSTYPES_HH
9#define VOLUMEBUILDERSTYPES_HH
10#include <G4ThreeVector.hh>
18#define ONCE_MUTABLE mutable
102 template <
typename U>
105 template <
typename U>
129 x(vec.getX()),
y(vec.getY()),
z(vec.getZ()),
units(u) {
132 [[nodiscard]] G4ThreeVector
apply_units(
const double dflt_unit)
const {
133 auto vec = G4ThreeVector(0, 0, 0);
134 auto unit = this->units.value_or(dflt_unit);
135 vec.setX(this->x * unit);
136 vec.setY(this->y * unit);
137 vec.setZ(this->z * unit);
142 template <
typename T>
145 auto sp_const = obj->shared_from_this();
148 return std::const_pointer_cast<std::remove_const_t<T>>(sp_const);
166 using _internals_::Unit3Vec;
171 using ::DLG4::VolumeBuilders::_internals_::RZBuilder;
172 using ::DLG4::VolumeBuilders::_internals_::VolumeBuilder;
173 using ::DLG4::VolumeBuilders::_internals_::BoxBuilder;
174 using ::DLG4::VolumeBuilders::_internals_::FromG4VSolid;
175 using ::DLG4::VolumeBuilders::_internals_::Assembly;
176 using ::DLG4::VolumeBuilders::_internals_::StructureBuilder;
177 using ::DLG4::VolumeBuilders::_internals_::VolumeBuilderReference;
178 using ::DLG4::VolumeBuilders::_internals_::StructureBuilderReference;
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
Builder class for simple Box solids.
A solid buider class that just wrap an existing G4VSolid.
a non-fluent polymorphic class to access the derived solid-builder from a base reference: This gets u...
Builder class for RZ mult-plane defined solids.
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
A 3D vector that carries its own unit information.
Unit3Vec(double u, const Unitless3Vec &vec)
Unit3Vec(double x, double y, double z)
std::optional< double > units
G4ThreeVector apply_units(const double dflt_unit) const
Unit3Vec(double u, double x, double y, double z)
A polymorphic, type-erased builder referencing any specialized builder.
VolumeBuilder: Common functionality for volume builder classes.
SharedPtr< BoxBuilder > BoxBuilderPtr
SharedPtr< FromG4VSolid > FromG4VSolidPtr
std::shared_ptr< T > shared_mutable_this(const std::enable_shared_from_this< T > *obj)
SharedPtr< VolumeBuilderReference > BuilderView
Common interface for all volume builder types.
G4ThreeVector Unitless3Vec
std::vector< StructureView > StructureViewList
a user type to hold many structures
G4Transform3D UnitlessG4Transform3D
SharedPtr< U > VolumeBuilderPtr
SharedPtr< Assembly > AssemblyPtr
SharedPtr< RZBuilder > RZBuilderPtr
std::vector< BuilderView > BuilderViewList
a user type to hold many builders
SharedPtr< StructureBuilderReference > StructureView
Common interface for all structure types.