Try a vtkAssignAttribute filter before the contour filter.<div><br></div><div>vtkAssignAttribute assignFilter = vtkAssignAttribute::New();</div><div>assignFilter->SetInput(sGrid);</div><div>assignFilter->Assign( {your scalar array name}, vtkDataSetAttributes::Scalars, vtkAssignAttribute::CELL_DATA);</div>
<div><br></div><div>...</div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, sans-serif; ">scalarIsoSurface->SetInputConnection(assginFilter->GetOutputPort() );</span></div><div><br><br><div class="gmail_quote">
On Fri, Mar 5, 2010 at 6:41 AM, Sebastian Gatzka <span dir="ltr"><<a href="mailto:sebastian.gatzka@stud.tu-darmstadt.de">sebastian.gatzka@stud.tu-darmstadt.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hello.<br>
<br>
I really can't tell why my code is not gernerating the iso-surface.<br>
I have a structured grid (sGrid) filled with scalars.<br>
<br>
I call the contour filter<br>
<br>
vtkContourFilter *scalarIsoSurface =
vtkContourFilter::New();<br>
scalarIsoSurface->SetInput(sGrid);<br>
scalarIsoSurface->GenerateValues(0,0.1);<br>
<br>
Compute the normal<br>
<br>
vtkPolyDataNormals *sGridPolyDataNormal =
vtkPolyDataNormals::New();<br>
sGridPolyDataNormal->SetInput(scalarIsoSurface->GetOutput());<br>
<br>
Put them into a poly data mapper<br>
<br>
vtkPolyDataMapper *scalarIsoSurfaceMapper =
vtkPolyDataMapper::New();<br>
scalarIsoSurfaceMapper->SetInput(sGridPolyDataNormal->GetOutput());<br>
<br>
and into an actor<br>
<br>
vtkActor *scalarIsoSurfaceActor = vtkActor::New();<br>
scalarIsoSurfaceActor->SetMapper(scalarIsoSurfaceMapper);<br>
<br>
which is passed on to the scene<br>
<br>
ren1->AddActor(scalarIsoSurfaceActor);<br>
<br>
and NOTHING happens.<br>
<br>
Any ideas what I have missed, or whats wrong?<br>
<br>
Sebastian<br>
</font></font>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>