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

Functions

DerivedPtr AddUnion (const VolumeBuilder &other, const DLG4::VolumeBuilders::ThreeVecDimensioner &offset={0, 0, 0, VB::Length::mm}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddSubtraction (const VolumeBuilder &other, const DLG4::VolumeBuilders::ThreeVecDimensioner &offset={0, 0, 0, VB::Length::mm}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddIntersection (const VolumeBuilder &other, const DLG4::VolumeBuilders::ThreeVecDimensioner &offset={0, 0, 0, VB::Length::mm}, G4RotationMatrix *rotation=nullptr)
 

Detailed Description

Define combination another volume with present one,.

Function Documentation

◆ AddIntersection()

template<typename U >
VolumeBuilderBase< U >::DerivedPtr AddIntersection ( const VolumeBuilder other,
const DLG4::VolumeBuilders::ThreeVecDimensioner offset = {0, 0, 0, VB::Length::mm},
G4RotationMatrix *  rotation = nullptr 
)

Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a BuilderView
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 264 of file VolumeBuilderBase.hpp.

265 {
266 if (other) {
267 bool is_subtraction = false;
268 bool is_intersection = true;
269 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
270 } else {
271 throw std::runtime_error("Error in AddBoolean() "
272 "for builder named: \"" + builder_configs_->name + "\"\n"
273 " volume is invalid (null)");
274 }
275 return this->shared_from_this();
276 }
DerivedPtr AddBoolean(const VolumeBuilder &other, bool is_subtraction=false, bool is_intersection=false, const DLG4::VolumeBuilders::ThreeVecDimensioner &offset={0, 0, 0, VB::Length::mm}, G4RotationMatrix *rotation=nullptr)
Add a boolean operation.

◆ AddSubtraction()

template<typename U >
VolumeBuilderBase< U >::DerivedPtr AddSubtraction ( const VolumeBuilder other,
const DLG4::VolumeBuilders::ThreeVecDimensioner offset = {0, 0, 0, VB::Length::mm},
G4RotationMatrix *  rotation = nullptr 
)

Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a BuilderView
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 249 of file VolumeBuilderBase.hpp.

250 {
251 if (other) {
252 bool is_subtraction = true;
253 bool is_intersection = false;
254 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
255 } else {
256 throw std::runtime_error("Error in AddBoolean(): "
257 "for builder named: \"" + builder_configs_->name + "\"\n"
258 "volume is invalid (null)");
259 }
260 return this->shared_from_this();
261 }

◆ AddUnion()

template<typename U >
VolumeBuilderBase< U >::DerivedPtr AddUnion ( const VolumeBuilder other,
const DLG4::VolumeBuilders::ThreeVecDimensioner offset = {0, 0, 0, VB::Length::mm},
G4RotationMatrix *  rotation = nullptr 
)

Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.

Parameters
otherA VolumeBuilder, G4VSolid, or anything constructable by a BuilderView
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 240 of file VolumeBuilderBase.hpp.

241 {
242 bool is_subtraction = false;
243 bool is_intersection = false;
244 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
245 return this->shared_from_this();
246 }