[vtkusers] Observer for vtkActors?

Sean McInerney seanm at nmr.mgh.harvard.edu
Thu Nov 18 15:31:24 EST 2004


Hi Adrian,

   vtkActor never fires a LeftButtonPressEvent which can be passed to 
its Observers. I think that the only events that you can catch from 
vtkActor are DeleteEvent, ModifiedEvent, and PickEvent ... obviously, 
the closest to your needs is PickEvent. Maybe a VTK Subject-Observer 
guru could expand on this.

Good luck!

-Sean

Adrian Wyssmann wrote:
> Hi all
> 
> I have a vtkRenderWindowInteractor on which I add some Observers. The events
> are caught by the p3DSegmentCallback, which does the excepted action.
> 
> vtkRenderWindowInteractor *pInteractor =
> m_pRenderWindow->MakeRenderWindowInteractor();
> pInteractor->AddObserver(vtkCommand::LeftButtonPressEvent,
> p3DSegmentCallback);
> 
> 
> But now I only want that the action is only performed by clicking on a
> specific vtkActor. My idea was like that:
> 
> m_pActorVolume1 = vtkActor::New();
> ....
> //don't know if the next 2 lines are needed
> m_pActorVolume1->SetPickable(TRUE);
> m_pActorVolume1->SetDragable(TRUE
> 
> 
> //here I want to caught the action
> m_pActorVolume1->AddObserver(vtkCommand::LeftButtonPressEvent,
> p3DSegmentCallback);
> 
> 
> This doesn't work. When I click the left mouse nothing happens. Can anyone
> help me?
> 
> Thanks in advance
> 
> Adrian
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://www.vtk.org/Wiki/VTK_FAQ>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list