8#ifndef VOLUMEBUILDERTYPES_HH
9#define VOLUMEBUILDERTYPES_HH
10#include <G4ThreeVector.hh>
18#define ONCE_MUTABLE mutable
101 template <
typename U>
125 x(vec.getX()),
y(vec.getY()),
z(vec.getZ()),
units(u) {
128 [[nodiscard]] G4ThreeVector
apply_units(
const double dflt_unit)
const {
129 auto vec = G4ThreeVector(0, 0, 0);
130 auto unit = this->units.value_or(dflt_unit);
131 vec.setX(this->x * unit);
132 vec.setY(this->y * unit);
133 vec.setZ(this->z * unit);
138 template <
typename T>
141 auto sp_const = obj->shared_from_this();
144 return std::const_pointer_cast<std::remove_const_t<T>>(sp_const);
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.
A wrapper for std::shared_ptr that allows and facilitates many implicit(i) type conversions.
std::shared_ptr< T > shared_mutable_this(const std::enable_shared_from_this< T > *obj)
G4ThreeVector Unitless3Vec
std::vector< StructureView > StructureViewList
a user type to hold many structures
G4Transform3D UnitlessG4Transform3D
std::vector< BuilderView > BuilderViewList
a user type to hold many builders