DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
Functions
Units

Functions

DerivedPtr SetDefaultUnit (G4double unit)
 
DerivedPtr SetDefaultUnit (G4double unit)
 
G4double GetEffectiveDefaultUnit () const
 
void SetGlobalDefaultUnit (G4double unit)
 

Detailed Description

Methods to set units used in geometry methods.

Methods are available for both VolumeBuilder and StructureBuilder (ie builders and assemblies).

Function Documentation

◆ GetEffectiveDefaultUnit()

template<typename U >
G4double GetEffectiveDefaultUnit ( ) const

Get the builder default unit or global if not set.

Returns
The active default unit.

Definition at line 908 of file VolumeBuilder.hpp.

908 {
909 auto temp = builder_configs_.get();
910 auto local = temp->default_unit;
911 // auto local = builder_configs_->default_unit;
913 G4double default_unit = local.value_or(global);
914 return default_unit;
915 }

◆ SetDefaultUnit() [1/2]

template<typename U >
DerivedPtr SetDefaultUnit ( G4double  unit)

Set the per-Structure default unit for all later non-factory offsets.

Use DLG4::VolumeBuilders::SetGlobalDefaultUnit() to set a default for all builders, or fall back to the initial default of CLHEP::mm.

  • May not apply to values set before this is called.
  • Does not apply to factory units like CreateCenteredBoxBuilder();
    But should not be set and changed. Just use it once, early.
    Parameters
    unitThe unit to set, ex: CLHEP::mm
    Returns
    The builder (allows chaining)

◆ SetDefaultUnit() [2/2]

template<typename U >
VolumeBuilder< U >::DerivedPtr SetDefaultUnit ( G4double  unit)

Set the per-Builder default unit for all later non-factory offsets.

Use DLG4::VolumeBuilders::SetGlobalDefaultUnit() to set a default for all builders, or fall back to the initial default of CLHEP::mm.

  • May not apply to values set before this is called.
  • Does not apply to factory units like CreateCenteredBoxBuilder();
    But should not be set and changed. Just use it once, early.
    Parameters
    unitThe unit to set, ex: CLHEP::mm
    Returns
    The builder (allows chaining)

Definition at line 902 of file VolumeBuilder.hpp.

902 {
903 this->builder_configs_->default_unit = unit;
904 return this->shared_from_this();
905 }

◆ SetGlobalDefaultUnit()

void SetGlobalDefaultUnit ( G4double  unit)
inline

Set the default unit for all VolumeBuilder methods.

Definition at line 58 of file VolumeBuilderConfigs.hh.

58 {
59 BuilderConfigs::global_default_unit = unit;
60 }