ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Get main RenderPanel from Display

asked 2016-08-18 15:55:52 -0500

StefanFabian gravatar image

Hey,

I need to grab a pointer to rviz main RenderPanel - the one that renders the scene - from a Display plugin.
I've managed to grab a RenderPanel but in some cases there are more than one and I haven't found a way to identify them yet.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-27 15:46:58 -0500

StefanFabian gravatar image

Okay, I just accidentally found out how to get it while searching for a way to get the ViewController.
You get it as follows:

Your class should have a DisplayContext property called context_*.
Through this property we can access the ViewManager by calling context_->getViewManager() that can give us a reference to the RenderPanel by calling getRenderPanel().

So in short to grab the RenderPanel you simply call:

rviz::RenderPanel* panel = context_->getViewManager()->getRenderPanel();

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-18 15:55:52 -0500

Seen: 426 times

Last updated: Aug 27 '16