DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
DLG4::VolumeBuilders Namespace Reference

Classes

class  Assembly
 
struct  BooleanConfigs
 
struct  BooleanSolid
 
class  BoxBuilder
 
struct  BuilderConfigs
 
class  FromG4VSolid
 
class  ISolidBuilder
 
class  IStructureBuilder
 
class  IVolumeBuilder
 
struct  PlacementConfigs
 
class  PlacementNameRegistry
 
class  RZBuilder
 
struct  RZPlane
 
struct  RZPlaneUnitless
 
class  StructureBuilder
 
class  StructureBuilderReference
 
class  Unit3Vec
 
class  VolumeBuilder
 
class  VolumeBuilderReference
 
struct  VolumeConfigs
 
struct  VolumeConfigsValueTypes
 

Typedefs

using BoxBuilderPtr = SharedPtr< BoxBuilder >
 
using RZBuilderPtr = SharedPtr< RZBuilder >
 
using UnitlessG4Transform3D = G4Transform3D
 
template<typename T >
using SharedPtr = i_shared_ptr< T >
 
using ISolidPtr = SharedPtr< ISolidBuilder >
 
using IStructurePtr = SharedPtr< IStructureBuilder >
 
using BuilderView = SharedPtr< VolumeBuilderReference >
 
using StructureView = SharedPtr< StructureBuilderReference >
 
using FromG4VSolidPtr = SharedPtr< FromG4VSolid >
 
using AssemblyPtr = SharedPtr< Assembly >
 
using BuilderViewList = std::vector< BuilderView >
 
using StructureViewList = std::vector< StructureView >
 
template<typename U >
using VolumeBuilderPtr = SharedPtr< U >
 
template<typename U >
using ENABLE_SHARED_WRAPPER = Utilities::disableable_shared_from_this< U >
 
using Unitless3Vec = G4ThreeVector
 

Functions

AssemblyPtr CreateAssembly (G4String name)
 
BoxBuilderPtr CreateBoxBuilder (const G4String &name)
 
BoxBuilderPtr CreateBoxBuilder (const G4String &name, G4double unit)
 
BoxBuilderPtr CreateCenteredBoxBuilder (const G4String &name, G4double x_full_size, G4double y_full_size, G4double z_full_size)
 
BoxBuilderPtr CreateCenteredBoxBuilder (G4double unit, const G4String &name, G4double x_full_size, G4double y_full_size, G4double z_full_size)
 
BoxBuilderPtr CreateZDeltaBoxBuilder (const G4String &name, G4double x_full_size, G4double y_full_size, G4double edge_z, G4double z_delta)
 
BoxBuilderPtr CreateZDeltaBoxBuilder (G4double unit, const G4String &name, G4double x_full_size, G4double y_full_size, G4double edge_z, G4double z_delta)
 
BoxBuilderPtr CreateDeltasBoxBuilder (const G4String &name, G4double edge_x, G4double x_delta, G4double edge_y, G4double y_delta, G4double edge_z, G4double z_delta)
 
BoxBuilderPtr CreateDeltasBoxBuilder (G4double unit, const G4String &name, G4double edge_x, G4double x_delta, G4double edge_y, G4double y_delta, G4double edge_z, G4double z_delta)
 
BoxBuilderPtr CreateEdgesBoxBuilder (const G4String &name, G4double x_edge1, G4double x_edge2, G4double y_edge1, G4double y_edge2, G4double z_edge1, G4double z_edge2)
 
BoxBuilderPtr CreateEdgesBoxBuilder (G4double unit, const G4String &name, G4double x_edge1, G4double x_edge2, G4double y_edge1, G4double y_edge2, G4double z_edge1, G4double z_edge2)
 
FromG4VSolidPtr CreateFromG4VSolid (G4VSolid *solid)
 
RZBuilderPtr CreatePolyhedraBuilder (const G4String &name, int sides, G4double phi_start=0., G4double phi_tot=360)
 
RZBuilderPtr CreatePolyconeBuilder (const G4String &name, G4double phi_start=0., G4double phi_tot=360)
 
RZBuilderPtr CreateCylinderBuilder (G4double unit, const G4String &name, G4double endz, G4double height, G4double OR, G4double IR=0)
 
