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

Functions

DerivedPtr AddUnion (const BuilderView &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddSubtraction (const BuilderView &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 
DerivedPtr AddIntersection (const BuilderView &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr)
 

Detailed Description

Define combination another volume with present one,.

Function Documentation

◆ AddIntersection()

template<typename U >
VolumeBuilder< U >::DerivedPtr AddIntersection ( const BuilderView other,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
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 VolumeReferencePtr
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 267 of file VolumeBuilder.hpp.

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

◆ AddSubtraction()

template<typename U >
VolumeBuilder< U >::DerivedPtr AddSubtraction ( const BuilderView other,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
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 VolumeReferencePtr
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 252 of file VolumeBuilder.hpp.

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

◆ AddUnion()

template<typename U >
VolumeBuilder< U >::DerivedPtr AddUnion ( const BuilderView other,
const Unit3Vec offset = {CLHEP::mm, 0, 0, 0},
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 VolumeReferencePtr
offsetOffset applied to solid
rotationApplied to solid
Returns
The builder

Definition at line 243 of file VolumeBuilder.hpp.

244 {
245 bool is_subtraction = false;
246 bool is_intersection = false;
247 AddBoolean(other, is_subtraction, is_intersection, new_offset, rotation);
248 return this->shared_from_this();
249 }