[vtkusers] Error in the visualisation of the lookuptable for my scalarbarwidget -> need help
Michael Dussere
dussere at labri.fr
Thu May 26 05:24:35 EDT 2005
Hi Stephan,
There is no big deal, you just need to call "Build()" on you lookup
table after configuring it.
// set the range
m_pLut->SetTableRange(0.0, 1.0);
// set hue range to full colorrange
m_pLut->SetHueRange(0.0, 1.0);
// building the lookup table
m_pLut->Build();
Michael
Franke, Stephan wrote:
> 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 <mailto:Stephan.Franke at inpro.de>
> Web: www.inpro.de <http://www.inpro.de/>
>
>
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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