SafeDownCast was added to vtk way back when dynamic_cast was not available everywhere. Should we replace SafeDownCast in vtk with dynamic_cast? It is more natural for modern C++ and is well-documented. It may be more efficient although I doubt the current implementation is not a significant resource consumer.
I did an interesting experiment. I pushed an MR that replaced the implementation of SafeDownCast to use dynamic_cast. The first problem was using vtkAbstractHyperTreeGridMapper in vtkCellPicker. The hyper class has no subclasses in VTK. Not sure why.
I’m also getting some failed tests. I’ll continue to investigate…
I was under the impression that there are different options to improve performances of dynamic_cast. (e.g. http://www.stroustrup.com/fast_dynamic_casting.pdf). By keeping SafeDownCast, we let ourselves the option to speedup downcasting some day…
But maybe things have changed with the newests C++, I am not really up to speed here.
@jjomier I pushed an MR that replaced SafeDownCast with dynamic_cast. As you suspected, there are performance issues. We are better off keeping DafeDownCast. I’m afraid I wasted some of my not-so-costly time. I am closing the MR.