DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
ISolidBuilder.hh
Go to the documentation of this file.
1#pragma once
19#ifndef ISOLIDBUIDLER_HH
20#define ISOLIDBUIDLER_HH
21
22#include <G4LogicalVolume.hh>
23#include <G4Transform3D.hh>
24#include <G4VSolid.hh>
25
26#include "Linkable.hh"
27#include "VolumeBuilderTypes.hh"
28
29
30namespace DLG4::VolumeBuilders {
33
37 protected:
38 friend class VolumeBuilderReference; // for tye erasing polymorphism
39 friend class StructureBuilderReference; // for tye erasing polymorphism
40 template <typename T>
41 friend class StructureBuilder;
42 friend class Assembly;
43 virtual G4VSolid *SolidConstructor(const G4String &name) = 0;
44 virtual ~IStructureBuilder() = default;
45 // clones and returns a base class pointer
46 [[nodiscard]] virtual SharedPtr<IStructureBuilder> clone_impl() const = 0;
47 // Returns a type-erased view ptr.
48 [[nodiscard]] virtual StructureView ToStructureView() const = 0;
49 [[nodiscard]] virtual BuilderView ToBuilderView() const = 0;
50 // store type erased views of underlying objects...
51 // combined with above we can get a view from an object and store the view
52 // in the tye-erased object being copied or constructed.
53 };
54
55 //Just a tag class to mark IStructureBuilders that are also ISolidBuilders
56 class ISolidBuilder: public IStructureBuilder {
57 };
58}
59
60
61//
62
63
64#endif //ISOLIDBUIDLER_HH
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
Definition Assembly.hh:46
a non-fluent polymorphic class to access the derived solid-builder from a base reference: This gets u...
virtual G4VSolid * SolidConstructor(const G4String &name)=0
virtual BuilderView ToBuilderView() const =0
virtual StructureView ToStructureView() const =0
virtual SharedPtr< IStructureBuilder > clone_impl() const =0
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 polymorphic, type-erased builder referencing any specialized builder.
A wrapper for std::shared_ptr that allows and facilitates many implicit(i) type conversions.