[vtkusers] vtkContourFilter produces no data as its output

Bill Lorensen bill.lorensen at gmail.com
Mon Jan 4 08:14:44 EST 2010


ContourFilter produces isosurfaces from the scalar data in a dataset.
Your unstructured grid has no scalar data as far as I can see.


On Mon, Jan 4, 2010 at 4:56 AM, Rakesh Patil <rakeshthp at in.com> wrote:
> Hello there
>
> After debugging for a long time, i found out that data exists till this part
> of code
>
>
> vtkPoints *pts = vtkPoints::New();
> pts->SetData(scatter_data); // scatter_data is an instance of vtkDoubleArray
> with three components
>
> unsigned int num_ids = scatter_data->GetNumberOfTuples();
>
> vtkPolyVertex *poly = vtkPolyVertex::New();
> poly->GetPointIds()->SetNumberOfIds(num_ids);
>
> for ( unsigned int i = 0; i < num_ids; i++ )
> poly->GetPointIds()->SetId(i,i);
>
> vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();
> ugrid->Allocate(1);
> ugrid->InsertNextCell (poly->GetCellType(), poly->GetP ointIds());
> ugrid->SetPoints(pts);
>
> vtkDelaunay2D *del = vtkDelaunay2D::New();
> del->SetInput(ugrid);
> del->SetTolerance(0.001);
>
> Once i execute, the following code,
>
> vtkContourFilter *cf = vtkContourFilter::New();
> cf-&g t;SetInputConnection(del->GetOutputPort());
> cf->GenerateValues(10, -5, 20);
> cf->Update();
>
> all data vanishes..
>
> I mean to say that, initially, the grid had, 22,000 points.. After
> traingulating, i got 20000 of cells..
>
> But after executing the contour filter class, i get 0 cells and 0 points as
> output.. Where the data disappears all of a sudden, i'm not able to
> understand.. Please i need a guidance from the most experienced and senior
> person.. My mind is totally blank..
>
> Thanks in advance
>
>
>
> Dear vtkusers ! Get Yourself a cool, short @in.com Email ID now!
> _______________________________________________
> 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
>
>



More information about the vtkusers mailing list