I’ve been working on this MR lately. First of all, it’s not finished so don’t take it as it is. However I want to show early what it’s doing.
Basically the idea is to introduce a dedicated interface (EventFunction) for event function definition (the so called g). For me this has two main advantages:
EventDetector reinforces its high level role of orchestration. It already delegates to EventHandler and EventDetectionSettings, now it will also do so for the event function evaluation and some other flags for performance.
EventFunction centralises the definition for double and Field. This is very useful. As you can see in the MR, it allows to define a FieldImpulseManeuver from a non Field one. More generally, it will be way easier to define a Field detector from a standard one.
I’ve tried to make as little API breaking as possible. They’re basically for the FieldEventDetector, with limited impact on inheritors of FieldAbstractDetector.
Yes I know about these detectors, but this MR goes well beyond. It unifies the double and Field definitions, somewhat similarly to what is done with other concepts in BodyFrame, ForceModel, ExtendedPositionProvider, etc. It opens the door for built-in back and forth between simple detectors and their fielded counterpart, which is very useful for maneuver triggers in particular.
It also creates a dedicated place to have all the flags used for performance. For instance recently I removed a bottleneck when using many detectors with the STM.
I’ve managed to minimize the breaking changes to a negligible one so I think I’ll merge soon.