[vtkusers] vtkScalarBarWidget

rashedk rashed.vtk at googlemail.com
Tue Jun 1 11:52:41 EDT 2010


Hi Guillaume

If I may put my two-cents to your problem: I will relate to you some
experience of me trying to do something similar. In my case, I was
displaying the scalars (of my polydata) and using the scalarbarwidget to
show a color-to-scalar legend. In order to this, I was using a
vtkpolydatamapper for drawing my polydata. The polydatamapper's
setscalarrange function required a max and min scalar value. Also a
vtklookuptable had to be used. Finally, the scalarbarwidget required the
lookuptable to be specified. The scalarbarwidget in these circumstances
seems to inherit the max and min scalars of the polydatamapper. Thus, in
short, your bar-widget displays scalars within the *range* specified in your
polydatamapper. 

Some excerpts of my code: 

polydataMapper->SetScalarRange(minScalar, maxScalar); 
lookuptable->SetHueRange(0.0, minHue);
lookuptable->Build();
polydataMapper->SetLookupTable(lookuptable); 
mypolydataactor->SetMapper(polydataMapper); 
scalarBarWidget->SetLookupTable(lookuptable);

Hope this helps, 

Rashed. 


Karthik Krishnan-2 wrote:
> 
> Take a look at the API of vtkScalarBarActor. If that's not enough, perhaps
> you want to subclass it and put in your modifications.
> 
> On Tue, Jun 1, 2010 at 8:35 PM, Guillaume DARDENNE <
> guillaume.dardenne at ostesys.com> wrote:
> 
>>  Hi Vtk users,
>>
>>
>>
>> I’m using the vtkScalarBarWidget in order to visualize a distance map.
>>
>> I would like to modify the scalars annotation along this bar, how can I
>> do
>> that ?
>>
>>
>> Actually, I would like to display some perso values.
>>
>>
>>
>> Thanks for your answer,
>>
>>
>>
>> Guillaume DARDENNE
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK 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://old.nabble.com/Re%3A-vtkScalarBarWidget-tp28743426p28743919.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list