Skip to content

BUG: Rename vtkInteractionCallback class to avoid symbol clash

Following 7451dd2d (vtkDisplaySizedImplicitPlaneWidget/Representation: Implementation) and cd42f785 (vtkCoordinateFrameWidget: Implementation), the class called vtkInteractionCallback was defined multiple times in the following classes:

  • vtkImplicitPlaneWidget2.cxx
  • vtkDisplaySizedImplicitPlaneWidget.cxx
  • vtkCoordinateFrameWidget

This violates the one definition rule (ODR) and can lead to undefined behavior.

See https://discourse.slicer.org/t/transition-of-nightly-build-from-vtk-9-0-20201111-to-9-1-20220125/21669

The issue "started" back in 2012 with commit dd214570 (ENH: Automatic plan orientation in vtkImplicitPlaneWidget2) added the class vtkInteractionCallback that was using a generic name.

Then, in 2015, following effa1ddd (Added new widget: vtkImplicitCylinderWidget), the pattern of using the generic classname vtkInteractionCallback has been copied into vtkImplicitCylinderWidget introducing a first occurrence undefined behavior later addressed in e8170ff5 (Fix multiple definitions of vtkInteractionCallback)

Edited by Jean-Christophe Fillion-Robin

Merge request reports