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

Functions

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

Detailed Description

Copy configurations from other builders.

Function Documentation

◆ CopyPlacementConfigsFrom() [1/2]

template<typename U >
DerivedPtr CopyPlacementConfigsFrom ( const VolumeBuilder 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 >
VolumeBuilderBase< U >::DerivedPtr CopyPlacementConfigsFrom ( const VolumeBuilder 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 772 of file VolumeBuilderBase.hpp.

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

◆ CopyVolumeConfigsFrom()

template<typename U >
VolumeBuilderBase< U >::DerivedPtr CopyVolumeConfigsFrom ( const VolumeBuilder 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 781 of file VolumeBuilderBase.hpp.

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