[vtkusers] vtkContourFilter produces no data as its output

Rakesh Patil rakeshthp at in.com
Tue Jan 5 00:19:26 EST 2010


  Original message From:David Doria< daviddoria+vtk at gmail.com >Date: 04 Jan 10 19:10:45Subject:Re: [vtkusers] vtkContourFilter produces no data as its outputTo: rakeshthp at in.comOn Mon, Jan 4, 2010 at 8:14 AM, Bill Lorensenwrote:> 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 Patilwrote:>> 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(scatterdata); // scatterdata is an instance of vtkDoubleArray>> with three components>>>> unsigned int numids = scatterdata>GetNumberOfTuples();>>>> vtkPolyVertex *poly = vtkPolyVertex::New();>> poly>GetPointIds()>SetNumberOfIds(numids);>>>> for ( unsigned int i = 0; i < numids; i++ )>> poly>GetPointIds()>SetId(i,i);>>>> vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();>> ugrid>Allocate(1);>> ugrid>Ins
 ertNextCell (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 opensource projects at>> http://www.kitware.com/opensource/opensource.htm
 l>>>> Please keep messages ontopic and check the VTK FAQ at:>> http://www.vtk.org/Wiki/VTKFAQ>>As Bill said, the vtkContourFilter does this:http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html#detailsMaybe you can come up with a very simple data set and describe exactlywhat you are expecting to happen and maybe someone can point you to afilter that does what you're looking for.Thanks,DavidSee basically, i have afile containing lat, lon and depth/bathymetry values. I read them in the form x, y and zas a sample file, it looks like this:71.2632 18.2712 571.7762 18.6542 572.1262 18.2735 3.573.2123 19.6235 1071.2612 18.27565.573.1122 19.7625 10.........it goes upto thousands of lines like this... so, based on the z (depth/bathymetry) values, i need to display contours..So any ideas how to go about for this..?? 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100105/4395f7da/attachment.htm>


More information about the vtkusers mailing list