[vtkusers] Picking problems

Mark Gooding mark.gooding at gmail.com
Thu Sep 28 07:23:33 EDT 2006


Hi all,

Sadly, unlike the subject suggests, we don't seem to get to pick our
problems. They just happen to us. Anyway...

1.) I'm getting an access violations when using the standard "p" to
pick object. Everything works fine when I am only displaying
vtkImageActors, but it crashes when I am trying to pick vtkActors
derived using from images using thresholds & fast marching etc. The
crash doesn't occur consistently, in that I can sometimes pick the
actor, but sometime get a crash immediately. Repeatedly picking at the
same point will cause the crash to occur eventually, normally occuring
within a couple of pick actions.

The access violation generally occurs in
vtkAssemblyPath::GetLastNode() when doing "return (vtkAssemblyNode
*)(this->Bottom->Item);", although sometimes it occurs in
vtkRenderer::PickGeometry() when doing "prop =
this->PathArray[i]->GetLastNode()->GetViewProp();".

I'm guessing it is something that I've done wrong, since nobody appear
to have reported this problem before (although it sounds similar to
Anja Ende's point picking question from the beginning of the month).
But I have no idea where to begin trying to solve this problem, since
the error is occuring within the vtk code rather than in my code (I
almost know what my own code does, but the inner workings of vtk are
magic!!). Any suggestions/help would be very welcome.


2.) I asked this earlier this month with no response, so I thought I'd
try again. I have some separate code to pick points on my
vtkImageActors (which doesn't crash). For orthogonal imageActors
planes derived directly from the structured point data using the
actor->setDisplayExtent the point picked is on the plane, as I want.
However an oblique imageActor plane created using vtkImageReslice, the
point picked isn't on the plane, neither does it seem to relate to the
boundaries of the structuredData, or those boundaries displayed when
the plane is picked using "p". The code I'm using to do the picking is
triggered by a mouse click event and is as follows:

if(picker->Pick(self->pvtkMFCWindow->GetInteractor()->GetEventPosition()[0],self->pvtkMFCWindow->GetInteractor()->GetEventPosition()[1],0,self->pvtkRenderer)>0){
	picker->GetPickPosition(pts);
}

I'd welcome suggestions as to how I can get points picked on the
plane, rather than the
seemingly-random-but-probably-has-some-basis-to-it point that is being
returned currently.

Cheers,

Mark



More information about the vtkusers mailing list