[vtkusers] vtkPicker Accuracy

jose manjon jmanjon at fis.upv.es
Thu Mar 20 14:55:31 EST 2003


I am trying to move a cutting plane over a volume using vtkPicker for 
mouse interaction over the plane.

I find the plane and I am able to move it but when I click near the 
plane (not over the plane!) plane is selected and  dont know why!

I am tried to set the tolerance to a very small value but maybe this is 
not correct.

what I am doing wrong?

thanks

jose

the code:

LRESULT CVolumeView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
  CMainFrame * papa=(CMainFrame *) AfxGetMainWnd();
  C3DFrame * frame = (C3DFrame*) papa->MDIGetActive();   

  switch (message)
  {
  //case WM_PAINT:
  case WM_LBUTTONDOWN:   if(message==WM_LBUTTONDOWN)
                         {
                           if(cutting && (giro || traslacion))
                           {
                             pulsado=true;
                             inipoint=lParam;
                             
                             vtkPicker * picker=vtkPicker::New();
                             picker->SetTolerance(0.000001);
                             int 
val=picker->Pick(inipoint.x,inipoint.y,0,this->Renderer);
                             if(val!=0)
                             {                               
                                vtkActorCollection* 
col=picker->GetActors();
                                vtkActor *actor=col->GetLastActor();
                                if(actor!=NULL)  focus=true;            
                 
                             }

....................................
}

////////////////////////////////////////////////////////////////

-- 
##########################################################

         Prof.  Jose Vicente Manjón Herrera

         Dept. Fisica Aplicada
         Escuela Universitaria de Informatica
         Universidad Politécnica de Valencia (SPAIN)           

##########################################################






More information about the vtkusers mailing list