71 std::vector<std::unique_ptr<Trk::Surface>> outerSurfaces =
72 m_outer->volumeBounds().decomposeToSurfaces(transf *
m_outer->transform());
74 std::vector<std::unique_ptr<Trk::Surface>> innerSurfaces =
75 m_inner->volumeBounds().decomposeToSurfaces(transf *
m_inner->transform());
76 std::vector<unsigned int> subtrInner;
79 auto retsf = std::vector<std::unique_ptr<Trk::Surface>>();
81 unsigned int nSurf = outerSurfaces.size() + innerSurfaces.size();
90 for (
unsigned int out = 0; out < outerSurfaces.size(); out++) {
97 if (!(splo || plo || sclo || clo || dlo)) {
98 throw std::runtime_error(
"Unhandled surface.");
108 else if (cylVol && clo && out == 3){
111 else if (spbVol && out == 0){
119 outerSurfaces[out]->transform().inverse() * transf,
m_inner.get()));
134 throw std::logic_error(
"Not a VolumeExcluder");
137 auto outerSub = std::make_unique<Trk::Volume>(*volExcl->
volume());
138 std::unique_ptr<Trk::Volume> comb_sub;
140 comb_sub = std::make_unique<Trk::Volume>(
142 std::make_shared<Trk::CombinedVolumeBounds>(std::move(innerSub), std::move(outerSub),
false));
144 comb_sub = std::make_unique<Trk::Volume>(
146 std::make_shared<Trk::SubtractedVolumeBounds>(std::move(outerSub), std::move(innerSub)));
148 auto volEx = std::make_shared<const Trk::VolumeExcluder>(std::move(comb_sub));
150 retsf.push_back(std::make_unique<Trk::SubtractedPlaneSurface>(*splo, std::move(volEx), shared));
154 std::make_unique<Trk::SubtractedCylinderSurface>(*sclo, std::move(volEx), shared));
157 auto volEx = std::make_shared<const Trk::VolumeExcluder>(std::move(innerSub));
159 retsf.push_back(std::make_unique<Trk::SubtractedPlaneSurface>(*plo, std::move(volEx),
false));
162 retsf.push_back(std::make_unique<Trk::SubtractedCylinderSurface>(*clo, std::move(volEx),
false));
168 throw std::logic_error(
"Not DiscBounds");
170 auto eb = std::make_shared<EllipseBounds>(db->rMin(), db->rMin(), db->rMax(), db->rMax(), db->halfPhiSector());
172 retsf.push_back(std::make_unique<Trk::SubtractedPlaneSurface>(ploA, std::move(volEx),
false));
184 unsigned int nOut = outerSurfaces.size();
186 for (
unsigned int in = 0; in < innerSurfaces.size(); in++) {
200 else if (cylVol && cli && in == 3){
203 else if (spbVol && in == 0){
211 innerSurfaces[in]->transform().inverse() * transf,
m_outer.get()));
226 throw std::logic_error(
"Not a VolumeExcluder");
229 auto innerSub = std::make_unique<Trk::Volume>(*volExcl->
volume());
231 std::unique_ptr<Trk::Volume> comb_sub;
233 comb_sub = std::make_unique<Trk::Volume>(
235 std::make_shared<Trk::SubtractedVolumeBounds>(std::move(outerSub), std::move(innerSub)));
238 comb_sub = std::make_unique<Trk::Volume>(
240 std::make_shared<Trk::CombinedVolumeBounds>(std::move(innerSub), std::move(outerSub),
true));
242 auto volEx = std::make_shared<const Trk::VolumeExcluder>(std::move(comb_sub));
244 retsf.push_back(std::make_unique<Trk::SubtractedPlaneSurface>(*spli, std::move(volEx),
true));
247 retsf.push_back(std::make_unique<Trk::SubtractedCylinderSurface>(*scli, std::move(volEx),
true));
250 }
else if (pli || cli) {
251 auto volEx = std::make_shared<const Trk::VolumeExcluder>(std::move(outerSub));
253 retsf.push_back(std::make_unique<Trk::SubtractedPlaneSurface>(*pli, std::move(volEx),
true));
256 retsf.push_back(std::make_unique<Trk::SubtractedCylinderSurface>(*cli, std::move(volEx),
true));
262 throw std::logic_error(
"Not DiscBounds");
264 auto eb = std::make_shared<EllipseBounds>(db->rMin(), db->rMin(), db->rMax(), db->rMax(), db->halfPhiSector());
266 auto volEx = std::make_shared<const Trk::VolumeExcluder>(std::move(outerSub));
267 retsf.push_back(std::make_unique<Trk::SubtractedPlaneSurface>(pla, std::move(volEx),
true));
269 throw std::runtime_error(
270 "Unhandled surface in "
271 "Trk::SubtractedVolumeBounds::decomposeToSurfaces.");