241 const CuboidVolumeBounds* box =
243 const TrapezoidVolumeBounds* trd =
245 const DoubleTrapezoidVolumeBounds* trdd =
247 &(vol.volumeBounds()));
248 const PrismVolumeBounds* prism =
250 const SimplePolygonBrepVolumeBounds* spb =
252 &(vol.volumeBounds()));
254 bool isPolygon = (box || trd || prism || spb || trdd);
262 std::vector<Amg::Vector3D> vtxLocal;
265 (box || (trd && trd->minHalflengthX() ==
266 trd->maxHalflengthX()))) {
270 hz = box->halflengthX();
272 vtxLocal.emplace_back(box->halflengthX(), box->halflengthY(),
274 vtxLocal.emplace_back(box->halflengthX(), -box->halflengthY(),
276 vtxLocal.emplace_back(box->halflengthX(), -box->halflengthY(),
277 -box->halflengthZ());
278 vtxLocal.emplace_back(box->halflengthX(), box->halflengthY(),
279 -box->halflengthZ());
281 hz = trd->minHalflengthX();
283 vtxLocal.emplace_back(trd->minHalflengthX(), trd->halflengthY(),
285 vtxLocal.emplace_back(trd->minHalflengthX(),
286 -trd->halflengthY(), trd->halflengthZ());
287 vtxLocal.emplace_back(trd->maxHalflengthX(),
288 -trd->halflengthY(), -trd->halflengthZ());
289 vtxLocal.emplace_back(trd->maxHalflengthX(), trd->halflengthY(),
290 -trd->halflengthZ());
292 }
else if (
swap == 2) {
294 hz = box->halflengthY();
296 vtxLocal.emplace_back(box->halflengthX(), box->halflengthY(),
298 vtxLocal.emplace_back(-box->halflengthX(), box->halflengthY(),
300 vtxLocal.emplace_back(-box->halflengthX(), box->halflengthY(),
301 -box->halflengthZ());
302 vtxLocal.emplace_back(box->halflengthX(), box->halflengthY(),
303 -box->halflengthZ());
305 hz = trd->halflengthY();
307 vtxLocal.emplace_back(trd->minHalflengthX(), trd->halflengthY(),
309 vtxLocal.emplace_back(-trd->minHalflengthX(),
310 trd->halflengthY(), trd->halflengthZ());
311 vtxLocal.emplace_back(-trd->minHalflengthX(),
312 trd->halflengthY(), -trd->halflengthZ());
313 vtxLocal.emplace_back(trd->minHalflengthX(), trd->halflengthY(),
314 -trd->halflengthZ());
318 cache.
center = vol.transform().translation();
322 cache.
vertices.push_back(std::move(vtx));
328 hz = box->halflengthZ();
330 vtxLocal.emplace_back(box->halflengthX(), box->halflengthY(),
332 vtxLocal.emplace_back(-box->halflengthX(), box->halflengthY(),
334 vtxLocal.emplace_back(-box->halflengthX(), -box->halflengthY(),
336 vtxLocal.emplace_back(box->halflengthX(), -box->halflengthY(),
339 hz = trd->halflengthZ();
341 vtxLocal.emplace_back(trd->minHalflengthX(), -trd->halflengthY(),
343 vtxLocal.emplace_back(-trd->minHalflengthX(), -trd->halflengthY(),
345 vtxLocal.emplace_back(-trd->maxHalflengthX(), trd->halflengthY(),
347 vtxLocal.emplace_back(trd->maxHalflengthX(), trd->halflengthY(),
350 hz = trdd->halflengthZ();
352 vtxLocal.emplace_back(trdd->maxHalflengthX(), 2 * trdd->halflengthY2(),
353 trdd->halflengthZ());
354 vtxLocal.emplace_back(-trdd->maxHalflengthX(), 2 * trdd->halflengthY2(),
355 trdd->halflengthZ());
356 vtxLocal.emplace_back(-trdd->medHalflengthX(), 0., trdd->halflengthZ());
357 vtxLocal.emplace_back(-trdd->minHalflengthX(),
358 -2 * trdd->halflengthY1(), trdd->halflengthZ());
359 vtxLocal.emplace_back(trdd->minHalflengthX(), -2 * trdd->halflengthY1(),
360 trdd->halflengthZ());
361 vtxLocal.emplace_back(trdd->medHalflengthX(), 0., trdd->halflengthZ());
363 hz = prism->halflengthZ();
364 const std::vector<std::pair<double, double>> vtcs = prism->xyVertices();
365 for (
const auto& vtc : vtcs)
366 vtxLocal.emplace_back(vtc.first, vtc.second, prism->halflengthZ());
367 cache.
nVtx = vtcs.size();
369 hz = spb->halflengthZ();
370 const std::vector<std::pair<double, double>> vtcs = spb->xyVertices();
371 for (
const auto& vtc : vtcs)
372 vtxLocal.emplace_back(vtc.first, vtc.second, spb->halflengthZ());
373 cache.
nVtx = vtcs.size();
377 cache.
center = vol.transform().translation();
381 cache.
vertices.push_back(std::move(vtx));