[vtkusers] Observer for vtkActors?

Adrian Wyssmann wyssa1 at hta-bi.bfh.ch
Wed Nov 17 10:28:36 EST 2004


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




More information about the vtkusers mailing list