I’ve been trying to get a vtkScalarBarWidget to orient horizontally. I’ve found that the vtkScalarBar will, but I can’t figure out how to do this with the widget.
SetOrientationToHorizontal() is a vtkScalarBarActor method. It is an actor, that is, the thing that appears in the scene inside the widget, which is a vtkScalarBarWidget. So, you need to act upon the widget, not the actor. vtkScalarBarWidget has a GetScalarBarRepresentation() method which returns a pointer to a vtkScalarBarRepresentation object. Maybe you want to try exploring its API to achieve the effect you want: https://vtk.org/doc/nightly/html/classvtkScalarBarRepresentation.html. Perhaps its SetOrientation(int) or SetPostion() methods will do.