[vtkusers] vtkPropPicker question... possible bug??

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


Ok, I might have found a bug with the vtkPropPicker class or maybe something
is missing from my code.

I have moved my cursor actor with the code:

m_actor->SetPosition(x, y);

However, when I click on the bottom left corner of my view, so basically
around (0, 0) then it picks the cursor! Even though, on my screen it is at
another position! Surely this is a bug???

Cheers,

Anja

On 03/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
>
> 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/4d063a2a/attachment.htm>


More information about the vtkusers mailing list