[vtkusers] Simple queries
John Platt
jcplatt at dsl.pipex.com
Mon Jan 22 05:11:20 EST 2007
Hi,
Have you tried using vtkCellPicker in your interactor?
vtCellPicker* cellPicker = vtkCellPicker::New();
myInteractor->SetPicker(cellPicker);
cellPicker->Delete();
Then add observers for the standard pick event (P key)
vtkCallbackCommand* pickEventCBC = vtkCallbackCommand::New();
pickEventCBC->SetCallback(MyPickEventHandler );
vtkAbstractPicker* picker = myInteractor->GetPicker();
picker->AddObserver( vtkCommand::StartPickEvent, pickEventCBC, 0.5 );
picker->AddObserver( vtkCommand::PickEvent, pickEventCBC, 0.5
);
picker->AddObserver( vtkCommand::EndPickEvent, pickEventCBC, 0.5 );
pickEventCBC->Delete();
Do your work in MyPickEventHandler() e.g.
pickedCell = picker->GetCellId();
HTH
John.
-----Original Message-----
From: vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org
[mailto:vtkusers-bounces+jcplatt=dsl.pipex.com at vtk.org] On Behalf Of
Oliver Diessel
Sent: 22 January 2007 07:41
To: vtkusers at vtk.org
Subject: [vtkusers] Simple queries
Hi Everybody,
I am quite new in VTK.I have some queries.I have got
a point on the surface of an object.I want to know the cell id which
contains the point and I also want to know the normal of the cell ( Is
there any difference between point normal and cell normal?)
Thanks everyone in advance.
Oliver.
Send instant messages to your online friends
http://au.messenger.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070122/d816eb2f/attachment.htm>
More information about the vtkusers
mailing list