|
DerivedPtr | SetMaterial (G4Material *material) |
|
DerivedPtr | SetColor (double r=0.5, double g=0.5, double b=0.5, double alpha=1.0) |
|
DerivedPtr | SetColor (const G4Colour &color) |
|
DerivedPtr | SetAlpha (G4double alpha) |
|
DerivedPtr | ForceSolid (bool x=true) |
|
DerivedPtr | SetVisibility (bool is_visible=true) |
|
DerivedPtr | AddBoolean (const BuilderView &other, bool is_subtraction=false, bool is_intersection=false, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr) |
|
DerivedPtr | SetMaterial (G4Material *material) |
|
DerivedPtr | SetColor (double r=0.5, double g=0.5, double b=0.5, double alpha=1.0) |
|
DerivedPtr | SetColor (const G4Colour &color) |
|
DerivedPtr | SetAlpha (G4double alpha) |
|
DerivedPtr | ForceSolid (bool x=true) |
|
DerivedPtr | SetVisibility (bool x=true) |
|
These all return the builder for fluent interface.
◆ AddBoolean()
template<typename U >
VolumeBuilder< U >::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.
This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.
- Parameters
-
other | A VolumeBuilder, G4VSolid, or anything constructable by a VolumeReferencePtr |
is_subtraction | true for subtraction, false for union |
is_intersection | true for intersection, false for union |
offset | Offset applied to solid |
rotation | Applied to solid |
- Returns
- The builder
Definition at line 282 of file VolumeBuilder.hpp.
283 {
284 auto offset = ProvisionUnits(new_offset);
285
286 if (other) {
287 boolean_configs_->booleans.emplace_back(
288 BooleanSolid{other, is_subtraction, is_intersection, offset, rotation});
289 } else {
290 throw std::runtime_error("Error in AddBoolean() "
291 "for builder named: \"" + builder_configs_->name + "\"\n"
292 " volume is invalid (null)");
293 }
295 }
std::shared_ptr< T > shared_from_this()
◆ ForceSolid() [1/2]
◆ ForceSolid() [2/2]
- Returns
- The builder
Definition at line 436 of file VolumeBuilder.hpp.
436 {
437 lv_configs_->force_solid = x;
438 ApplyAttributes_();
440 }
◆ SetAlpha() [1/2]
- Parameters
-
- Returns
- The builder
◆ SetAlpha() [2/2]
- Parameters
-
- Returns
- The builder
Definition at line 422 of file VolumeBuilder.hpp.
422 {
423 lv_configs_->color.SetAlpha(alpha);
424 ApplyAttributes_();
426 }
◆ SetColor() [1/4]
- Parameters
-
- Returns
- The builder
◆ SetColor() [2/4]
template<typename U >
VolumeBuilder< U >::DerivedPtr SetColor |
( |
const G4Colour & |
color | ) |
|
- Parameters
-
- Returns
- The builder
Definition at line 429 of file VolumeBuilder.hpp.
429 {
430 lv_configs_->color = color;
431 ApplyAttributes_();
433 }
◆ SetColor() [3/4]
template<typename U >
DerivedPtr SetColor |
( |
double |
r = 0.5 , |
|
|
double |
g = 0.5 , |
|
|
double |
b = 0.5 , |
|
|
double |
alpha = 1.0 |
|
) |
| |
◆ SetColor() [4/4]
template<typename U >
VolumeBuilder< U >::DerivedPtr SetColor |
( |
double |
r = 0.5 , |
|
|
double |
g = 0.5 , |
|
|
double |
b = 0.5 , |
|
|
double |
alpha = 1.0 |
|
) |
| |
- Returns
- The builder
Definition at line 415 of file VolumeBuilder.hpp.
415 {
416 lv_configs_->color = G4Colour(r, g, b, alpha);
417 ApplyAttributes_();
419 }
◆ SetMaterial() [1/2]
/**
- Parameters
-
- Returns
- The builder
◆ SetMaterial() [2/2]
template<typename U >
VolumeBuilder< U >::DerivedPtr SetMaterial |
( |
G4Material * |
material | ) |
|
/**
- Parameters
-
- Returns
- The builder
Definition at line 409 of file VolumeBuilder.hpp.
409 {
410 lv_configs_->material = material;
412 }
◆ SetVisibility() [1/2]
template<typename U >
DerivedPtr SetVisibility |
( |
bool |
is_visible = true | ) |
|
- Parameters
-
- Returns
- The builder
◆ SetVisibility() [2/2]
- Parameters
-
- Returns
- The builder
Definition at line 443 of file VolumeBuilder.hpp.
443 {
444 lv_configs_->is_visible = x;
445 ApplyAttributes_();
447 }