[vtkusers] Turning Auto Rescaling Off on vtkActor2D

Gerrick Bivins gbivins at objectreservoir.com
Wed Jul 30 13:15:33 EDT 2008


Interesting...What version of VTK are you using?

Can you interact with the widget at all?

I'm on cvs(vtk 5.3) using java wrappers. I quickly added the scalarbarwidget
to the my existing code, and it behaved as expected. It comes up correctly
sized and I can resize, drag etc.
...
sbw = new vtkScalarBarWidget();
sbw.SetScalarBarActor(scalarbar);
sbw.SetInteractor(iren);
sbw.On();
...

Gerrick



On 7/30/08 10:13 AM, "Sarah Macumber" <S.Macumber at QuestReliability.com>
wrote:

> Hi Gerrick,
>  
> The issue was "relative to the window" .  SetWidth and SetHeight set the
> position as a fraction of the viewport
> and not as an absolute size so that when the window resizes so does the scalar
> bar.  Ideally I would just like
> to set a minimum size so that the scalar bar never becomes illegible but that
> doesn't seem possible.
>  
> Currently I am trying to use the ScalarBarWidget to give the user control over
> resizing it when it becomes too
> small.  The problem with that is that when I use the Widget I loose control
> over setting its width, height and position
> and it begins as a square in the bottom right corner no matter that the
> ScalarBarActor attached to the Widget is set
> correctly.
>  
> Thanks Gerrick,
> Sarah
> 
> ________________________________
> 
> From: vtkusers-bounces at vtk.org on behalf of Gerrick Bivins
> Sent: Wed 7/30/2008 9:05 AM
> To: vtkusers at vtk.org
> Subject: Re: [vtkusers] Turning Auto Rescaling Off on vtkActor2D
> 
> 
> 
> 
> Hi Sarah,
> How is your vtkScalarBarActor set up? At what point does it become
> unreadable? Can you provide a screen cap of the problem. I'm using
> vtkScalarBarActor w/o issues when resizing my window.
> 
> Here is my setup:
>         scalarbar = new vtkScalarBarActor();
>         scalarbar.SetOrientationToHorizontal();
>       
> scalarbar.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport();
>         scalarbar.GetPositionCoordinate().SetValue(.2,.05);
>        
>         scalarbar.SetWidth( 0.7 );
>         scalarbar.SetHeight( 0.1 );
>         scalarbar.SetPosition( 0.1, 0.01 );
>         scalarbar.SetLabelFormat("%-#6.3f");
>         scalarbar.GetTitleTextProperty().SetFontFamilyToArial();
>         scalarbar.GetTitleTextProperty().SetFontSize( 12 );
>         scalarbar.GetLabelTextProperty().SetFontFamilyToArial();
>         scalarbar.GetLabelTextProperty().SetFontSize(10);
>         scalarbar.GetLabelTextProperty().SetJustificationToCentered();
> 
> This keeps it placed at the bottom of my window with all of it's properties
> (width,height,position) relative to the window.
> Gerrick
> 
> 
> Sarah Macumber wrote:
>> 
>> Is there any way to turn off the auto rescaling of the vtkActor2D which
>> happens when the window changes sizes? Specifically I am trying to keep a
>> vtkScalarBarActor from becoming illegible.  It would be nice if I could
>> set a minimum size & font but a fixed size would do as well.  I looked at
>> the code for a vtkActor2D and I am not sure how one would turn the auto
>> scaling off.
>> 
>> Thanks Sarah
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/Turning-Auto-Rescaling-Off-on-vtkActor2D-tp18715272p1873
> 4015.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 




More information about the vtkusers mailing list