DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
|
#include <StructureBuilder.hh>
Public Member Functions | |
DerivedPtr | MakePlacement () |
DerivedPtr | ForkForPlacement (std::optional< int > copy_no=std::nullopt, const G4String &name_override="") |
DerivedPtr | ForkForLogicalVolume (const G4String &new_name) |
DerivedPtr | PlaceAndFork () |
DerivedPtr | SetName (const G4String &name) |
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 | SetPhysRotation (const G4RotationMatrix &rot) |
DerivedPtr | StackPhysRotation (const G4RotationMatrix &stacked_rot) |
DerivedPtr | SetPhysOffset (const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}) |
DerivedPtr | StackPhysOffset (const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}) |
DerivedPtr | SetPhysTransform (const UnitlessG4Transform3D &new_transform) |
DerivedPtr | StackPhysTransform (const UnitlessG4Transform3D &stacked_transform) |
G4Transform3D | GetPhysTransform () const |
DerivedPtr | OverridePlacementName (const G4String &pName) |
DerivedPtr | SetCopyNo (G4int pCopyNo) |
DerivedPtr | SetSurfaceCheck (G4bool pSurfChk) |
DerivedPtr | SetMother (const BuilderView &mother) |
DerivedPtr | SetAutoPlacementNaming (bool set) |
DerivedPtr | SetAutoCopyNo (bool set) |
DerivedPtr | CopyPlacementConfigsFrom (const BuilderView &other) |
DerivedPtr | SetDefaultUnit (G4double unit) |
G4double | GetEffectiveDefaultUnit () const |
~StructureBuilder () override | |
G4String | GetBuilderName () const |
std::shared_ptr< T > | shared_from_this () |
std::shared_ptr< const T > | shared_from_this () const |
void | set_shared_from_this_enabled (bool enabled) |
Protected Member Functions | |
G4VSolid * | SolidConstructor (const G4String &name) override=0 |
Protected Attributes | |
std::atomic< bool > | is_enabled_ {true} |
Friends | |
template<typename > | |
class | VolumeBuilder |
class | StructureBuilderReference |
class | Assembly |
template<typename > | |
class | StructureBuilder |
class | i_shared_ptr< StructureBuilder< U > > |
class | RZBuilder |
class | FromG4VSolid |
AssemblyPtr | CreateAssembly (G4String name) |
A type-erased (data shared view) view of a builder or assembly, ie a "structure.".
*@class StructureBuilder
Can hold other structures, creating placement hierarchies. Behaves like a buidler, but only for logical volume properties and placement related commands. You can set VisAtt on a structure, and can set offsets and rotations of the whole structure for placement.
While this base view only supports limited methods, it is fully polymorphic and builder objects internally can trigger their full build chain.
This derived clas really exists for parallelism with VolumeBuilderReference.
Definition at line 59 of file StructureBuilder.hh.
|
override |
Destructor Normally does not delete volume objects.
Geant takes care of that.
G4String GetBuilderName | ( | ) | const |
G4double GetEffectiveDefaultUnit | ( | ) | const |
Get the structure default unit or global if not set.
DerivedPtr MakePlacement | ( | ) |
Make a placed physical volume.
Retrieve it or make and retrieve with GetPlacement() Fails (throws) if already built. Make a copy first.
|
inlineinherited |
Definition at line 60 of file disableable_shared_from_this.hh.
DerivedPtr SetName | ( | const G4String & | name | ) |
SetName Sets name used for solid and derived product names.
name | The name |
|
inlineinherited |
Definition at line 44 of file disableable_shared_from_this.hh.
|
inlineinherited |
Definition at line 52 of file disableable_shared_from_this.hh.
|
overrideprotectedpure virtual |
polymorphic access to solid construction
Implements IStructureBuilder.
DerivedPtr StackPhysOffset | ( | const Unit3Vec & | offset = {CLHEP::mm, 0, 0, 0} | ) |
Like SetPhysOffset but stacks with previous transformations in order applied.
Note: Structures/Assebnlies stack transformations hierarchichicaly automatically.
This method is for manual hierarchical stacking calculations. It's probably redundant on assemblies in 99% of caases
Unlike with G4Transform multiplication, stacking is done in a way that allows mutiple objects to move together. The first transformations can set individual objects, and a uniform transformation can be applied to them all to create a rigid motion of the collection.
offset |
DerivedPtr StackPhysRotation | ( | const G4RotationMatrix & | stacked_rot | ) |
Like SetPhysRotation but stacks with previous transformations in order applied.
Note: Structures/Assebnlies stack transformations hierarchichicaly automatically.
This method is for manual hierarchical stacking calculations. It's probably redundant on assemblies in 99% of caases
Unlike with G4Transform multiplication, stacking is done in a way that allows mutiple objects to move together. The first transformations can set individual objects, and a uniform transformation can be applied to them all to create a rigid motion of the collection.
stacked_rot |
DerivedPtr StackPhysTransform | ( | const UnitlessG4Transform3D & | stacked_transform | ) |
Like SetPhysTransform but stacks with previous transformations in order applied.
Note: Structures/Assebnlies stack transformations hierarchichicaly automatically.
This method is for manual hierarchical stacking calculations. It's probably redundant on assemblies in 99% of caases
stacked_transform |
|
friend |
Definition at line 66 of file StructureBuilder.hh.
|
friend |
Assembly of strucures, ie builders and/or other assemblies.
Definition at line 25 of file Assembly.cc.
|
friend |
Definition at line 423 of file StructureBuilder.hh.
|
friend |
Definition at line 69 of file StructureBuilder.hh.
|
friend |
Definition at line 421 of file StructureBuilder.hh.
Definition at line 69 of file StructureBuilder.hh.
|
friend |
Definition at line 65 of file StructureBuilder.hh.
Definition at line 64 of file StructureBuilder.hh.
|
protectedinherited |
Definition at line 37 of file disableable_shared_from_this.hh.