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 165 of file VolumeBuilder.hpp.

165 {
166 if (!this->solid_ptr_) {
167 MakeSolid();
168 }
169 return solid_ptr_.get_mutable();
170 }
T * get_mutable() const
Definition Linkable.hh:287
DerivedPtr MakeSolid()
Make the G4VSolid.

◆ 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 298 of file VolumeBuilder.hpp.

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

◆ 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 181 of file VolumeBuilder.hpp.

181 {
182 if (!logicvol_ptr_) {
183 BASE::MakeLogicalVolume();
184 }
185 return logicvol_ptr_.get_mutable();
186 }

◆ 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 173 of file VolumeBuilder.hpp.

173 {
174 if (!this->placement_) {
175 BASE::MakePlacement();
176 }
177 return this->placement_.get_mutable();
178 }