[vtkusers] vtkOBBTree vs. vtkCellLocator

Goodwin Lawlor goodwin.lawlor at ucd.ie
Mon Nov 17 15:56:35 EST 2003


Hi Mike,

You could use vtkGeometryFilter to convert your ugrid to polydata and set
this as the dataset in vtkOBBTree. This isn't the end of your problems-
FindClosestPoint will crash anyway from vtkOBBTree.

The problem occurs because vtkCellLocator defines "vtkIdList **Tree" whereas
vtkOBBTree defines "vtkOBBNode *Tree". FindClosestPoint() expects "vtkIdList
**Tree" and crashes in GetBucketNeighbours() when it doesn't get it from a
vtkOBBTree object.

Basically, FindClosestPoint is for use only with vtkCellLocator... if you
want to uses it with vtkOBBTree you'd have to add a FindClosestPoint method
to that class (which uses the vtkOBBNode data structure).

HTH

Goodwin
University College Dublin

> From: "M. Campopiano" <lost_bits1110 at hotmail.com>
> To: vtkusers at vtk.org
> Date: Fri, 14 Nov 2003 18:20:09 +0000
> Subject: [vtkusers] vtkOBBTree vs. vtkCellLocator
>
> Hello again,
>
> So I was able to use vtkCellLocator using the following:
>
> celllocator->SetDataSet(ugrid);
> celllocator->BuildLocator();
> celllocator->FindClosestPoint(x, closestpoint, cellid, subid, dist);
>
> And now I invoke the EXACT same methods with vtkOBBTree but it crashes at
> BuildLocator()..?????
>
> obbtree->SetDataSet(ugrid);
> obbtree->BuildLocator(); //CRASHES HERE!!!!!!!!!!!!!?????
> obbtree->FindClosestPoint(xobb, closestpointobb, cellidobb, subidobb,
> distobb);
>
> Can anyone tell me why it works for the CellLocator and not for the
> OBBTree?? Its the exact same thing.. Note that my unstructured grid
contains
> quadratic tetra's
>
> Thanks
> Mike




More information about the vtkusers mailing list