|
DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
|
#include <RZBuilderCore.hh>
Public Member Functions | |
| virtual RZBuilder | SetNumSides (G4double N) |
| RZBuilder | AddPlane (const RZPlane &plane) |
| RZBuilder | AddPlane (G4double IR, G4double OR, G4double z) |
| RZBuilder | AddPlane (G4double unit, G4double IR, G4double OR, G4double z) |
| RZBuilder | AddPlanes (const std::vector< RZPlane > &planes) |
| RZBuilder | AddPlanes (const std::vector< RZPlaneUnitless > &planes) |
| RZBuilder | AddPlanes (G4double unit, const std::vector< RZPlaneUnitless > &planes) |
| RZBuilder | ReflectZSolidConfig () |
| RZBuilder | FillSolidConfig () |
| G4VPhysicalVolume * | GetPlacement () final |
| DerivedPtr | MakePlacement () |
| DerivedPtr | PlaceAndFork () |
| G4LogicalVolume * | GetLogicalVolume () final |
| G4VSolid * | GetBaseSolid () final |
| G4VSolid * | GetFinalSolid () final |
| DerivedPtr | MakeLogicalVolume (G4Material *material=nullptr, G4String name=std::string()) |
| DerivedPtr | MakeSolid () |
| DerivedPtr | SetName (const G4String &name) |
| DerivedPtr | AddUnion (const VolumeBuilder &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr) |
| DerivedPtr | AddSubtraction (const VolumeBuilder &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr) |
| DerivedPtr | AddIntersection (const VolumeBuilder &other, const Unit3Vec &offset={CLHEP::mm, 0, 0, 0}, G4RotationMatrix *rotation=nullptr) |
| DerivedPtr | AddBoolean (const VolumeBuilder &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) |
| DerivedPtr | SetLogicalVolume (G4LogicalVolume *logical_volume) |
| DerivedPtr | SetBooleanName (const G4String &name) |
| 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 &new_transform) |
| G4Transform3D | GetPhysTransform () const final |
| DerivedPtr | OverridePlacementName (const G4String &pName) |
| DerivedPtr | SetCopyNo (G4int pCopyNo) |
| DerivedPtr | SetSurfaceCheck (G4bool pSurfChk) |
| DerivedPtr | SetMother (const VolumeBuilder &mother) |
| DerivedPtr | SetAutoPlacementNaming (bool set) |
| DerivedPtr | SetAutoCopyNo (bool set) |
| DerivedPtr | ReflectZFinalSolid () |
| DerivedPtr | ReflectZBaseSolid () |
| DerivedPtr | ForkAndReset (const G4String &new_name) const |
| DerivedPtr | ForkForFinalSolid (const G4String &new_name) |
| DerivedPtr | ForkForLogicalVolume (const G4String &new_name) |
| DerivedPtr | ForkForPlacement (std::optional< int > copy_no=std::nullopt, const G4String &name_override="", bool parent_name_was_set=false) |
| DerivedPtr | CopyPlacementConfigsFrom (const VolumeBuilder &other) |
| DerivedPtr | CopyVolumeConfigsFrom (const VolumeBuilder &other) |
| DerivedPtr | SetDefaultUnit (G4double unit) |
| G4double | GetEffectiveDefaultUnit () const |
| DerivedPtr | AddTo (BuilderViewList &list) const |
| DerivedPtr | AddTo (StructureViewList &list) const |
| DerivedPtr | AddTo (Assembly &assembly) const |
| 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 |
| SharedPtr< IStructureBuilder > | clone_impl () const override |
Protected Attributes | |
| std::atomic< bool > | is_enabled_ {true} |
Friends | |
| class | VolumeBuilderCore |
| class | VolumeBuilderBase< RZBuilderCore > |
| template<typename T > | |
| class | i_shared_ptr |
| RZBuilder | VB::CreatePolyhedraBuilder (const G4String &name, int sides, G4double phi_start, G4double phi_tot) |
| RZBuilder | VB::CreatePolyconeBuilder (const G4String &name, G4double phi_start, G4double phi_tot) |
| RZBuilder | VB::CreateCylinderBuilder (G4double unit, const G4String &name, G4double endz, G4double height, G4double OR, G4double IR) |
| RZBuilder | VB::CreateCylinderBuilder (const G4String &name, G4double endz, G4double height, G4double OR, G4double IR) |
Builder class for RZ mult-plane defined solids.
Use the CreateXXX() factory methods to create the buiders.
Definition at line 131 of file RZBuilderCore.hh.
|
inherited |
Add a boolean operation.
This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.
| other | A VolumeBuilder, G4VSolid, or anything constructable by a BuilderView |
| 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 |
Definition at line 220 of file VolumeBuilderBase.hpp.
|
inherited |
Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.
| other | A VolumeBuilder, G4VSolid, or anything constructable by a BuilderView |
| offset | Offset applied to solid |
| rotation | Applied to solid |
Definition at line 204 of file VolumeBuilderBase.hpp.
|
inherited |
Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.
| other | A VolumeBuilder, G4VSolid, or anything constructable by a BuilderView |
| offset | Offset applied to solid |
| rotation | Applied to solid |
Definition at line 200 of file VolumeBuilderBase.hpp.
|
inherited |
Add the builder an assembly geometrically joined manipulation.
| assembly | The assembly to add to. |
Definition at line 629 of file VolumeBuilderBase.hpp.
|
inherited |
Definition at line 611 of file VolumeBuilderBase.hpp.
|
inherited |
Add the builder a list for group/batch manipulations.
| list | The list to add to. |
Definition at line 620 of file VolumeBuilderBase.hpp.
|
inherited |
Define combination another volume with present one, This does NOT immediately trigger a build on a passed-in builder, just pre-sets the relationship.
| other | A VolumeBuilder, G4VSolid, or anything constructable by a BuilderView |
| offset | Offset applied to solid |
| rotation | Applied to solid |
Definition at line 196 of file VolumeBuilderBase.hpp.
|
overrideprotectedvirtualinherited |
Implements IStructureBuilder.
Definition at line 645 of file VolumeBuilderBase.hpp.
|
inherited |
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.
| other | The builder instance to copy placement configuration from. |
Definition at line 564 of file VolumeBuilderBase.hpp.
|
inherited |
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.
| other | The builder instance to copy placement configuration from. |
Definition at line 575 of file VolumeBuilderBase.hpp.
|
inherited |
Definition at line 265 of file VolumeBuilderBase.hpp.
|
inherited |
Copy a configured/unbuilt Builder, with a new name.
This is the most generic all-purpose copier, but can result in some duplication of constituent solids, etc.
Copies all configurations. You can modify and rebuild all products. Copying-Transformations are not remembered. Base implementation is in VolumeBuilder, but can be overridden for Solid-Builder specific needs.
| new_name |
Definition at line 498 of file VolumeBuilderBase.hpp.
|
inherited |
Calls MakeSolid() and copies builder with products cleared for further construction.
Configurations from ALL stages (including later) are kept.
| new_name | The base name for the new builder's Geant products. |
Definition at line 509 of file VolumeBuilderBase.hpp.
|
inherited |
Makes final solid (including booleans) if unbuilt and copies builder with products cleared for further construction.
Configurations from ALL stages (including later) are kept.
This one seems pretty specific, but could be useful for extending a boolean build more easily possibly
| new_name | The base name for the new builder's logical and physical volumes. |
Definition at line 524 of file VolumeBuilderBase.hpp.
|
inherited |
Calls MakeLogicalVolume() and creates a new builder instance with a copy of all placement-related configs.
This will be called automatically by consecutive calls to MakePlacement(). All physical volume and (future?) derived products are reset to be rebuilt. Copy_no and placement name can be auto incremented (number only by default) or overridden.
The copy_no will be incremented.
| copy_no | no arguments or std::nullopt to leave as auto. Must set on every use to get manual numbering. |
| name_override | An optional name override for the physical volume. Leave blank to use auto controls instead. |
Definition at line 541 of file VolumeBuilderBase.hpp.
|
finalvirtualinherited |
You probably want GetSolid() instead!!! This Gets a built Solid, BUT NOT final Boolean.
Builds default if not built yet.
Even if you aren't doing boolean now, if you add it later, this method will miss it. GetFinalSolid() is more general.
Implements IVolumeBuilder.
Definition at line 137 of file VolumeBuilderBase.hpp.
|
inherited |
Definition at line 638 of file VolumeBuilderBase.hpp.
|
inherited |
Get the builder default unit or global if not set.
Definition at line 601 of file VolumeBuilderBase.hpp.
|
finalvirtualinherited |
Gets a complete final built Solid, including configured Boolean operaions if any.
Builds default if not built yet.
Implements IVolumeBuilder.
Definition at line 145 of file VolumeBuilderBase.hpp.
|
finalvirtualinherited |
Gets a built LogicalVolume, builds default if not built yet.
Implements IVolumeBuilder.
Definition at line 125 of file VolumeBuilderBase.hpp.
|
inlinefinalvirtualinherited |
A helper to get the Physical Volume transform with units applied This is built from rotation and translatin if they were provided, or from a transform if it was provided, with units applied as specified.
Basically allows you to get the unit-multiplied version for use in direct Geant calls.
Implements IVolumeBuilder.
Definition at line 386 of file VolumeBuilderBase.hh.
|
finalvirtualinherited |
Gets the (last) placed physical volume.
Constructs it if not built yet. Unlike MakePlacement(), this will NOT auto-trigger consecutive placments from copied builders. But you can call it again after MakePlacement() to get those.
Implements IVolumeBuilder.
Definition at line 90 of file VolumeBuilderBase.hpp.
|
inherited |
Basically never needed now.
Builds the logical volume and returns the builder. GetLogicalVolume(), or passing the builder to any consumer will trigger the build anyway.
| material | Pointer to material to use. |
| name | Optional explicit name for logical volume. Normally already derived from builder/solid name. |
Definition at line 159 of file VolumeBuilderBase.hpp.
|
inherited |
Make a placed physical volume.
Retrieve it or make and retrieve with GetPlacement() Fails (throws) if already built. Make a copy first.
Definition at line 100 of file VolumeBuilderBase.hpp.
|
inherited |
Make the G4VSolid.
Returns the builder. Use GetBaseSolid() to retrieve or make and retrieve it.
Definition at line 167 of file VolumeBuilderBase.hpp.
|
inherited |
Set the placement name for the volume.
| pName | Name for the placement. |
Definition at line 397 of file VolumeBuilderBase.hpp.
|
inlineinherited |
An alias for MakePlacement and ForkForPlacement Used for one or many unaltered placments in sequence, usually with auto naming and/or numbering.
Definition at line 111 of file VolumeBuilderBase.hh.
|
inherited |
Configure base solid to be flipped BEFORE applying booleans.
Definition at line 482 of file VolumeBuilderBase.hpp.
|
inherited |
Configure final solid to be flipped in z.
Definition at line 472 of file VolumeBuilderBase.hpp.
|
inlineinherited |
Definition at line 60 of file disableable_shared_from_this.hh.
|
inherited |
| alpha |
Definition at line 258 of file VolumeBuilderBase.hpp.
|
inherited |
Enable (disable for false) auto Physical Volume numbering, on by default.
Adds a copy number to every name. By default copy numbers auto increment. Or you can set explicit names and numbers in ClonePlacement.
| set | True before setting. |
Definition at line 454 of file VolumeBuilderBase.hpp.
|
inherited |
Enable auto Physical Volume naming.
Adds a copy number to every name. By default copy numbers auto increment.
This will turn that off. Both makes no sense.
Or you can set explicit names and numbers in ClonePlacement.
| set | False before setting. |
Definition at line 441 of file VolumeBuilderBase.hpp.
|
inherited |
Pre-set base name for logical and physical volumes.
_L and _P will be appended, respectively.
If not set, the builder will take it from the builder name. But this is useful for unions where the starting solid name may be more specific.
| name |
Definition at line 301 of file VolumeBuilderBase.hpp.
|
inherited |
| color |
Definition at line 250 of file VolumeBuilderBase.hpp.
|
inherited |
Definition at line 242 of file VolumeBuilderBase.hpp.
|
inherited |
Set the copy number for the placement.
| pCopyNo | Copy number. |
Definition at line 406 of file VolumeBuilderBase.hpp.
|
inherited |
Set the per-Builder default unit for all later non-factory offsets.
Use DLG4::VolumeBuilders::SetGlobalDefaultUnit() to set a default for all builders, or fall back to the initial default of CLHEP::mm.
| unit | The unit to set, ex: CLHEP::mm |
Definition at line 594 of file VolumeBuilderBase.hpp.
|
inherited |
Directly Provide a Logical Volume Instead of using the builder.
| logical_volume |
Definition at line 290 of file VolumeBuilderBase.hpp.
|
inherited |
|
inherited |
Set the mother volume with a builder, or G4VPhysicalVolume or G4VLogicalVolume through implicit conversion.
This does NOT immediately force a build the mother builder, just pre-sets the relationship.
| mother | BuilderVew parameter accepts a builder or a G4VSolid through implicit ctor |
Definition at line 428 of file VolumeBuilderBase.hpp.
|
inherited |
SetName Sets name used for solid and derived product names.
| name | The name |
Definition at line 174 of file VolumeBuilderBase.hpp.
|
inherited |
Set the translation vector for placement.
Using Set, rotation applies before translation, regardless of order set, just as in G4PVPlacement() You can pass (unit, x, y, z) or use the default unit with (x, y, z).
Examples: SetPhysOffset({CLHEP::cm, 1, 2, 3}) // 1cm, 2cm, 3cm SetPhysOffset({1, 2, 3}) // Uses default default unit (usually mm) SetDefaultUnit(CLHEP::cm); SetPhysOffset({1, 2, 3}) // 1cm, 2cm, 3cm SetDefaultUnit(1); SetPhysOffset({10*CLHEP::mm, 20*CLHEP::mm, 30*CLHEP::mm}) // Values already have units
| offset | Translation vector. See method description for details. |
Definition at line 340 of file VolumeBuilderBase.hpp.
|
inherited |
Set the rotation matrix for placement.
Using Set, rotation applies before translation, regardless of order set, just as in G4PVPlacement()
| rot | Pointer to the rotation matrix. |
Definition at line 310 of file VolumeBuilderBase.hpp.
|
inherited |
Set the G4Transform3D for placment.
The tranformation provided is meant to be in UNITLESS values. Ie the unit is already pre-configured but not included in the values. So passing 5 means 5cm if SetDefault(CLHEP::cm) was set. Otherwise you SetDefaultUnit(1), and pass a value that was already multipled by units. To supply different units for each G4Tranform3D separately, just call SetDefaultUnit(unit) before each call. The call will overwite/replace rotation and translation.
| new_transform | Translation vector. |
Definition at line 367 of file VolumeBuilderBase.hpp.
|
inherited |
Set the surface check flag for the placement.
| pSurfChk | Boolean flag for surface check. |
Definition at line 414 of file VolumeBuilderBase.hpp.
|
inherited |
| x |
Definition at line 273 of file VolumeBuilderBase.hpp.
|
inlineinherited |
Definition at line 44 of file disableable_shared_from_this.hh.
|
inlineinherited |
Definition at line 52 of file disableable_shared_from_this.hh.
|
inlineoverrideprotectedvirtual |
The polymorphic Solid constructor.
Implements VolumeBuilderBase< RZBuilderCore >.
Definition at line 251 of file RZBuilderCore.hh.
|
inherited |
Like SetPhysOffset but stacks with previous transformations in order applied.
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 |
Definition at line 351 of file VolumeBuilderBase.hpp.
|
inherited |
Like SetPhysRotation but stacks with previous transformations in order applied.
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 |
Definition at line 322 of file VolumeBuilderBase.hpp.
|
inherited |
Like SetPhysTransform but stacks with previous transformations in order applied.
| new_transform |
Definition at line 374 of file VolumeBuilderBase.hpp.
|
friend |
Definition at line 137 of file RZBuilderCore.hh.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 134 of file RZBuilderCore.hh.
|
friend |
A polymorphic, type-erased "view" of any specialized builder.
Use it to assign a specialized builder to a generic builder. But you don't use it directly. It has no direct public ctors or factories, but BuilderView(your_other_builder_object) constructs it as i_shared_ptr<VolumeBuilderCore> ( pointer-wrapped builder). Or pass your builder to something expecting a BuilderView, like ex: a std::vector<BuilderViewr>, aka a BuilderViewList.
Definition at line 134 of file RZBuilderCore.hh.
|
protectedinherited |
Definition at line 37 of file disableable_shared_from_this.hh.