[vtkusers] Error in the visualisation of the lookuptable for my scalarbarwidget -> need help

Franke, Stephan Stephan.Franke at inpro.de
Thu May 26 04:26:52 EDT 2005


Hi,
 
I need your help. I use for my application the vtkScalarBarWidget to map
scalar values on colour values. When I initialize my lookuptable I get the colour 
gradient shown in the attached picture. What I expect is a black coloured 
lookuptable but that's not the case. I get at the beginning of the lookuptable this fracment of red.
My Initroutine looks like this. Someone has a hint for me what I am doing wrong?
Thanks for your help.
 
void Colortable::InitLookupTable()
{
    // generate for the first time a black/white lookuptable for the colortable
    m_pLut = vtkLookupTable::New();
    if(m_pLut == NULL)
        // TODO error message
        return;
 
    // set the range 
    m_pLut->SetTableRange(0.0, 1.0);
    // set hue range to full colorrange
    m_pLut->SetHueRange(0.0, 1.0);
    // set full saturation (0=white)
    //m_pLut->SetSaturationRange(0.0, 1.0);
    // set the range on some brightness (0=black)
    //m_pLut->SetValueRange(0.0, 1.0);
 
    // set the lookuptable
    m_pBar->GetScalarBarActor()->SetLookupTable(m_pLut);
    
    // set the title of the colortable
    m_pBar->GetScalarBarActor()->SetTitle("EMPTY");
 
    // set the sizes for the colortable
    m_pBar->GetScalarBarActor()->SetHeight(0.08);
    m_pBar->GetScalarBarActor()->SetWidth(0.5);
    //m_pBar->GetScalarBarActor()->SetLabelFormat("%6.0f");
    m_pBar->GetScalarBarActor()->SetMaximumNumberOfColors(20);
 
    // set position inside the rendering window and the orientation of the table
    //m_pBar->GetScalarBarActor()->GetPositionCoordinate()->SetValue(0.05, 0.01);
    m_pBar->GetScalarBarActor()->GetPositionCoordinate()->
        SetCoordinateSystemToNormalizedViewport();
    m_pBar->GetScalarBarActor()->GetPositionCoordinate()->
        SetValue(0.25, 0.01);
    m_pBar->GetScalarBarActor()->SetOrientationToHorizontal();
 
    // assign the colortable to the rendering window
    m_pBar->SetInteractor(m_pDocument->GetRenderWindow()->GetInteractor());
}
 
Dipl. Ing.  Stephan Franke
Virtuelles Prototyping (VPT)

INPRO Innovationsgesellschaft für 
fortgeschrittene Produktionssysteme 
in der Fahrzeugindustrie mbH 
Hallerstraße 1, D-10587 Berlin 

Telefon:  +49 (0)30 399 97-278
Fax:         +49 (0)30 399 97-117 
E-Mail:     Stephan.Franke at inpro.de 
Web:        www.inpro.de <http://www.inpro.de/> 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050526/ba510d3d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScalarBarColorBug.jpg
Type: image/jpeg
Size: 4606 bytes
Desc: ScalarBarColorBug.jpg
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050526/ba510d3d/attachment.jpg>


More information about the vtkusers mailing list