Open
Description
In #1595 it became apparent that dynamic_cast
s of PathPoint
to test if they were MovingPathPoint
s, or not, could be avoided if the the abstract interface were more complete. For example, implementing the pure virtual getLocation(state)
avoids having to dynamic_cast to call getLocation()
on Stations. Furthermore, if the virtual function that returns the partial velocity of a point with respect to is parent frame is zero, then it is clearly not moving. Similar virtual functions could be used (added) to avoid dynamic_casts
completely.
The main advantages are:
- makes the code straightforward and easier to read/maintain
- better performance (virtual function call has a fixed/constant access time, where as dynamic_casts are implementation dependent) but needs to be profiled