You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Make JsonSurfacesWriter work with ConvexPolygonBounds (#5466)
Before PR [#5195](#5195), `SurfaceJsonConverter::toJson` worked for any SurfaceBounds subclass. PR #5195 introduced the type-based TypeDispatcher, populated by `Config::defaultConfig()` in `Plugins/Json/src/SurfaceJsonConverter.cpp`. The default registration covers all bounds but not `ConvexPolygonBounds<N>`. The dispatcher then throws the error (`TypeDispatcher.hpp`:132–135) "RuntimeError: No function registered for type: Acts::ConvexPolygonBounds<4>").
The Fix:
1) Added `#include "Acts/Surfaces/ConvexPolygonBounds.hpp"`
2) Added a `getSurfaceBoundsKind<>` branch for `ConvexPolygonBoundsBase` returning "ConvexPolygon"
3) Registered `surfaceBoundsToJsonT<ConvexPolygonBoundsBase>` in `Config::defaultConfig()`
4) Registered "PlaneConvexPolygon" decoder.
Example from resulting .json:
<img width="425" height="571" alt="image" src="https://github.com/user-attachments/assets/93494ea2-7680-4d40-8ca8-9c149f248b8e" />
0 commit comments