[vtkusers] vtkContourFilter not working on vtkStructuredGrid
David Doria
daviddoria+vtk at gmail.com
Fri Mar 5 08:56:03 EST 2010
On Fri, Mar 5, 2010 at 8: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
>
>
You probably have a call to Render() after the code you sent us, which I
believe updates the whole pipeline. Whenever I have something that is
totally empty, I go back and put an Update() call on every object that is
updatable.
scalarIsoSurface->GenerateValues(0,0.1);
scalarIsoSurface->Update();
before I dig too deep.
If that doesn't change anything, try to create a demo involving some simple
data (using a vtk*Source if you can, so we can reproduce it without needing
your dataset). Then send us the smallest compilable code that demonstrates
the problem.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100305/6a674fbb/attachment.htm>
More information about the vtkusers
mailing list