[vtkusers] Pop up vtkBalloonWidget

lvyb lvyb20829 at gmail.com
Sat Nov 19 23:53:34 EST 2011


Hi all,

I'm trying to pop up a vtkBalloonWidget in my window , but it doesn't work ,
Here is some pieces of my code, my actor is a line passed to a mapper and
then to an actor, any clues about where it goes wrong?
Thanks! 

this->view = vtkSmartPointer<vtkGraphLayoutView>::New();
this->view->GetInteractor()->RemoveObservers(vtkCommand::RightButtonPressEvent);
this->view->GetInteractor()->RemoveObservers(vtkCommand::RightButtonReleaseEvent);
this->view->GetInteractor()->RemoveObservers(vtkCommand::KeyPressEvent);
this->view->GetInteractor()->RemoveObservers(vtkCommand::KeyReleaseEvent);
this->view->GetInteractor()->AddObserver(vtkCommand::RightButtonPressEvent,
selectionCallback2);
this->view->GetInteractor()->AddObserver(vtkCommand::RightButtonReleaseEvent,
selectionCallback3);
this->view->GetInteractor()->AddObserver(vtkCommand::KeyPressEvent,
this->keyPress);

vtkSmartPointer<vtkBalloonRepresentation> balloonRep =
    vtkSmartPointer<vtkBalloonRepresentation>::New();
balloonRep->SetBalloonLayoutToImageRight();
 
vtkSmartPointer<vtkBalloonWidget> balloonWidget =
    vtkSmartPointer<vtkBalloonWidget>::New();
balloonWidget->SetInteractor(renderWindowInteractor);
balloonWidget->SetRepresentation(balloonRep);
balloonWidget->AddBalloon(actor,
                            "This is a ballon",NULL);

this->view->GetRenderer()->AddActor(actor);
this->view->Render();
balloonWidget->EnabledOn();
this->view->GetInteractor()->Start();






--
View this message in context: http://vtk.1045678.n5.nabble.com/Pop-up-vtkBalloonWidget-tp5007802p5007802.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list