File indexing completed on 2025-10-18 08:20:31
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
0045 GeometryObject& operator=(const GeometryObject& geometryId) {
0046 if (&geometryId != this) {
0047 m_geometryId = geometryId.m_geometryId;
0048 }
0049 return *this;
0050 }
0051
0052
0053 GeometryIdentifier geometryId() const;
0054
0055
0056
0057
0058
0059
0060
0061 virtual Vector3 referencePosition(const GeometryContext& gctx,
0062 AxisDirection aDir) const = 0;
0063
0064
0065
0066
0067
0068
0069
0070 virtual double referencePositionValue(const GeometryContext& gctx,
0071 AxisDirection aDir) const;
0072
0073
0074
0075
0076 void assignGeometryId(const GeometryIdentifier& geometryId);
0077
0078 protected:
0079
0080 GeometryIdentifier m_geometryId;
0081 };
0082
0083 inline GeometryIdentifier GeometryObject::geometryId() const {
0084 return m_geometryId;
0085 }
0086
0087 inline void GeometryObject::assignGeometryId(
0088 const GeometryIdentifier& geometryId) {
0089 m_geometryId = geometryId;
0090 }
0091
0092 inline double GeometryObject::referencePositionValue(
0093 const GeometryContext& gctx, AxisDirection aDir) const {
0094 return VectorHelpers::cast(referencePosition(gctx, aDir), aDir);
0095 }
0096
0097 }