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

Functions

DerivedPtr CopyPlacementConfigsFrom (const BuilderView &other)
 
DerivedPtr CopyPlacementConfigsFrom (const BuilderView &other)
 
DerivedPtr CopyVolumeConfigsFrom (const BuilderView &other)
 

Detailed Description

Copy configurations from other builders.

Function Documentation

◆ CopyPlacementConfigsFrom() [1/2]

template<typename U >
DerivedPtr CopyPlacementConfigsFrom ( const BuilderView other)

This may help if reusing placement configs for a different structure.

Copies the placement configuration (rotation, translation, mother, etc.) from another structure. Does NOT copy any naming, as that would conflict. Also does NOT copy any products.

Parameters
otherThe builder instance to copy placement configuration from.
Returns
This builder for chaining.

◆ CopyPlacementConfigsFrom() [2/2]

template<typename U >
VolumeBuilder< U >::DerivedPtr CopyPlacementConfigsFrom ( const BuilderView other)

This may help if reusing placement configs for a different shape.

Copies the placement configuration (rotation, translation, mother, etc.) from another builder. Does NOT copy any naming, as that would conflict. Also does NOT copy any products. Use CopyPlacement Builder for that. Names will derive from present object, or you can override with Setters as usual.

Parameters
otherThe builder instance to copy placement configuration from.
Returns
This builder for chaining.

Definition at line 775 of file VolumeBuilder.hpp.

775 {
776 this->placement_configs_ = other->placement_configs_;
777 // receiver is responsible for unique naming/numbering.
778 // we can't clobber auto-name/number incrementing from another config:
779 // Does not copy the solid/boolean, just to get configs ONLY
780 return this->shared_from_this();
781 }

◆ CopyVolumeConfigsFrom()

template<typename U >
VolumeBuilder< U >::DerivedPtr CopyVolumeConfigsFrom ( const BuilderView other)

Copies the LogicalVolume configuration (material, VisAttributes, etc.) from another builder.

This DOES NOT include copying any booleans. This is useful for setting up multiple placements with similar configurations.

Parameters
otherThe builder instance to copy placement configuration from.
Returns
This builder for chaining.

Definition at line 784 of file VolumeBuilder.hpp.

784 {
785 // Booleans are NOT considered as part of Volume Configs.
786 // We keep our booleans.
787 auto name = this->builder_configs_->name; // backup our name
788 auto booleans = this->boolean_configs_->booleans;
789 this->lv_configs_ = other->lv_configs_;
790 // restor name. This is easier than keeping name separately. :P
791 this->builder_configs_->name = name;
792 this->boolean_configs_->booleans = booleans; // restore ours.
793 return this->shared_from_this();
794 }