39 const std::string& name,
VGM::ISolid* solid, TGeoMatrix* displacement)
41 VGM::IDisplacedSolid(),
44 fConstituentSolid(solid)
56 std::string newName = name;
59 displacement->SetName(newName.data());
60 displacement->RegisterYourself();
62 TGeoBoolNode* boolNode =
new TGeoUnion(rootSolid, rootSolid, displacement, 0);
64 fCompositeShape =
new TGeoCompositeShape(newName.data(), boolNode);
72 VGM::IDisplacedSolid(),
81 const Double_t* origin = box->GetOrigin();
83 std::cerr <<
" RootGM::DisplacedSolid::DisplacedSolid: " << std::endl;
84 std::cerr <<
" Cannot create displaced solid from a box without offset."
86 std::cerr <<
" (TGeoBBox name = " << box->GetName() <<
")" << std::endl;
87 std::cerr <<
"*** Error: Aborting execution ***" << std::endl;
92 std::string newName = std::string(box->GetName()) + fgkNameExtension;
99 TGeoMatrix* displacement =
100 new TGeoTranslation(origin[0], origin[1], origin[2]);
101 displacement->SetName(newName.data());
102 displacement->RegisterYourself();
104 TGeoBoolNode* boolNode =
new TGeoUnion(box, box, displacement, 0);
106 fCompositeShape =
new TGeoCompositeShape(newName.data(), boolNode);
115 VGM::IDisplacedSolid(),
125 std::string newName = std::string(halfSpace->GetName()) + fgkNameExtension;
128 double size = 1.0e03;
130 TGeoBBox* box =
new TGeoBBox(
"bigBox", size, size, size);
135 Double_t* point = halfSpace->GetPoint();
136 Double_t* norm = halfSpace->GetNorm();
157 TGeoRotation* rotation =
new TGeoRotation();
158 rotation->SetMatrix(rot);
165 Double_t newOrigin[3];
166 rotation->LocalToMaster(origin, newOrigin);
167 for (Int_t i = 0; i < 3; i++) newOrigin[i] = newOrigin[i] + point[i];
170 TGeoMatrix* displacement =
171 new TGeoCombiTrans(newOrigin[0], newOrigin[1], newOrigin[2], rotation);
172 displacement->SetName(newName.data());
173 displacement->RegisterYourself();
175 TGeoBoolNode* boolNode =
new TGeoUnion(box, box, displacement, 0);
177 fCompositeShape =
new TGeoCompositeShape(newName.data(), boolNode);