<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>I'm a begginner in vtk!</DIV>
<DIV>I try to read a vtk file wich contains a structured grid and some data for each cell (I define it as a scalar). I try to read everything with vtkDataSetReader but only the grid appears in blue...???...</DIV>
<DIV>I would like to see the surface of each cell with a different color according to the value of the scalar...</DIV>
<DIV>I'll copy my code and an extract of the vtk file...If someone can help me, I'll appreciate...I'm blocked on this problem...Any help or suggestion is welcome!</DIV>
<DIV>Thank you!</DIV>
<DIV> </DIV>
<DIV>Code:</DIV>
<DIV>
<DIV> </DIV>
<DIV> //read the .vtk file<BR> vtkDataSetReader *reader = vtkDataSetReader::New();<BR> reader->SetFileName("vtkdatas.vtk");<BR> reader->Update();</DIV>
<DIV> </DIV>
<DIV> // Set up a lookup table for coloring<BR> vtkLookupTable *lut = vtkLookupTable::New();<BR> lut->SetNumberOfColors(256);<BR> lut->SetHueRange(0.67,0.0);<BR> lut->Build();</DIV>
<DIV> </DIV>
<DIV> //convert data set from reader into graphics primitives<BR> vtkDataSetMapper *Mapper = vtkDataSetMapper::New();<BR> Mapper->SetInput( (vtkDataSet *) reader->GetOutput());</DIV>
<DIV> </DIV>
<DIV> //actor<BR> vtkActor *Actor = vtkActor::New();<BR> Actor->SetMapper(Mapper);<BR> Actor->GetProperty()->SetRepresentationToWireframe();</DIV>
<DIV> </DIV>
<DIV> //convert data set from reader into graphics primitives<BR> vtkDataSetMapper *Mapper2 = vtkDataSetMapper::New();<BR> Mapper2->SetInput( (vtkDataSet *) reader->GetOutput()); </DIV>
<DIV> Mapper2->ScalarVisibilityOn();</DIV>
<DIV> </DIV>
<DIV> //actor<BR> vtkActor *Actor2 = vtkActor::New();<BR> Actor2->SetMapper(Mapper2);<BR> Actor2->GetProperty()->SetRepresentationToWireframe();</DIV>
<DIV> </DIV>
<DIV> //renderer and render window<BR> vtkRenderer *ren = vtkRenderer::New();<BR> ren -> SetBackground(1, 1, 1);<BR> vtkRenderWindow *renWin = vtkRenderWindow::New();<BR> renWin -> SetSize( 400, 400 );<BR> renWin->AddRenderer( ren );<BR> ren->AddActor(Actor); </DIV>
<DIV> </DIV>
<DIV> vtkRenderer *ren2 = vtkRenderer::New();<BR> ren2 -> SetBackground(0, 0, 0);<BR> vtkRenderWindow *renWin2 = vtkRenderWindow::New();<BR> renWin2 -> SetSize( 400, 400 );<BR> renWin2->AddRenderer( ren2 );<BR> ren2->AddActor(Actor2); </DIV>
<DIV><BR> </DIV></DIV>
<DIV>VTK file:</DIV>
<DIV><BR> </DIV>
<DIV># vtk DataFile Version 1.0<BR>Grid datas<BR>ASCII<BR> <BR>DATASET STRUCTURED_GRID<BR>DIMENSIONS 101 101 2<BR>POINTS 20402 float<BR> 0.0000000E+00 0.0000000E+00 0.0000000E+00<BR> 7.5757573E-04 0.0000000E+00 0.0000000E+00<BR> 1.5151515E-03 0.0000000E+00 0.0000000E+00<BR>......</DIV>
<DIV> <BR>POINT_DATA 20402<BR>SCALARS pressure float<BR>LOOKUP_TABLE default<BR> 101325.2 <BR> 101325.2 <BR> 101325.0 <BR></DIV><p>
                <hr size=1>
Découvrez le nouveau Yahoo! Mail : <font color="red">250 Mo d'espace</font> de stockage pour vos mails !<br><a href="http://us.rd.yahoo.com/mail_fr/mail_campaigns/splash/taglines_250/default/*http://fr.promotions.yahoo.com/mail/creer28.html" target="_blank">Créez votre Yahoo! Mail</a>