[vtkusers] vtkScalarBarActor Problem
David D. Marshall
gte552m at prism.gatech.edu
Fri Jul 14 11:27:44 EDT 2000
I want to render my data using grey scale (as opposed to colors). That
works by calling vtkMapper::SetColorModeToLuminance() on the data
mapper. The problem is that I also want a legend for the grey scale
data. What I've been doing to synch. the mapper and the
vtkScalarBarActor was getting the mapper's lookup table and passing it
to the scalar bar actor. When I do this with for the grey scale
rendering, the scalar bar is still in color :(. I hacked a way to call
SetColorMode() on the scalar bar actor's scalar bar mapper, but what
results is a bar that is half black and half dark grey. Here's a code
snippet:
// initialize mapper code removed
pMapper->SetColorModeToLuminance();
// initialize scalar bar code removed
pScalarBar->SetLookupTable(pMapper->GetLookupTable());
// I made this function up myself
pScalarBar->SetColorModeToLuminance();
// rest of code removed
and here's the change to vtkScalarBarActor.cpp (h just has prototype and
convienence methods to set mode to specific mode):
void vtkScalarBar::SetColorMode(int colorMode)
{
if (ScalarBarMapper != 0)
ScalarBarMapper->SetColorMode(colorMode);
}
What else can I try?
--
David D. Marshall
ARTLab System Administrator/GRA
Georgia Institute of Technology, Atlanta Georgia, 30332
http://www.ae.gatech.edu/research/artlab/artl/artlab.html
mailto:gte552m at prism.gatech.edu
think: Why anonymity is good
http://www.cato.org/pubs/briefs/bp-054es.html
More information about the vtkusers
mailing list