[vtkusers] FindAndGetCell ?!

Amy Henderson amy.henderson at kitware.com
Tue Nov 6 17:21:28 EST 2001


At 02:06 PM 11/6/2001 -0800, Terence Lim wrote:
>Hi vtkusers,
>
>I am looking for a way to get the cellid of a cell (triangle type) that
>contains an inputted point.  This point is not a vertex of any of the
>triangles, it is a point which may be contained by the boundaries of the
>vertices.  I have tried the FindAndGetCell method but i must be doing
>something wrong because the returned cellid is always 0 regardless of what
>the input point is. i am absolutely sure that the coordinates of this input
>point is actually contained within a cell in my mesh. What am I doing wrong?
>
>float tester[3], pcoords[3], *weights;
>float tol2 = 0;
>tester[0] = 100;                //x coordinate of the point
>tester[1] = 10;         //y coordinate of the point
>tester[2] = 5;          //z coordinate of the point
>int cellid= 0;
>int subId= 0;
>vtkTriangle *tri = vtkTriangle::New();
>vtkCell *testcell =
>Delaunay->GetOutput()->FindAndGetCell(tester,tri,cellid,tol2,subId,pcoords,w
>eights);
>cout<<"The cellid of the cell that contains this point is: "<<cellid<<endl;
>//this always returns 0

FindAndGetCell does not modify the input parameter, cellid.  You set it to 
0, so that's the value you're seeing.  FindAndGetCell returns the vtkCell 
that contains the point you specified.  If you need to get the cell id, use 
FindCell instead.

- Amy


>Any suggestions would be greatly appreciated.
>
>Thanks,
>
>Terence Lim
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list