File indexing completed on 2025-09-16 08:12:53
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/GeometryIdentifier.hpp"
0014 #include "Acts/Utilities/AxisDefinitions.hpp"
0015 #include "Acts/Utilities/VectorHelpers.hpp"
0016
0017 namespace Acts {
0018
0019
0020
0021
0022
0023
0024
0025 class GeometryObject {
0026 public:
0027
0028 GeometryObject() = default;
0029
0030
0031 GeometryObject(const GeometryObject&) = default;
0032
0033
0034
0035
0036 explicit GeometryObject(const GeometryIdentifier& geometryId)
0037 : m_geometryId(geometryId) {}
0038
0039 virtual ~GeometryObject() noexcept = default;
0040
0041
0042
0043
0044 GeometryObject& operator=(const GeometryObject& geometryId) {
0045 if (&geometryId != this) {
0046 m_geometryId = geometryId.m_geometryId;
0047 }
0048 return *this;
0049 }
0050
0051
0052 GeometryIdentifier geometryId() const;
0053
0054
0055
0056
0057
0058
0059
0060 virtual Vector3 referencePosition(const GeometryContext& gctx,
0061 AxisDirection aDir) const = 0;
0062
0063
0064
0065
0066
0067
0068
0069 virtual double referencePositionValue(const GeometryContext& gctx,
0070 AxisDirection aDir) const;
0071
0072
0073
0074
0075 void assignGeometryId(const GeometryIdentifier& geometryId);
0076
0077 protected:
0078 GeometryIdentifier m_geometryId;
0079 };
0080
0081 inline GeometryIdentifier GeometryObject::geometryId() const {
0082 return m_geometryId;
0083 }
0084
0085 inline void GeometryObject::assignGeometryId(
0086 const GeometryIdentifier& geometryId) {
0087 m_geometryId = geometryId;
0088 }
0089
0090 inline double GeometryObject::referencePositionValue(
0091 const GeometryContext& gctx, AxisDirection aDir) const {
0092 return VectorHelpers::cast(referencePosition(gctx, aDir), aDir);
0093 }
0094
0095 }