The VisualizationManager class is the central manager class of rviz, holding all the Displays, Tools, ViewControllers, and other managers. More...
#include <visualization_manager.h>
Signals | |
void | configChanged () |
Emitted whenever the display configuration changes. | |
void | preUpdate () |
Emitted before updating all Displays. | |
void | statusUpdate (const QString &message) |
Emitted during file-loading and initialization to indicate progress. | |
Public Member Functions | |
void | addDisplay (Display *display, bool enabled) |
Add a display to be managed by this panel. | |
Display * | createDisplay (const QString &class_lookup_name, const QString &name, bool enabled) |
Create and add a display to this panel, by class lookup name. | |
void | emitStatusUpdate (const QString &message) |
Emits statusUpdate() signal with the given message. | |
virtual uint32_t | getDefaultVisibilityBit () const |
virtual DisplayFactory * | getDisplayFactory () const |
Return a factory for creating Display subclasses based on a class id string. | |
PropertyTreeModel * | getDisplayTreeModel () const |
QString | getFixedFrame () const |
Return the fixed frame name. | |
uint64_t | getFrameCount () const |
Return the current value of the frame count. | |
FrameManager * | getFrameManager () const |
Return the FrameManager instance. | |
virtual QString | getHelpPath () const |
RenderPanel * | getRenderPanel () const |
Return the main RenderPanel. | |
virtual DisplayGroup * | getRootDisplayGroup () const |
double | getROSTime () |
Return the ROS time, in seconds. | |
double | getROSTimeElapsed () |
Return the ROS time in seconds since the last reset. | |
Ogre::SceneManager * | getSceneManager () const |
Returns the Ogre::SceneManager used for the main RenderPanel. | |
SelectionManager * | getSelectionManager () const |
Return a pointer to the SelectionManager. | |
tf::TransformListener * | getTFClient () const |
Convenience function: returns getFrameManager()->getTFClient(). | |
ros::CallbackQueueInterface * | getThreadedQueue () |
Return a CallbackQueue using a different thread than the main GUI one. | |
virtual ToolManager * | getToolManager () const |
Return a pointer to the ToolManager. | |
ros::CallbackQueueInterface * | getUpdateQueue () |
Return the CallbackQueue using the main GUI thread. | |
virtual ViewManager * | getViewManager () const |
Return a pointer to the ViewManager. | |
double | getWallClock () |
Return the wall clock time, in seconds since 1970. | |
double | getWallClockElapsed () |
Return the wall clock time in seconds since the last reset. | |
WindowManagerInterface * | getWindowManager () const |
Return the window manager, if any. | |
void | handleChar (QKeyEvent *event, RenderPanel *panel) |
Handle a single key event for a given RenderPanel. | |
void | handleMouseEvent (const ViewportMouseEvent &event) |
Handle a mouse event. | |
void | initialize () |
Do initialization that wasn't done in constructor. Initializes tool manager, view manager, selection manager. | |
void | load (const Config &config) |
Load the properties of each Display and most editable rviz data. | |
void | lockRender () |
Lock a mutex to delay calls to Ogre::Root::renderOneFrame(). | |
void | notifyConfigChanged () |
Notify this VisualizationManager that something about its display configuration has changed. | |
void | queueRender () |
Queues a render. Multiple calls before a render happens will only cause a single render. | |
void | removeAllDisplays () |
Remove and delete all displays. | |
void | resetTime () |
Resets the wall and ROS elapsed time to zero and calls resetDisplays(). | |
void | save (Config config) const |
Save the properties of each Display and most editable rviz data. | |
void | setFixedFrame (const QString &frame) |
Set the coordinate frame we should be transforming all fixed data into. | |
virtual void | setHelpPath (const QString &help_path) |
virtual void | setStatus (const QString &message) |
void | startUpdate () |
Start timers. Creates and starts the update and idle timers, both set to 30Hz (33ms). | |
void | stopUpdate () |
void | unlockRender () |
Unlock a mutex, allowing calls to Ogre::Root::renderOneFrame(). | |
virtual BitAllocator * | visibilityBits () |
VisualizationManager (RenderPanel *render_panel, WindowManagerInterface *wm=0, boost::shared_ptr< tf::TransformListener > tf=boost::shared_ptr< tf::TransformListener >()) | |
Constructor Creates managers and sets up global properties. | |
virtual | ~VisualizationManager () |
Destructor Stops update timers and destroys all displays, tools, and managers. | |
Protected Slots | |
void | onToolChanged (Tool *) |
void | onUpdate () |
Call update() on all managed objects. | |
Protected Member Functions | |
void | createColorMaterials () |
void | threadedQueueThreadFunc () |
void | updateFrames () |
void | updateTime () |
Protected Attributes | |
ColorProperty * | background_color_property_ |
PropertyTreeModel * | display_property_tree_model_ |
TfFrameProperty * | fixed_frame_property_ |
Frame to transform fixed data to. | |
IntProperty * | fps_property_ |
uint64_t | frame_count_ |
FrameManager * | frame_manager_ |
float | frame_update_timer_ |
Property * | global_options_ |
StatusList * | global_status_ |
ros::Time | last_update_ros_time_ |
Update stopwatch. Stores how long it's been since the last update. | |
ros::WallTime | last_update_wall_time_ |
OgreRenderQueueClearer * | ogre_render_queue_clearer_ |
Ogre::Root * | ogre_root_ |
Ogre Root. | |
RenderPanel * | render_panel_ |
uint32_t | render_requested_ |
DisplayGroup * | root_display_group_ |
ros::Time | ros_time_begin_ |
ros::Duration | ros_time_elapsed_ |
Ogre::SceneManager * | scene_manager_ |
Ogre scene manager associated with this panel. | |
SelectionManager * | selection_manager_ |
volatile bool | shutting_down_ |
float | time_update_timer_ |
ToolManager * | tool_manager_ |
QTimer * | update_timer_ |
Update timer. Display::update is called on each display whenever this timer fires. | |
ViewManager * | view_manager_ |
ros::WallTime | wall_clock_begin_ |
ros::WallDuration | wall_clock_elapsed_ |
WindowManagerInterface * | window_manager_ |
Private Slots | |
void | updateBackgroundColor () |
void | updateFixedFrame () |
void | updateFps () |
Private Attributes | |
uint32_t | default_visibility_bit_ |
Ogre::Light * | directional_light_ |
DisplayFactory * | display_factory_ |
QString | help_path_ |
VisualizationManagerPrivate * | private_ |
BitAllocator | visibility_bit_allocator_ |
The VisualizationManager class is the central manager class of rviz, holding all the Displays, Tools, ViewControllers, and other managers.
It keeps the current view controller for the main render window. It has a timer which calls update() on all the displays. It creates and holds pointers to the other manager objects: SelectionManager, FrameManager, the PropertyManager s, and Ogre::SceneManager.
The "protected" members should probably all be "private", as VisualizationManager is not intended to be subclassed.
Definition at line 99 of file visualization_manager.h.
rviz::VisualizationManager::VisualizationManager | ( | RenderPanel * | render_panel, |
WindowManagerInterface * | wm = 0 , |
||
boost::shared_ptr< tf::TransformListener > | tf = boost::shared_ptr<tf::TransformListener>() |
||
) |
Constructor Creates managers and sets up global properties.
render_panel | a pointer to the main render panel widget of the app. |
wm | a pointer to the window manager (which is really just a VisualizationFrame, the top-level container widget of rviz). |
tf | a pointer to tf::TransformListener which will be internally used by FrameManager. |
Definition at line 120 of file visualization_manager.cpp.
rviz::VisualizationManager::~VisualizationManager | ( | ) | [virtual] |
Destructor Stops update timers and destroys all displays, tools, and managers.
Definition at line 204 of file visualization_manager.cpp.
void rviz::VisualizationManager::addDisplay | ( | Display * | display, |
bool | enabled | ||
) |
Add a display to be managed by this panel.
display | The display to be added |
Definition at line 434 of file visualization_manager.cpp.
void rviz::VisualizationManager::configChanged | ( | ) | [signal] |
Emitted whenever the display configuration changes.
void rviz::VisualizationManager::createColorMaterials | ( | ) | [protected] |
Definition at line 288 of file visualization_manager.cpp.
Display * rviz::VisualizationManager::createDisplay | ( | const QString & | class_lookup_name, |
const QString & | name, | ||
bool | enabled | ||
) |
Create and add a display to this panel, by class lookup name.
class_lookup_name | "lookup name" of the Display subclass, for pluginlib. Should be of the form "packagename/displaynameofclass", like "rviz/Image". |
name | The name of this display instance shown on the GUI, like "Left arm camera". |
enabled | Whether to start enabled |
Definition at line 474 of file visualization_manager.cpp.
void rviz::VisualizationManager::emitStatusUpdate | ( | const QString & | message | ) |
Emits statusUpdate() signal with the given message.
Definition at line 446 of file visualization_manager.cpp.
virtual uint32_t rviz::VisualizationManager::getDefaultVisibilityBit | ( | ) | const [inline, virtual] |
Implements rviz::DisplayContext.
Definition at line 310 of file visualization_manager.h.
virtual DisplayFactory* rviz::VisualizationManager::getDisplayFactory | ( | ) | const [inline, virtual] |
Return a factory for creating Display subclasses based on a class id string.
Implements rviz::DisplayContext.
Definition at line 301 of file visualization_manager.h.
PropertyTreeModel* rviz::VisualizationManager::getDisplayTreeModel | ( | ) | const [inline] |
Definition at line 303 of file visualization_manager.h.
QString rviz::VisualizationManager::getFixedFrame | ( | ) | const [virtual] |
Return the fixed frame name.
Implements rviz::DisplayContext.
Definition at line 590 of file visualization_manager.cpp.
uint64_t rviz::VisualizationManager::getFrameCount | ( | ) | const [inline, virtual] |
Return the current value of the frame count.
The frame count is just a number which increments each time a frame is rendered. This lets clients check if a new frame has been rendered since the last time they did something.
Implements rviz::DisplayContext.
Definition at line 294 of file visualization_manager.h.
FrameManager* rviz::VisualizationManager::getFrameManager | ( | ) | const [inline, virtual] |
Return the FrameManager instance.
Implements rviz::DisplayContext.
Definition at line 287 of file visualization_manager.h.
virtual QString rviz::VisualizationManager::getHelpPath | ( | ) | const [inline, virtual] |
Definition at line 317 of file visualization_manager.h.
RenderPanel* rviz::VisualizationManager::getRenderPanel | ( | ) | const [inline] |
Return the main RenderPanel.
Definition at line 199 of file visualization_manager.h.
virtual DisplayGroup* rviz::VisualizationManager::getRootDisplayGroup | ( | ) | const [inline, virtual] |
Implements rviz::DisplayContext.
Definition at line 308 of file visualization_manager.h.
double rviz::VisualizationManager::getROSTime | ( | ) |
Return the ROS time, in seconds.
Definition at line 491 of file visualization_manager.cpp.
Return the ROS time in seconds since the last reset.
Definition at line 501 of file visualization_manager.cpp.
Ogre::SceneManager* rviz::VisualizationManager::getSceneManager | ( | ) | const [inline, virtual] |
Returns the Ogre::SceneManager used for the main RenderPanel.
Implements rviz::DisplayContext.
Definition at line 194 of file visualization_manager.h.
SelectionManager* rviz::VisualizationManager::getSelectionManager | ( | ) | const [inline, virtual] |
Return a pointer to the SelectionManager.
Implements rviz::DisplayContext.
Definition at line 247 of file visualization_manager.h.
tf::TransformListener * rviz::VisualizationManager::getTFClient | ( | ) | const [virtual] |
Convenience function: returns getFrameManager()->getTFClient().
Implements rviz::DisplayContext.
Definition at line 418 of file visualization_manager.cpp.
Return a CallbackQueue using a different thread than the main GUI one.
Implements rviz::DisplayContext.
Definition at line 244 of file visualization_manager.cpp.
virtual ToolManager* rviz::VisualizationManager::getToolManager | ( | ) | const [inline, virtual] |
Return a pointer to the ToolManager.
Implements rviz::DisplayContext.
Definition at line 250 of file visualization_manager.h.
Return the CallbackQueue using the main GUI thread.
Implements rviz::DisplayContext.
Definition at line 259 of file visualization_manager.cpp.
virtual ViewManager* rviz::VisualizationManager::getViewManager | ( | ) | const [inline, virtual] |
Return a pointer to the ViewManager.
Implements rviz::DisplayContext.
Definition at line 253 of file visualization_manager.h.
double rviz::VisualizationManager::getWallClock | ( | ) |
Return the wall clock time, in seconds since 1970.
Definition at line 486 of file visualization_manager.cpp.
Return the wall clock time in seconds since the last reset.
Definition at line 496 of file visualization_manager.cpp.
WindowManagerInterface* rviz::VisualizationManager::getWindowManager | ( | ) | const [inline, virtual] |
Return the window manager, if any.
Implements rviz::DisplayContext.
Definition at line 274 of file visualization_manager.h.
void rviz::VisualizationManager::handleChar | ( | QKeyEvent * | event, |
RenderPanel * | panel | ||
) | [virtual] |
Handle a single key event for a given RenderPanel.
If the key is Escape, switches to the default Tool (via getDefaultTool()). All other key events are passed to the current Tool (via getCurrentTool()).
Implements rviz::DisplayContext.
Definition at line 560 of file visualization_manager.cpp.
void rviz::VisualizationManager::handleMouseEvent | ( | const ViewportMouseEvent & | event | ) | [virtual] |
Handle a mouse event.
This just copies the given event into an event queue. The events in the queue are processed by onUpdate() which is called from the main thread by a timer every 33ms.
Implements rviz::DisplayContext.
Definition at line 521 of file visualization_manager.cpp.
Do initialization that wasn't done in constructor. Initializes tool manager, view manager, selection manager.
Definition at line 232 of file visualization_manager.cpp.
void rviz::VisualizationManager::load | ( | const Config & | config | ) |
Load the properties of each Display and most editable rviz data.
This is what is called when loading a "*.rviz" file.
config | The Config object to read from. Expected to be a Config::Map type. |
Definition at line 451 of file visualization_manager.cpp.
Lock a mutex to delay calls to Ogre::Root::renderOneFrame().
Definition at line 249 of file visualization_manager.cpp.
Notify this VisualizationManager that something about its display configuration has changed.
Definition at line 573 of file visualization_manager.cpp.
void rviz::VisualizationManager::onToolChanged | ( | Tool * | tool | ) | [protected, slot] |
Definition at line 578 of file visualization_manager.cpp.
void rviz::VisualizationManager::onUpdate | ( | ) | [protected, slot] |
Call update() on all managed objects.
This is the central place where update() is called on most rviz objects. Display objects, the FrameManager, the current ViewController, the SelectionManager, PropertyManager. Also calls ros::spinOnce(), so any callbacks on the global CallbackQueue get called from here as well.
It is called at 30Hz from the update timer.
Definition at line 305 of file visualization_manager.cpp.
void rviz::VisualizationManager::preUpdate | ( | ) | [signal] |
Emitted before updating all Displays.
void rviz::VisualizationManager::queueRender | ( | ) | [virtual] |
Queues a render. Multiple calls before a render happens will only cause a single render.
Implements rviz::DisplayContext.
Definition at line 300 of file visualization_manager.cpp.
Remove and delete all displays.
Definition at line 441 of file visualization_manager.cpp.
Resets the wall and ROS elapsed time to zero and calls resetDisplays().
Definition at line 423 of file visualization_manager.cpp.
void rviz::VisualizationManager::save | ( | Config | config | ) | const |
Save the properties of each Display and most editable rviz data.
This is what is called when saving a "*.vcg" file.
config | The object to write to. |
Definition at line 467 of file visualization_manager.cpp.
void rviz::VisualizationManager::setFixedFrame | ( | const QString & | frame | ) |
Set the coordinate frame we should be transforming all fixed data into.
frame | The name of the frame -- must match the frame name broadcast to libTF |
Definition at line 595 of file visualization_manager.cpp.
virtual void rviz::VisualizationManager::setHelpPath | ( | const QString & | help_path | ) | [inline, virtual] |
Definition at line 316 of file visualization_manager.h.
void rviz::VisualizationManager::setStatus | ( | const QString & | message | ) | [virtual] |
Set the message displayed in the status bar
Implements rviz::DisplayContext.
Definition at line 600 of file visualization_manager.cpp.
Start timers. Creates and starts the update and idle timers, both set to 30Hz (33ms).
Definition at line 264 of file visualization_manager.cpp.
void rviz::VisualizationManager::statusUpdate | ( | const QString & | message | ) | [signal] |
Emitted during file-loading and initialization to indicate progress.
Definition at line 270 of file visualization_manager.cpp.
void rviz::VisualizationManager::threadedQueueThreadFunc | ( | ) | [protected] |
Definition at line 565 of file visualization_manager.cpp.
Unlock a mutex, allowing calls to Ogre::Root::renderOneFrame().
Definition at line 254 of file visualization_manager.cpp.
void rviz::VisualizationManager::updateBackgroundColor | ( | ) | [private, slot] |
Definition at line 506 of file visualization_manager.cpp.
void rviz::VisualizationManager::updateFixedFrame | ( | ) | [private, slot] |
Definition at line 582 of file visualization_manager.cpp.
void rviz::VisualizationManager::updateFps | ( | ) | [private, slot] |
Definition at line 513 of file visualization_manager.cpp.
void rviz::VisualizationManager::updateFrames | ( | ) | [protected] |
Definition at line 388 of file visualization_manager.cpp.
void rviz::VisualizationManager::updateTime | ( | ) | [protected] |
Definition at line 371 of file visualization_manager.cpp.
virtual BitAllocator* rviz::VisualizationManager::visibilityBits | ( | ) | [inline, virtual] |
Implements rviz::DisplayContext.
Definition at line 312 of file visualization_manager.h.
Definition at line 379 of file visualization_manager.h.
uint32_t rviz::VisualizationManager::default_visibility_bit_ [private] |
Definition at line 403 of file visualization_manager.h.
Ogre::Light* rviz::VisualizationManager::directional_light_ [private] |
Definition at line 406 of file visualization_manager.h.
Definition at line 401 of file visualization_manager.h.
Definition at line 361 of file visualization_manager.h.
Frame to transform fixed data to.
Definition at line 368 of file visualization_manager.h.
IntProperty* rviz::VisualizationManager::fps_property_ [protected] |
Definition at line 370 of file visualization_manager.h.
uint64_t rviz::VisualizationManager::frame_count_ [protected] |
Definition at line 387 of file visualization_manager.h.
FrameManager* rviz::VisualizationManager::frame_manager_ [protected] |
Definition at line 391 of file visualization_manager.h.
float rviz::VisualizationManager::frame_update_timer_ [protected] |
Definition at line 382 of file visualization_manager.h.
Property* rviz::VisualizationManager::global_options_ [protected] |
Definition at line 367 of file visualization_manager.h.
StatusList* rviz::VisualizationManager::global_status_ [protected] |
Definition at line 369 of file visualization_manager.h.
QString rviz::VisualizationManager::help_path_ [private] |
Definition at line 405 of file visualization_manager.h.
Update stopwatch. Stores how long it's been since the last update.
Definition at line 356 of file visualization_manager.h.
Definition at line 357 of file visualization_manager.h.
Definition at line 393 of file visualization_manager.h.
Ogre::Root* rviz::VisualizationManager::ogre_root_ [protected] |
Ogre Root.
Definition at line 352 of file visualization_manager.h.
Definition at line 402 of file visualization_manager.h.
RenderPanel* rviz::VisualizationManager::render_panel_ [protected] |
Definition at line 372 of file visualization_manager.h.
uint32_t rviz::VisualizationManager::render_requested_ [protected] |
Definition at line 386 of file visualization_manager.h.
Definition at line 362 of file visualization_manager.h.
ros::Time rviz::VisualizationManager::ros_time_begin_ [protected] |
Definition at line 375 of file visualization_manager.h.
Definition at line 377 of file visualization_manager.h.
Ogre::SceneManager* rviz::VisualizationManager::scene_manager_ [protected] |
Ogre scene manager associated with this panel.
Definition at line 353 of file visualization_manager.h.
Definition at line 384 of file visualization_manager.h.
volatile bool rviz::VisualizationManager::shutting_down_ [protected] |
Definition at line 359 of file visualization_manager.h.
float rviz::VisualizationManager::time_update_timer_ [protected] |
Definition at line 381 of file visualization_manager.h.
ToolManager* rviz::VisualizationManager::tool_manager_ [protected] |
Definition at line 364 of file visualization_manager.h.
QTimer* rviz::VisualizationManager::update_timer_ [protected] |
Update timer. Display::update is called on each display whenever this timer fires.
Definition at line 355 of file visualization_manager.h.
ViewManager* rviz::VisualizationManager::view_manager_ [protected] |
Definition at line 365 of file visualization_manager.h.
Definition at line 404 of file visualization_manager.h.
Definition at line 374 of file visualization_manager.h.
Definition at line 376 of file visualization_manager.h.
Definition at line 389 of file visualization_manager.h.