<DIV>Hello,</DIV>
<DIV>&nbsp;</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&nbsp;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>&nbsp;</DIV>
<DIV>Code:</DIV>
<DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//read the .vtk file<BR>&nbsp;&nbsp;&nbsp; vtkDataSetReader *reader = vtkDataSetReader::New();<BR>&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName("vtkdatas.vtk");<BR>&nbsp;reader-&gt;Update();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; // Set up a lookup table for coloring<BR>&nbsp;&nbsp;&nbsp; vtkLookupTable *lut = vtkLookupTable::New();<BR>&nbsp;&nbsp;&nbsp; lut-&gt;SetNumberOfColors(256);<BR>&nbsp;&nbsp;&nbsp; lut-&gt;SetHueRange(0.67,0.0);<BR>&nbsp;&nbsp;&nbsp; lut-&gt;Build();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//convert data set from reader into graphics primitives<BR>&nbsp;vtkDataSetMapper *Mapper = vtkDataSetMapper::New();<BR>&nbsp;&nbsp;&nbsp; Mapper-&gt;SetInput(&nbsp; (vtkDataSet *) reader-&gt;GetOutput());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//actor<BR>&nbsp;&nbsp;&nbsp; vtkActor *Actor = vtkActor::New();<BR>&nbsp;&nbsp;&nbsp; Actor-&gt;SetMapper(Mapper);<BR>&nbsp;&nbsp;&nbsp; Actor-&gt;GetProperty()-&gt;SetRepresentationToWireframe();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//convert data set from reader into graphics primitives<BR>&nbsp;vtkDataSetMapper *Mapper2 = vtkDataSetMapper::New();<BR>&nbsp;&nbsp;&nbsp; Mapper2-&gt;SetInput(&nbsp; (vtkDataSet *) reader-&gt;GetOutput());&nbsp;</DIV>
<DIV>&nbsp;&nbsp; &nbsp;Mapper2-&gt;ScalarVisibilityOn();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//actor<BR>&nbsp;&nbsp;&nbsp; vtkActor *Actor2 = vtkActor::New();<BR>&nbsp;&nbsp;&nbsp; Actor2-&gt;SetMapper(Mapper2);<BR>&nbsp;&nbsp;&nbsp; Actor2-&gt;GetProperty()-&gt;SetRepresentationToWireframe();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; //renderer and render window<BR>&nbsp;vtkRenderer *ren = vtkRenderer::New();<BR>&nbsp;ren -&gt; SetBackground(1, 1, 1);<BR>&nbsp;vtkRenderWindow *renWin = vtkRenderWindow::New();<BR>&nbsp;renWin -&gt; SetSize( 400, 400 );<BR>&nbsp;renWin-&gt;AddRenderer( ren );<BR>&nbsp;ren-&gt;AddActor(Actor);&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;vtkRenderer *ren2 = vtkRenderer::New();<BR>&nbsp;ren2 -&gt; SetBackground(0, 0, 0);<BR>&nbsp;vtkRenderWindow *renWin2 = vtkRenderWindow::New();<BR>&nbsp;renWin2 -&gt; SetSize( 400, 400 );<BR>&nbsp;renWin2-&gt;AddRenderer( ren2 );<BR>&nbsp;ren2-&gt;AddActor(Actor2); </DIV>
<DIV><BR>&nbsp;</DIV></DIV>
<DIV>VTK file:</DIV>
<DIV><BR>&nbsp;</DIV>
<DIV># vtk DataFile Version 1.0<BR>Grid datas<BR>ASCII<BR>&nbsp;<BR>DATASET STRUCTURED_GRID<BR>DIMENSIONS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2<BR>POINTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20402 float<BR>&nbsp; 0.0000000E+00&nbsp; 0.0000000E+00&nbsp; 0.0000000E+00<BR>&nbsp; 7.5757573E-04&nbsp; 0.0000000E+00&nbsp; 0.0000000E+00<BR>&nbsp; 1.5151515E-03&nbsp; 0.0000000E+00&nbsp; 0.0000000E+00<BR>......</DIV>
<DIV>&nbsp;<BR>POINT_DATA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20402<BR>SCALARS pressure float<BR>LOOKUP_TABLE default<BR>&nbsp;&nbsp; 101325.2&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; 101325.2&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp; 101325.0&nbsp;&nbsp;&nbsp; <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>