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

Functions

G4VPhysicalVolume * GetPlacement () final
 
G4LogicalVolume * GetLogicalVolume () final
 
G4VSolid * GetBaseSolid () final
 
G4VSolid * GetFinalSolid () final
 

Detailed Description

Function Documentation

◆ GetBaseSolid()

template<typename U >
G4VSolid * GetBaseSolid ( )
finalvirtual

You probably want GetSolid() instead!!! This Gets a built Solid, BUT NOT final Boolean.

Builds default if not built yet.

Even if you aren't doing boolean now, if you add it later, this method will miss it. GetFinalSolid() is more general.

Returns
Raw visitor pointer to the solid. (DON'T DELETE IT!)

Implements IVolumeBuilder.

Definition at line 162 of file VolumeBuilderBase.hpp.

162 {
163 if (!this->solid_ptr_) {
164 MakeSolid();
165 }
166 return solid_ptr_.get_mutable();
167 }

◆ GetFinalSolid()

template<typename U >
G4VSolid * GetFinalSolid ( )
finalvirtual

Gets a complete final built Solid, including configured Boolean operaions if any.

Builds default if not built yet.

Returns
Raw visitor pointer to the solid. (DON'T DELETE IT!)

Implements IVolumeBuilder.

Definition at line 295 of file VolumeBuilderBase.hpp.

295 {
296 if (!final_solid_ptr_ && placement_configs_->is_builder) {
297 MakeFinalSolid(std::string("")); // checks are done in there.
298 }
299 // should probably have a check here, although it's a bug anyway if not built now.
300 return this->final_solid_ptr_;
301 }

◆ GetLogicalVolume()

template<typename U >
G4LogicalVolume * GetLogicalVolume ( )
finalvirtual

Gets a built LogicalVolume, builds default if not built yet.

Returns
Raw visitor pointer to the logical volume (DON'T DELETE IT!)

Implements IVolumeBuilder.

Definition at line 178 of file VolumeBuilderBase.hpp.

178 {
179 if (!logicvol_ptr_) {
180 BASE::MakeLogicalVolume();
181 }
182 return logicvol_ptr_.get_mutable();
183 }

◆ GetPlacement()

template<typename U >
G4VPhysicalVolume * GetPlacement ( )
finalvirtual

Gets the (last) placed physical volume.

Constructs it if not built yet. Unlike MakePlacement(), this will NOT auto-trigger consecutive placments from copied builders. But you can call it again after MakePlacement() to get those.

Returns
Raw visitor pointer to physical volume. (DON'T DELETE IT).

Implements IVolumeBuilder.

Definition at line 170 of file VolumeBuilderBase.hpp.

170 {
171 if (!this->placement_) {
172 BASE::MakePlacement();
173 }
174 return this->placement_.get_mutable();
175 }