[vtkusers] vtkPropPicker question

Anja Ende anja.ende at googlemail.com
Tue Oct 3 07:03:07 EDT 2006


Hi everyone,

I have a renderer that has 2 actors as follows:

this->m_renderer->AddActor(this->m_actor2D);
this->m_renderer->AddActor(m_cursor.GetActor());

Now, I am trying to pick this cursor actor on mouse clicks as follows:

// This code is in vtkInteractorStyleImage based class...

int x = this->Interactor->GetEventPosition()[0];
int y = this->Interactor->GetEventPosition()[1];
this->FindPokedRenderer(x, y);

if (this->CurrentRenderer == NULL)
    return;

vtkPropPicker * picker = vtkPropPicker::New();
if (picker->PickProp(x, y, this->CurrentRenderer))
{
       vtkProp * prop = picker->GetViewProp();
       std::cout << prop << ":  " << m_viewer->m_cursor.GetActor() << ":  "
<< m_viewer->m_actor2D << std::endl;

}
picker->Delete();


Now no matter where I click, on the cursor image or on the underlying image,
I always seem to pick the bottom image and never the cursor image. Is it
possible to actually layer these objects somehow and pick the top most one
or something like that...

Cheers,
Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061003/edff3bce/attachment.htm>


More information about the vtkusers mailing list