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

Anja Ende anja.ende at googlemail.com
Tue Oct 3 16:19:43 EDT 2006


Ok, further search indicates that the picking does not work when the
vtkActor2D is used with the vtkImageMapper. Then it only works of the pick
coordinates are in the range of (0, 0, width, height).

Has anyone found a ay to work around this?

Thanks,
Anja

On 03/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
>
> Oops. Forgot the link there:
>
> http://public.kitware.com/pipermail/vtkusers/2004-October/077010.html
>
> On 03/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
> >
> > Looks like another person had the same problem.
> >
> > However, that thread has no further replies :((( but this is the exact
> > behavior that I am experiencing.
> >
> > Any experts here who have successfully implemented picking on 2D actors
> > that are rendered on top of each other?
> >
> > Cheers,
> > Anja
> >
> > On 03/10/06, Anja Ende < anja.ende at googlemail.com> wrote:
> > >
> > > Here is the PrintSelf() output of the actor 2D that I am trying to
> > > pick. Maybe this will give someone a hint as to why it gets picked at (0, 0)
> > > instead of (238.5,209,0)
> > >
> > >  Debug: Off
> > >  Modified Time: 5308
> > >  Reference Count: 2
> > >  Registered Events: (none)
> > >  Dragable: On
> > >  Pickable: On
> > >  AllocatedRenderTime: 5000
> > >  EstimatedRenderTime: 0
> > >  NumberOfConsumers: 1
> > >  RenderTimeMultiplier: 0.001
> > >  Visibility: On
> > >  Layer Number: 0
> > >
> > >  PositionCoordinate: 0xa7f650
> > >    Debug: Off
> > >    Modified Time: 4850
> > >    Reference Count: 2
> > >    Registered Events: (none)
> > >    Coordinate System: Viewport
> > >    Value: (238.5,209,0)
> > >    ReferenceCoordinate: (none)
> > >    Viewport: (none)
> > >
> > >  Position2 Coordinate: 0xa97ae0
> > >    Debug: Off
> > >    Modified Time: 228
> > >    Reference Count: 1
> > >    Registered Events: (none)
> > >    Coordinate System: Normalized Viewport
> > >    Value: ( 0.5,0.5,0)
> > >    ReferenceCoordinate: 0xa7f650
> > >    Viewport: (none)
> > >
> > >  Property: 0xac0f80
> > >    Debug: Off
> > >    Modified Time: 5307
> > >    Reference Count: 1
> > >    Registered Events: (none)
> > >    Opacity: 1
> > >    Color: (1, 1, 1)
> > >    Point size: 1
> > >    Line width: 1
> > >    Line stipple pattern: 65535
> > >    Line stipple repeat factor: 1
> > >    Display location: foreground
> > >
> > >  Mapper: 0xa96980
> > >    Debug: Off
> > >    Modified Time: 221
> > >    Reference Count: 3
> > >    Registered Events: (none)
> > >    Executive: 0xa973a0
> > >    ErrorCode: Success
> > >    Information: 0xa96b00
> > >    AbortExecute: Off
> > >    Progress: 0
> > >    Progress Text: (None)
> > >    TimeToDraw: 0
> > >    ClippingPlanes: (none)
> > >    Color Window: 255
> > >    Color Level: 127.5
> > >    ZSlice: 0
> > >    RenderToRectangle: 0
> > >    UseCustomExtents: 0
> > >    CustomDisplayExtents: 0 0 0 0
> > >
> > >
> > > Thanks,
> > > Anja
> > >
> > >
> > > On 03/10/06, Anja Ende <anja.ende at googlemail.com> wrote:
> > > >
> > > > 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/140a0912/attachment.htm>


More information about the vtkusers mailing list