[vtkusers] VtkSphereWidget unable to handle the right or left click...

Adeline Joliet adeline_joli at hotmail.com
Thu Mar 4 06:29:51 EST 2010


Hi vtk users,


I need some help with the vtkSphereWidget. I managed to use it but now I need to detect when the Left Button is released (or pressed whatever)
SO i did something like that: 


 sphereCallback = vtkSphereCallback::New();

  sphereCallback->m_myClass= this;

  m_lineWidget->GetSphereSource ()->AddObserver(vtkCommand::LeftButtonReleaseEvent,sphereCallback);



where vtkSPhereCallBack is


class vtkSphereCallback : public vtkCommand
{
      public:
        static vtkSphereCallback *New()
      {
           return new vtkSphereCallback;
      }
 
      virtual void Execute(vtkObject *caller, unsigned long, void*)
     { 
 		  }

    
    }
   vtkSphereCallback():m_myClass(0){}
   MyClass  * m_myClass;
 
};





But It doesn't work... the callback is not called when I release the the left button on the sphere... BUT if if put vtkCommand::InteractionEvent
instead of vtkCommand::LeftButtonReleaseEvent in this case it works .. ! the callback is called... but now it will be called for everything.. but still not for the mouse click unclick...
Even if I put " if (vtkCommand::LeftButtonReleaseEvent) {} " in the Execute function...




Does someone has any Idea why ?,


Regards,
Adeline



    

 		 	   		  
_________________________________________________________________
Découvrez comment SURFER DISCRETEMENT sur un site de rencontres !
http://clk.atdmt.com/FRM/go/206608211/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100304/d0085691/attachment.htm>


More information about the vtkusers mailing list