[vtkusers] vtkContourFilter not working on vtkStructuredGrid
da
frinxor at gmail.com
Thu Mar 11 10:51:21 EST 2010
Try a vtkAssignAttribute filter before the contour filter.
vtkAssignAttribute assignFilter = vtkAssignAttribute::New();
assignFilter->SetInput(sGrid);
assignFilter->Assign( {your scalar array name},
vtkDataSetAttributes::Scalars, vtkAssignAttribute::CELL_DATA);
...
scalarIsoSurface->SetInputConnection(assginFilter->GetOutputPort() );
On Fri, Mar 5, 2010 at 6:41 AM, Sebastian Gatzka <
sebastian.gatzka at stud.tu-darmstadt.de> wrote:
> Hello.
>
> I really can't tell why my code is not gernerating the iso-surface.
> I have a structured grid (sGrid) filled with scalars.
>
> I call the contour filter
>
> vtkContourFilter *scalarIsoSurface = vtkContourFilter::New();
> scalarIsoSurface->SetInput(sGrid);
> scalarIsoSurface->GenerateValues(0,0.1);
>
> Compute the normal
>
> vtkPolyDataNormals *sGridPolyDataNormal =
> vtkPolyDataNormals::New();
> sGridPolyDataNormal->SetInput(scalarIsoSurface->GetOutput());
>
> Put them into a poly data mapper
>
> vtkPolyDataMapper *scalarIsoSurfaceMapper =
> vtkPolyDataMapper::New();
>
> scalarIsoSurfaceMapper->SetInput(sGridPolyDataNormal->GetOutput());
>
> and into an actor
>
> vtkActor *scalarIsoSurfaceActor = vtkActor::New();
> scalarIsoSurfaceActor->SetMapper(scalarIsoSurfaceMapper);
>
> which is passed on to the scene
>
> ren1->AddActor(scalarIsoSurfaceActor);
>
> and NOTHING happens.
>
> Any ideas what I have missed, or whats wrong?
>
> Sebastian
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100311/7f3174e5/attachment.htm>
More information about the vtkusers
mailing list