26#include "TGeoBoolNode.h"
27#include "TGeoCompositeShape.h"
32const char RootGM::MultiUnion::fgkUnionChar =
'+';
33const char RootGM::MultiUnion::fgkSeparator =
':';
37 std::vector<VGM::ISolid*> constituents, std::vector<TGeoMatrix*> transforms)
42 fConstituents(constituents),
43 fTransforms(transforms)
51 for (
size_t i = 0; i < constituents.size(); ++i) {
56 TGeoHMatrix imatrix(*transforms[i]);
63 TGeoHMatrix displacement(
66 imatrix = imatrix * displacement;
71 TString irootSolidName = irootSolid->GetName();
75 formula += fgkUnionChar;
77 formula += irootSolidName;
79 TGeoMatrix* inewMatrix = 0;
80 if (!imatrix.IsIdentity()) {
81 inewMatrix =
new TGeoCombiTrans(imatrix);
85 inewMatrix->SetName(tname);
86 inewMatrix->RegisterYourself();
88 formula += fgkSeparator;
95 fCompositeShape =
new TGeoCompositeShape(name.data(), formula.Data());
108 :
VGM::ISolid(rhs),
VGM::IMultiUnion(rhs),
BaseVGM::VMultiUnion(rhs)
129 return fCompositeShape->GetName();
138 return int(fConstituents.size());
147 return fConstituents[index];
VGM implementation for Root Boolean solid.
virtual std::string Name() const
Return the name of this solid.
virtual int NofSolids() const
Return the number of constituent solids.
virtual ISolid * ConstituentSolid(int index) const
Return the i-th constituent solid.
virtual VGM::Transform Transformation(int index) const
Return the displacement of the ith constituent solid.
TGeoShape * GetSolid(VGM::ISolid *iSolid) const
void AddSolid(VGM::ISolid *, TGeoShape *)
static SolidMap * Instance()
The VGM interface to displaced solids.
virtual ISolid * ConstituentSolid() const =0
Return the constituent solid.
virtual Transform Displacement() const =0
Return the 3D displacement of the constituent solid.
The VGM interface to solids.
virtual SolidType Type() const =0
Return the type of this solid.
TGeoMatrix * CreateTransform(const VGM::Transform &transform)
VGM::Transform Transform(const TGeoMatrix &matrix)
std::vector< double > Transform