Help with vtkCellLocator

Audrius Stundzia adv_biologic at hotmail.com
Tue Mar 21 11:45:47 EST 2000


Dear vtker's,

I not having any success in locating a cell (any cell!) in a
surface described by a vtkPolyData set "myPolyData" where I've loaded points 
and vertices via SetPoints() and SetVerts(). I display the (closed) surface 
so I know where a line should intersect

Below is a code fragment

   float firstPoint[_3D];
   float secondPoint[_3D];

   firstPoint[X] = 0.0;
   firstPoint[Y] = 0.0;
   firstPoint[Z] = 0.0;

   secondPoint[X] = 200.0;
   secondPoint[Y] = 200.0;
   secondPoint[Z] = 200.0;

   float tolerance = 100.0;

   float t;

   float intersectionPoint[_3D];
   float pointCoords[_3D];

   int subID;

   int pickedCellID;

   myCellLocator = vtkCellLocator::New();
   myCellLocator->SetDataSet( myPolyData);
   myCellLocator->AutomaticOn();
   myCellLocator->CacheCellBoundsOn();
   myCellLocator->SetTolerance( tolerance);
   myCellLocator->BuildLocator();

   pickedCellID
   = myCellLocator->IntersectWithLine( firstPoint
                                     , secondPoint
                                     , tolerance
                                     , t
                                     , intersectionPoint
                                     , pointCoords
                                     , subID );

What is the meaning of t and subID. What is the difference
between the returned (?) arrays pointCoords and intersectionPoint?

t, subID, and pickedCellID are returned as 0 irrespective of
my choice of intersecting line and tolerance.
What am I goofing up?

Any help would be most appreciated. Thanks.

Regards,

Audrius


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list