File indexing completed on 2026-04-17 07:46:41
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Geometry/detail/PortalPlacement.hpp"
0010
0011 #include "Acts/Geometry/VolumePlacementBase.hpp"
0012
0013 namespace Acts::detail {
0014
0015 PortalPlacement::PortalPlacement(const std::size_t portalIdx,
0016 const Transform3& portalTrf,
0017 const VolumePlacementBase* parent,
0018 std::shared_ptr<RegularSurface> surface)
0019 : m_portalToVolumeCenter{portalTrf},
0020 m_surface{std::move(surface)},
0021 m_parent{parent},
0022 m_portalIdx{portalIdx} {
0023 assert(m_surface != nullptr);
0024 m_surface->assignSurfacePlacement(*this);
0025 }
0026
0027 Transform3 PortalPlacement::assembleFullTransform(
0028 const GeometryContext& gctx) const {
0029 return m_parent->localToGlobalTransform(gctx) * portalToVolumeCenter();
0030 }
0031
0032 const Transform3& PortalPlacement::localToGlobalTransform(
0033 const GeometryContext& gctx) const {
0034 return m_parent->portalLocalToGlobal(gctx, m_portalIdx);
0035 }
0036
0037 const RegularSurface& PortalPlacement::surface() const {
0038 return *m_surface;
0039 }
0040
0041 RegularSurface& PortalPlacement::surface() {
0042 return *m_surface;
0043 }
0044
0045 bool PortalPlacement::isSensitive() const {
0046 return false;
0047 }
0048
0049 std::size_t PortalPlacement::index() const {
0050 return m_portalIdx;
0051 }
0052
0053 const Transform3& PortalPlacement::portalToVolumeCenter() const {
0054 return m_portalToVolumeCenter;
0055 }
0056
0057 const std::shared_ptr<RegularSurface>& PortalPlacement::surfacePtr() {
0058 return m_surface;
0059 }
0060
0061 std::shared_ptr<const RegularSurface> PortalPlacement::surfacePtr() const {
0062 return m_surface;
0063 }
0064 }