DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
VolumeBuildersTypes.hh
Go to the documentation of this file.
1#pragma once
2//
3// Created by Douglas S. Leonard on 6/18/25. All rights Reserved
4// See related files for license, if any is provided.
5//
6// Types for VolumeBuilder classes
7
8#ifndef VOLUMEBUILDERSTYPES_HH
9#define VOLUMEBUILDERSTYPES_HH
10#include <G4ThreeVector.hh>
11#include <memory>
12#include <optional>
13#include <vector>
14
16#include "i_shared_ptr.hh"
17//#include "VolumeBuilderConfigs.hh"
18
19#define ONCE_MUTABLE mutable // for linkable objects
20
22 class G4MaterialPtrOrString;
23}
24
26
28 // a shorthand out to the public namespace:
29 namespace VB = DLG4::VolumeBuilders;
30
31 // Base template alias
32 template<typename T>
34 class ISolidBuilder;
36 class IVolumeBuilder;
37 template<typename T>
40 class RZBuilderCore;
41 class BoxBuilderCore;
42 class FromG4VSolidCore;
43 template<typename T>
46 class AssemblyCore;
47
53
59
60
78
81
84
87
94
101 using BuilderViewList = std::vector<VolumeBuilder>;
102
109 using StructureViewList = std::vector<StructureBuilder>;
110
111 // For the template base class
112 template<typename U>
114
115 template<typename U>
117
118
119 template<typename T>
120 std::shared_ptr<T> shared_mutable_this(const std::enable_shared_from_this<T> *obj) {
121 // Call shared_from_this() (returns shared_ptr<const T> if obj is const)
122 auto sp_const = obj->shared_from_this();
123
124 // Cast away constness safely
125 return std::const_pointer_cast<std::remove_const_t<T> >(sp_const);
126 }
127}
128
129
130//Export names for API usage/tab-completion.
132namespace DLG4::VolumeBuilders {
142 template<typename T>
152
153
154}
155
172#endif //VOLUMEBUILDERSTYPES_HH
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.".
VolumeBuilder: Common functionality for volume builder classes.
A polymorphic, type-erased "view" of any specialized builder.
std::shared_ptr< T > shared_mutable_this(const std::enable_shared_from_this< T > *obj)
SharedPtr< VolumeBuilderCore > VolumeBuilder
SharedPtr< AssemblyCore > Assembly
Pointer to Assembly type to hold Structures, ie other assemblies or buidlers.
SharedPtr< BoxBuilderCore > BoxBuilder
Shared pointer to _internals_::BoxBuilderCore.
SharedPtr< RZBuilderCore > RZBuilder
Shared pointer to _internals_::RZBuilderCore.
SharedPtr< StructureBuilderCore > StructureBuilder
std::vector< VolumeBuilder > BuilderViewList
a user type to hold many builders
std::vector< StructureBuilder > StructureViewList
a user type to hold many structures
SharedPtr< FromG4VSolidCore > FromG4VSolid
Shared pointer to _internals_::FromG4VSolidCore.
_internals_::StructureViewList StructureViewList
a user type to hold many structures
_internals_::BuilderViewList BuilderViewList
a user type to hold many builders