DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
FromG4VSolid.hh
Go to the documentation of this file.
1#pragma once
2#ifndef FromG4VSolid_HPP
3#define FromG4VSolid_HPP
7// Created by @author Douglas S. Leonard on @date 6/8/25. All rights Reserved.
8// See related files for license, if any is provided.
9//
10// @ brief A stubbed VolumeBuilder Factory to create a builder from Any geant Solid.
11// Only the out-of-class static Factory CreateFromG4VSolid() is exposed.
12// Use it to configure logical volume and placement with VolumeBuilder from a standard G4VSolid.
14#include "VolumeBuilderTypes.hh"
15#include "VolumeBuilder.hh"
16
17namespace DLG4::VolumeBuilders {
18 class FromG4VSolid;
19
26 FromG4VSolidPtr CreateFromG4VSolid(G4VSolid *solid);
27
28#include <stdexcept>
35 class FromG4VSolid final: public VolumeBuilder<FromG4VSolid> {
36 friend class VolumeBuilder<FromG4VSolid>;
39
40 public:
41 // No functional public methods. Only the Factory!
42 // Just boilerplate below here:
43 // FromG4VSolid(const FromG4VSolid &other) = delete;
44
45 FromG4VSolid(const FromG4VSolid &other);
46 FromG4VSolid &operator=(const FromG4VSolid &other) = delete;
47
48 private:
49 //Implement pure vitual SolidConstructor from ISolidBuilder
50 G4VSolid *SolidConstructor(const G4String &name) override {
51 throw std::runtime_error(
52 "FromG4VSolid::SolidConstructor(const G4String &name) not implemented.\n"
53 "FromG4VSolid is constructed using prebuilt a G4VSolid pointer.");
54 }
55
56 // Does this need to exist? Maybe.
57 FromG4VSolid() {
58 }
59 };
60}
61#endif //FromG4VSolid_HPP
A solid buider class that just wrap an existing G4VSolid.
friend FromG4VSolidPtr CreateFromG4VSolidBuider(G4VSolid *solid)
FromG4VSolid & operator=(const FromG4VSolid &other)=delete
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.
FromG4VSolidPtr CreateFromG4VSolid(G4VSolid *solid)
Constructor to make a builder from an Existing Geant solid.
SharedPtr< FromG4VSolid > FromG4VSolidPtr