Problem 2457

Summary: Provide const-reference signature for G4MultiUnion::AddNode
Product: Geant4 Reporter: Ben Loer <ben.loer>
Component: geometry/solidsAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.7   
Hardware: All   
OS: All   

Description Ben Loer 2021-12-17 19:43:11 CET
The signature for `G4MultiUnion::AddNode` is 
```
void AddNode(G4VSolid& solid, G4Transform3D& trans);
```

This prevents compact construction via in-place declaration of the transform like
```
munion->AddNode(*solid, G4TranslateX3D(dx));
```
and instead requires declaring an extraneous transform object. In the implementation, the transform is copied into a member vector, so there is no reason not to make method argument `const`. 

Related, it would be nice to provide signature that accepts the solid as a pointer
```
void AddNode(G4VSolid* solid, const G4Transform3D& trans);
```
to be more similar to the boolean solid constructors.
Comment 1 Gabriele Cosmo 2022-01-14 09:53:57 CET
Thanks. The proposed change is now implemented in the development branch and will be available in the next public release.