[vtkusers] vtkPointPicker: Pick always returns false in 64-bit mode (VTK 5.10 built with MSVC 2010 x64)

Sebastian Schäfer hel800 at gmx.de
Fri Oct 5 06:04:04 EDT 2012


AGAIN IN Plain text, sorry:

Hi everybody,

I have a very specific problem concerning a vtkPointPicker with VTK 5.10
build for x64 (MSVC 2010). I have two classes involved:

class: MyInteractorStyle
     - reacts on a LeftMouseButtonDown and delivers the coordinates the
user has clicked

class: ImageViewer
     - holds a vtkImageViewer2 instance for displaying images
     - sets the interactor style of the vtkRenderWindowInteractor
retrieved from a QVTKWidget to MyInteractorStyle
     - assigns a vtkPointPicker to vtkRenderWindowInteractor of the
QVTKWidget

-----------------------------------------------------
code snippets from ImageViewer:

this->vtkimageviewer2->SetupInteractor(m_ui->qvtkwidget->GetRenderWindow()->GetInteractor());
m_ui->qvtkwidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(this->myinteractorStyle);
m_ui->qvtkwidget->GetRenderWindow()->GetInteractor()->SetPicker(this->vtkpointpicker);

-----------------------------------------------------
code snippets from MyInteractorStyle:

void MyInteractorStyle::OnLeftButtonDown() {

vtkRenderWindowInteractor*rwi=this->Interactor;
vtkPointPicker*pPicker=reinterpret_cast<vtkPointPicker*>(rwi->GetPicker());

if(pPicker->Pick(rwi->GetEventPosition()[0], rwi->GetEventPosition()[1],
0, this->vtkimageviewer2->GetRenderer()))
{
     doubleptMapped[3];
     intcoords[3];
     pPicker->GetMapperPosition(ptMapped);
     ...
}

}
-----------------------------------------------------

Now, all this works perfectly fine when using VTK 5.10 built in 32-bit
mode (MSVC 2010 for x86). However, when the application is build using
MSVC 2010 for 64-bit the Pick function of the vtkPointPicker always
returns false! The reason for this is may be that vtkAssemblyPath
(this->Path) is not set (is Null) in Pick of vtkPicker class which is
not the case for 32-bit. I'm not that familiar with VTK that I know what
the AssemblyPath is exactly for and how this could be caused.

Does anybody have an idea what could be the reason for that? Is it
probably a bug which appears in 64-bit mode only? I'd be very happy
about a guess or ideas what I can try else.
Thank you very much.

  -Sebastian

-- 
===================================================
Dipl. Ing. Sebastian Schäfer
Institut für Simulation und Graphik
Universität Magdeburg
Universitätsplatz 2
39106 Magdeburg, Germany

Tel.   +49 (0)391 67 51441
Fax.   +49 (0)391 67 11164
Emailschaefer at isg.cs.uni-magdeburg.de
http://isgwww.cs.uni-magdeburg.de/isg/schaefer.html
===================================================




More information about the vtkusers mailing list