vtkWidgetSet broken for all widgets other than vtkParallelopipedWidget
Using VTK 7.1.1.
In vtkWidgetSet::AddWidget(), there is a very bad bug where a pointer to a vtkAbstractWidget is static_cast to vtkParallelopipedWidget and one of its data members is set. Since there is no RTTI check, this fails very badly for any widgets in a widget set other than this one sub-class causing undefined behavior.
The obvious short term solution is to do a dynamic_cast and check against nullptr to make sure that w is actually a vtkParallelopipedWidget before setting one of its data members.
But in the longer term, this is probably a sign of a flawed design and this line should be completely removed.
Furthermore, is this code covered by a unit test? If so, the test must not be catching this problem.