[vtkusers] vtkDelaunay2D closes application automatically

rakesh patil prakeshofficial at gmail.com
Tue Sep 13 06:15:38 EDT 2011


Hello,

I am facing problem with vtkDelaunay2D object. Here is the code what I have
used to display unconnected points as a scattered points.

vtkPoints *pnts = vtkPoints::New();
pnts->SetNumberOfPoints(num);

vtkDoubleArray *scalar = vtkDoubleArray::New();
scalar->SetNumberOfTuples(num);

vtkCellArray *pVertex = vtkCellArray::New();


for (vtkIdType i = 0; i < num; i++)
{
   readFile >> xval >> yval >> zval;
   pnts->InsertPoint(i, xval, yval, 0);
   scalar->InsertTuple1(i, zval);
   pVertex->InsertNextCell(1, &i);
}

vtkPolyData *pd = vtkPolyData::New();
pd->SetPoints(pnts);
pd->SetVerts(pVertex);
pd->GetPointData()->SetScalars(scalar);

vtkDelaunay2D *del = vtkDelaunay2D::New();
del->SetInput(pd);
del->SetTolerance(0.00001);
del->Update();

vtkPolyDataMapper *mapp = vtkPolyDataMapper::New();
mapp->SetInputConnection( del->GetOutputPort() );
mapp->ScalarVisibilityOn();

vtkActor *actor = vtkActor::New();
actor->SetMapper(mapp);
actor->GetProperty()->SetColor(1, 0, 0);
actor->GetProperty()->SetPointSize(3);

renderer->AddActor(actor);

For one particular data, my application closes automatically without
producing any message. To check what exactly happens, I designed a very
small application which only reads the data file and displays the points. I
used same code mentioned above in both application. But in the new
application, even though it takes time, it works without any problem. But
the same code, doesn't work in my main application. Since the data size is
120MB (~37lakhs points), I cannot attach it here.

I did google search to find out to get any clue for such behavior. I got
this link which is not exactly a solution for my problem

http://vtk.1045678.n5.nabble.com/Delaunay2D-infinite-recursion-td1255389.html

Therefore, I just made a copy of vtkDelaunay2D and started debugging it in
my main application. While debugging, I found that after certain number of
iterations, it enters in FindTriangle function from RequestData function.
And somewhere in FindTriangle it crashes of closes. I saw in the stack, all
FindTriangle function calls. So I felt it's the same case as it is mentioned
in the link above.

Is there any solution for this problem? The strangest and wierdest thing is
the same dataset gets loaded in one application and doesnt gets loaded in
another with same code and on the same machine.

Any clue or idea or solutions are welcome.

Thanks in advance

Warm Regards
Rakesh Patil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110913/18916c3c/attachment.htm>


More information about the vtkusers mailing list