MantisBT - VTK
View Issue Details
0007430VTK(No Category)public2008-07-30 16:482015-10-27 23:43
Sarah Macumber 
 
normalmajoralways
closedno change required 
 
 
TBD
incorrect functionality
0007430: vtkScalarBarWidget does not take position, width and height from vtkScalarBarActor
I am creating a vtkScalarBarActor and a vtkScalarBarWidget to handle interaction with a scalar bar. Even though the position, width and height properties of the scalar bar are set the widget displays the scalar bar as a square in the bottom right corner. Further interaction with the widgit produces normal results but I am unable to force the widget to be a certain size.

Also I have attached a vtkTextProperty but the text still changes font size as the window changes size. It would be nice if it didn't do that.

Thanks in advance,
Sarah
_prop = new vtkTextProperty();
_scalarBarActor = new vtkScalarBarActor();
_scalarBarWidget = new vtkScalarBarWidget();
          
_prop.SetFontFamilyToArial();
_prop.SetFontSize(10);
_prop.SetColor(0,0,0);
_prop.SetJustificationToCentered();

_scalarBarActor.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport();
_scalarBarActor.SetPosition(.1, .1);
_scalarBarActor.SetOrientationToHorizontal();
_scalarBarActor.SetWidth(.8);
_scalarBarActor.SetHeight(0.17);
_scalarBarActor.SetLabelFormat("%g");
_scalarBarActor.SetLabelTextProperty(_prop);
_scalarBarActor.SetTextPositionToSucceedScalarBar();
_scalarBarActor.SetTitleTextProperty(_prop);

_scalarBarWidget.SetInteractor(ren.GetRenderWindow().GetInteractor());
_scalarBarWidget.SetCurrentRenderer(ren);
_scalarBarWidget.SetScalarBarActor(_scalarBarActor);

_scalarBarWidget.EnabledOn();


// Forcibly trying to change the widget does not work

_scalarBarWidget.GetScalarBarActor().SetHeight(.17);
_scalarBarWidget.GetScalarBarActor().SetWidth(.8);
_scalarBarWidget.GetScalarBarActor().SetPosition(.1, .1);
_scalarBarActor.Modified();
_scalarBarWidget.Modified();
No tags attached.
Issue History
2008-07-30 16:48Sarah MacumberNew Issue
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2015-10-27 23:41Cory QuammenNote Added: 0035399
2015-10-27 23:43Cory QuammenProject => TBD
2015-10-27 23:43Cory QuammenType => incorrect functionality
2015-10-27 23:43Cory QuammenStatusexpired => closed
2015-10-27 23:43Cory QuammenResolutionopen => no change required

Notes
(0035399)
Cory Quammen   
2015-10-27 23:41   
In the new widget/representation classes, the representation is responsible for controlling the size of the scalar bar. It, too, does not get the width, height, or position from the vtkScalarBarActor.