RZBuilderPtr CreateCylinderBuilder (const G4String &name, G4double endz, G4double height, G4double OR, G4double IR=0)
 
void SetGlobalDefaultUnit (G4double unit)
 
template<typename T >
std::shared_ptr< T > shared_mutable_this (const std::enable_shared_from_this< T > *obj)
 

Detailed Description

Class by D.

S. Leonard to define (offset) box solids Internally just a normal solid, but offset is carried around and added to the transform stack. Inherits ability to configure and make the logical volume too. ... and to add/subtract volumes.

S. Leonard to help define z-r planes to build poly-objects Applies units from GeantPlane automatically. Inherits ability to configure and make the logical volume too. ... and to add/subtract volumes.

Typedef Documentation

◆ AssemblyPtr

   @typedef AssemblyPtr
   @brief Assembly type to hold Structures, ie other assemblies or buidlers.

/

See also
StructureView for the common interface.

Definition at line 79 of file VolumeBuilderTypes.hh.

◆ BoxBuilderPtr

See also
BuilderView for the common interface.

Definition at line 28 of file BoxBuilder.hh.

◆ BuilderView

Common interface for all volume builder types.

All specific builder pointer types (RZBuilderPtr, FromG4VSolidPtr, etc.) are implicitly convertible to this type and provide polymorphic access to volume operations.

Definition at line 57 of file VolumeBuilderTypes.hh.

◆ BuilderViewList

using BuilderViewList = std::vector<BuilderView>

a user type to hold many builders

You can add to them directly with ->EmplaceBackInto(yourlist) But you should be able to add builders to a vector of, for example, 4LogicalVolume * as well since type converting operators are defined.!!!

Definition at line 87 of file VolumeBuilderTypes.hh.

◆ ENABLE_SHARED_WRAPPER

Definition at line 102 of file VolumeBuilderTypes.hh.

◆ FromG4VSolidPtr

See also
BuilderView for the common interface.

Definition at line 69 of file VolumeBuilderTypes.hh.

◆ ISolidPtr

using ISolidPtr = SharedPtr<ISolidBuilder>

True polymorphic class base view for all builders Mostly for internal use.

Definition at line 42 of file VolumeBuilderTypes.hh.

◆ IStructurePtr

True polymorphic class base view for all structures Mostly for internal use.

Definition at line 48 of file VolumeBuilderTypes.hh.

◆ RZBuilderPtr

See also
BuilderView for the common interface.

Definition at line 68 of file RZBuilder.hh.

◆ SharedPtr

template<typename T >
using SharedPtr = i_shared_ptr<T>

Definition at line 23 of file VolumeBuilderTypes.hh.

◆ StructureView

Common interface for all structure types.


Includes builders and assemblies, and methods for LogicalVolume rendering and placement.

Definition at line 63 of file VolumeBuilderTypes.hh.

◆ StructureViewList

using StructureViewList = std::vector<StructureView>

a user type to hold many structures

You can add to them directly with ->EmplaceBackInto(yourlist) But you should be able to add builders to a vector of, for example, 4LogicalVolume * as well since type converting operators are defined.!!!

Definition at line 95 of file VolumeBuilderTypes.hh.

◆ Unitless3Vec

using Unitless3Vec = G4ThreeVector

Definition at line 105 of file VolumeBuilderTypes.hh.

◆ UnitlessG4Transform3D

typedef G4Transform3D UnitlessG4Transform3D

Definition at line 28 of file VolumeBuilderConfigs.hh.

◆ VolumeBuilderPtr

template<typename U >
using VolumeBuilderPtr = SharedPtr<U>

Definition at line 99 of file VolumeBuilderTypes.hh.

Function Documentation

◆ shared_mutable_this()

template<typename T >
std::shared_ptr< T > shared_mutable_this ( const std::enable_shared_from_this< T > *  obj)

Definition at line 139 of file VolumeBuilderTypes.hh.

139 {
140 // Call shared_from_this() (returns shared_ptr<const T> if obj is const)
141 auto sp_const = obj->shared_from_this();
142
143 // Cast away constness safely
144 return std::const_pointer_cast<std::remove_const_t<T>>(sp_const);
145 }