[vtkusers] help vtkPropPicker
    Luis Alberto Pereira 
    l.a.pereira at uol.com.br
       
    Mon Jan  3 08:53:36 EST 2005
    
    
  
I'm having  dificult  with vtkPropPicker. I'm not getting an apropriate
sensibility on WM_MOUSEMOVE event in WinProc in view class.
I just get actor in winProc after press "p" over any actor in view and not
when the WM_MOUSEMOVE is invoked.
I would like obtain the same effect off key pressed "p", but in WM_MOUSEMOVE
event moment.
Cam someone help me ?
 
My code in cview class is:
 
a) Constructor method:
 
this->iren                       = vtkWin32RenderWindowInteractor::New();
this->irenStyle               = vtkInteractorStyleTrackballCamera::New();
this->iren->SetInteractorStyle(irenStyle);
this->picker                   = vtkPropPicker::New();
iren->SetPicker(picker);
 
b) WinProc method:
 
vtkActor  *actor = NULL;
int x = 0;
int y = 0; 
switch (message)
{
            case WM_LBUTTONDOWN: 
            case WM_LBUTTONUP: 
            case WM_MBUTTONDOWN: 
            case WM_MBUTTONUP: 
            case WM_RBUTTONDOWN: 
            case WM_RBUTTONUP: 
            case WM_MOUSEMOVE:
                        actor = (vtkActor*) ((vtkPropPicker*)
this->iren->GetPicker())->GetProp();
                        if (actor != NULL)
                            actor->GetProperty()->SetColor(1.0, 0.0, 0.0);
            case WM_CHAR:
            case WM_TIMER:
                       if (this->iren->GetInitialized())
                       {
                         return vtkHandleMessage2(this->GetSafeHwnd(),
message, wParam, lParam, this->iren);
                        }
                        break;
            }
            return CView::WindowProc(message, wParam, lParam);
}
 
Thanks,
 
Luis Alberto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050103/61751cac/attachment.htm>
    
    
More information about the vtkusers
mailing list