Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Slots | Private Attributes | List of all members
rviz::VisualizationManager Class Reference

The VisualizationManager class is the central manager class of rviz, holding all the Displays, Tools, ViewControllers, and other managers. More...

#include <visualization_manager.h>

Inheritance diagram for rviz::VisualizationManager:
Inheritance graph
[legend]

Signals

void configChanged ()
 Emitted whenever the display configuration changes. More...
 
void preUpdate ()
 Emitted before updating all Displays. More...
 
void statusUpdate (const QString &message)
 Emitted during file-loading and initialization to indicate progress. More...
 

Public Member Functions

void addDisplay (Display *display, bool enabled)
 Add a display to be managed by this panel. More...
 
DisplaycreateDisplay (const QString &class_lookup_name, const QString &name, bool enabled)
 Create and add a display to this panel, by class lookup name. More...
 
void emitStatusUpdate (const QString &message)
 Emits statusUpdate() signal with the given message. More...
 
virtual uint32_t getDefaultVisibilityBit () const
 
virtual DisplayFactorygetDisplayFactory () const
 Return a factory for creating Display subclasses based on a class id string. More...
 
PropertyTreeModelgetDisplayTreeModel () const
 
QString getFixedFrame () const
 Return the fixed frame name. More...
 
uint64_t getFrameCount () const
 Return the current value of the frame count. More...
 
FrameManagergetFrameManager () const
 Return the FrameManager instance. More...
 
virtual QString getHelpPath () const
 
RenderPanelgetRenderPanel () const
 Return the main RenderPanel. More...
 
virtual DisplayGroupgetRootDisplayGroup () const
 
double getROSTime ()
 Return the ROS time, in seconds. More...
 
double getROSTimeElapsed ()
 Return the ROS time in seconds since the last reset. More...
 
Ogre::SceneManager * getSceneManager () const
 Returns the Ogre::SceneManager used for the main RenderPanel. More...
 
SelectionManagergetSelectionManager () const
 Return a pointer to the SelectionManager. More...
 
tf::TransformListenergetTFClient () const
 Convenience function: returns getFrameManager()->getTFClient(). More...
 
ros::CallbackQueueInterfacegetThreadedQueue ()
 Return a CallbackQueue using a different thread than the main GUI one. More...
 
virtual ToolManagergetToolManager () const
 Return a pointer to the ToolManager. More...
 
ros::CallbackQueueInterfacegetUpdateQueue ()
 Return the CallbackQueue using the main GUI thread. More...
 
virtual ViewManagergetViewManager () const
 Return a pointer to the ViewManager. More...
 
double getWallClock ()
 Return the wall clock time, in seconds since 1970. More...
 
double getWallClockElapsed ()
 Return the wall clock time in seconds since the last reset. More...
 
WindowManagerInterfacegetWindowManager () const
 Return the window manager, if any. More...
 
void handleChar (QKeyEvent *event, RenderPanel *panel)
 Handle a single key event for a given RenderPanel. More...
 
void handleMouseEvent (const ViewportMouseEvent &event)
 Handle a mouse event. More...
 
void initialize ()
 Do initialization that wasn't done in constructor. Initializes tool manager, view manager, selection manager. More...
 
void load (const Config &config)
 Load the properties of each Display and most editable rviz data. More...
 
void lockRender ()
 Lock a mutex to delay calls to Ogre::Root::renderOneFrame(). More...
 
void notifyConfigChanged ()
 Notify this VisualizationManager that something about its display configuration has changed. More...
 
void queueRender ()
 Queues a render. Multiple calls before a render happens will only cause a single render. More...
 
void removeAllDisplays ()
 Remove and delete all displays. More...
 
void resetTime ()
 Resets the wall and ROS elapsed time to zero and calls resetDisplays(). More...
 
void save (Config config) const
 Save the properties of each Display and most editable rviz data. More...
 
void setFixedFrame (const QString &frame)
 Set the coordinate frame we should be transforming all fixed data into. More...
 
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). More...
 
void stopUpdate ()
 
void unlockRender ()
 Unlock a mutex, allowing calls to Ogre::Root::renderOneFrame(). More...
 
virtual BitAllocatorvisibilityBits ()
 
 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. More...
 
virtual ~VisualizationManager ()
 Destructor Stops update timers and destroys all displays, tools, and managers. More...
 

Protected Slots

void onToolChanged (Tool *)
 
void onUpdate ()
 Call update() on all managed objects. More...
 

Protected Member Functions

void createColorMaterials ()
 
void threadedQueueThreadFunc ()
 
void updateFrames ()
 
void updateTime ()
 

Protected Attributes

ColorPropertybackground_color_property_
 
BoolPropertydefault_light_enabled_property_
 
PropertyTreeModeldisplay_property_tree_model_
 
TfFramePropertyfixed_frame_property_
 Frame to transform fixed data to. More...
 
IntPropertyfps_property_
 
uint64_t frame_count_
 
FrameManagerframe_manager_
 
float frame_update_timer_
 
Propertyglobal_options_
 
StatusListglobal_status_
 
ros::Time last_update_ros_time_
 Update stopwatch. Stores how long it's been since the last update. More...
 
ros::WallTime last_update_wall_time_
 
OgreRenderQueueClearerogre_render_queue_clearer_
 
Ogre::Root * ogre_root_
 Ogre Root. More...
 
RenderPanelrender_panel_
 
uint32_t render_requested_
 
DisplayGrouproot_display_group_
 
ros::Time ros_time_begin_
 
ros::Duration ros_time_elapsed_
 
Ogre::SceneManager * scene_manager_
 Ogre scene manager associated with this panel. More...
 
SelectionManagerselection_manager_
 
volatile bool shutting_down_
 
float time_update_timer_
 
ToolManagertool_manager_
 
QTimer * update_timer_
 Update timer. Display::update is called on each display whenever this timer fires. More...
 
ViewManagerview_manager_
 
ros::WallTime wall_clock_begin_
 
ros::WallDuration wall_clock_elapsed_
 
WindowManagerInterfacewindow_manager_
 

Private Slots

void updateBackgroundColor ()
 
void updateDefaultLightVisible ()
 
void updateFixedFrame ()
 
void updateFps ()
 

Private Attributes

uint32_t default_visibility_bit_
 
Ogre::Light * directional_light_
 
DisplayFactorydisplay_factory_
 
QString help_path_
 
VisualizationManagerPrivateprivate_
 
BitAllocator visibility_bit_allocator_
 

Additional Inherited Members

- Public Slots inherited from rviz::DisplayContext

Detailed Description

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 100 of file visualization_manager.h.

Constructor & Destructor Documentation

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.

Parameters
render_panela pointer to the main render panel widget of the app.
wma pointer to the window manager (which is really just a VisualizationFrame, the top-level container widget of rviz).
tfa 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 208 of file visualization_manager.cpp.

Member Function Documentation

void rviz::VisualizationManager::addDisplay ( Display display,
bool  enabled 
)

Add a display to be managed by this panel.

Parameters
displayThe display to be added

Definition at line 438 of file visualization_manager.cpp.

void rviz::VisualizationManager::configChanged ( )
signal

Emitted whenever the display configuration changes.

void rviz::VisualizationManager::createColorMaterials ( )
protected

Definition at line 292 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.

Parameters
class_lookup_name"lookup name" of the Display subclass, for pluginlib. Should be of the form "packagename/displaynameofclass", like "rviz/Image".
nameThe name of this display instance shown on the GUI, like "Left arm camera".
enabledWhether to start enabled
Returns
A pointer to the new display.

Definition at line 478 of file visualization_manager.cpp.

void rviz::VisualizationManager::emitStatusUpdate ( const QString &  message)

Emits statusUpdate() signal with the given message.

Definition at line 450 of file visualization_manager.cpp.

virtual uint32_t rviz::VisualizationManager::getDefaultVisibilityBit ( ) const
inlinevirtual

Implements rviz::DisplayContext.

Definition at line 311 of file visualization_manager.h.

virtual DisplayFactory* rviz::VisualizationManager::getDisplayFactory ( ) const
inlinevirtual

Return a factory for creating Display subclasses based on a class id string.

Implements rviz::DisplayContext.

Definition at line 302 of file visualization_manager.h.

PropertyTreeModel* rviz::VisualizationManager::getDisplayTreeModel ( ) const
inline

Definition at line 304 of file visualization_manager.h.

QString rviz::VisualizationManager::getFixedFrame ( ) const
virtual

Return the fixed frame name.

See also
setFixedFrame()

Implements rviz::DisplayContext.

Definition at line 599 of file visualization_manager.cpp.

uint64_t rviz::VisualizationManager::getFrameCount ( ) const
inlinevirtual

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 295 of file visualization_manager.h.

FrameManager* rviz::VisualizationManager::getFrameManager ( ) const
inlinevirtual

Return the FrameManager instance.

Implements rviz::DisplayContext.

Definition at line 288 of file visualization_manager.h.

virtual QString rviz::VisualizationManager::getHelpPath ( ) const
inlinevirtual

Definition at line 318 of file visualization_manager.h.

RenderPanel* rviz::VisualizationManager::getRenderPanel ( ) const
inline

Return the main RenderPanel.

Definition at line 200 of file visualization_manager.h.

virtual DisplayGroup* rviz::VisualizationManager::getRootDisplayGroup ( ) const
inlinevirtual

Implements rviz::DisplayContext.

Definition at line 309 of file visualization_manager.h.

double rviz::VisualizationManager::getROSTime ( )

Return the ROS time, in seconds.

Definition at line 495 of file visualization_manager.cpp.

double rviz::VisualizationManager::getROSTimeElapsed ( )

Return the ROS time in seconds since the last reset.

Definition at line 505 of file visualization_manager.cpp.

Ogre::SceneManager* rviz::VisualizationManager::getSceneManager ( ) const
inlinevirtual

Returns the Ogre::SceneManager used for the main RenderPanel.

Implements rviz::DisplayContext.

Definition at line 195 of file visualization_manager.h.

SelectionManager* rviz::VisualizationManager::getSelectionManager ( ) const
inlinevirtual

Return a pointer to the SelectionManager.

Implements rviz::DisplayContext.

Definition at line 248 of file visualization_manager.h.

tf::TransformListener * rviz::VisualizationManager::getTFClient ( ) const
virtual

Convenience function: returns getFrameManager()->getTFClient().

Implements rviz::DisplayContext.

Definition at line 422 of file visualization_manager.cpp.

ros::CallbackQueueInterface * rviz::VisualizationManager::getThreadedQueue ( )
virtual

Return a CallbackQueue using a different thread than the main GUI one.

Implements rviz::DisplayContext.

Definition at line 248 of file visualization_manager.cpp.

virtual ToolManager* rviz::VisualizationManager::getToolManager ( ) const
inlinevirtual

Return a pointer to the ToolManager.

Implements rviz::DisplayContext.

Definition at line 251 of file visualization_manager.h.

ros::CallbackQueueInterface * rviz::VisualizationManager::getUpdateQueue ( )
virtual

Return the CallbackQueue using the main GUI thread.

Implements rviz::DisplayContext.

Definition at line 263 of file visualization_manager.cpp.

virtual ViewManager* rviz::VisualizationManager::getViewManager ( ) const
inlinevirtual

Return a pointer to the ViewManager.

Implements rviz::DisplayContext.

Definition at line 254 of file visualization_manager.h.

double rviz::VisualizationManager::getWallClock ( )

Return the wall clock time, in seconds since 1970.

Definition at line 490 of file visualization_manager.cpp.

double rviz::VisualizationManager::getWallClockElapsed ( )

Return the wall clock time in seconds since the last reset.

Definition at line 500 of file visualization_manager.cpp.

WindowManagerInterface* rviz::VisualizationManager::getWindowManager ( ) const
inlinevirtual

Return the window manager, if any.

Implements rviz::DisplayContext.

Definition at line 275 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 569 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 530 of file visualization_manager.cpp.

void rviz::VisualizationManager::initialize ( )

Do initialization that wasn't done in constructor. Initializes tool manager, view manager, selection manager.

Definition at line 236 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.

Parameters
configThe Config object to read from. Expected to be a Config::Map type.
See also
save()

Definition at line 455 of file visualization_manager.cpp.

void rviz::VisualizationManager::lockRender ( )

Lock a mutex to delay calls to Ogre::Root::renderOneFrame().

Definition at line 253 of file visualization_manager.cpp.

void rviz::VisualizationManager::notifyConfigChanged ( )

Notify this VisualizationManager that something about its display configuration has changed.

Definition at line 582 of file visualization_manager.cpp.

void rviz::VisualizationManager::onToolChanged ( Tool tool)
protectedslot

Definition at line 587 of file visualization_manager.cpp.

void rviz::VisualizationManager::onUpdate ( )
protectedslot

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 309 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.

Note
This function can be called from any thread.

Implements rviz::DisplayContext.

Definition at line 304 of file visualization_manager.cpp.

void rviz::VisualizationManager::removeAllDisplays ( )

Remove and delete all displays.

Definition at line 445 of file visualization_manager.cpp.

void rviz::VisualizationManager::resetTime ( )

Resets the wall and ROS elapsed time to zero and calls resetDisplays().

Definition at line 427 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.

Parameters
configThe object to write to.
See also
loadDisplayConfig()

Definition at line 471 of file visualization_manager.cpp.

void rviz::VisualizationManager::setFixedFrame ( const QString &  frame)

Set the coordinate frame we should be transforming all fixed data into.

Parameters
frameThe name of the frame – must match the frame name broadcast to libTF
See also
getFixedFrame()

Definition at line 604 of file visualization_manager.cpp.

virtual void rviz::VisualizationManager::setHelpPath ( const QString &  help_path)
inlinevirtual

Definition at line 317 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 609 of file visualization_manager.cpp.

void rviz::VisualizationManager::startUpdate ( )

Start timers. Creates and starts the update and idle timers, both set to 30Hz (33ms).

Definition at line 268 of file visualization_manager.cpp.

void rviz::VisualizationManager::statusUpdate ( const QString &  message)
signal

Emitted during file-loading and initialization to indicate progress.

void rviz::VisualizationManager::stopUpdate ( )

Definition at line 274 of file visualization_manager.cpp.

void rviz::VisualizationManager::threadedQueueThreadFunc ( )
protected

Definition at line 574 of file visualization_manager.cpp.

void rviz::VisualizationManager::unlockRender ( )

Unlock a mutex, allowing calls to Ogre::Root::renderOneFrame().

Definition at line 258 of file visualization_manager.cpp.

void rviz::VisualizationManager::updateBackgroundColor ( )
privateslot

Definition at line 510 of file visualization_manager.cpp.

void rviz::VisualizationManager::updateDefaultLightVisible ( )
privateslot

Definition at line 525 of file visualization_manager.cpp.

void rviz::VisualizationManager::updateFixedFrame ( )
privateslot

Definition at line 591 of file visualization_manager.cpp.

void rviz::VisualizationManager::updateFps ( )
privateslot

Definition at line 517 of file visualization_manager.cpp.

void rviz::VisualizationManager::updateFrames ( )
protected

Definition at line 392 of file visualization_manager.cpp.

void rviz::VisualizationManager::updateTime ( )
protected

Definition at line 375 of file visualization_manager.cpp.

virtual BitAllocator* rviz::VisualizationManager::visibilityBits ( )
inlinevirtual

Implements rviz::DisplayContext.

Definition at line 313 of file visualization_manager.h.

Member Data Documentation

ColorProperty* rviz::VisualizationManager::background_color_property_
protected

Definition at line 381 of file visualization_manager.h.

BoolProperty* rviz::VisualizationManager::default_light_enabled_property_
protected

Definition at line 372 of file visualization_manager.h.

uint32_t rviz::VisualizationManager::default_visibility_bit_
private

Definition at line 406 of file visualization_manager.h.

Ogre::Light* rviz::VisualizationManager::directional_light_
private

Definition at line 409 of file visualization_manager.h.

DisplayFactory* rviz::VisualizationManager::display_factory_
private

Definition at line 404 of file visualization_manager.h.

PropertyTreeModel* rviz::VisualizationManager::display_property_tree_model_
protected

Definition at line 362 of file visualization_manager.h.

TfFrameProperty* rviz::VisualizationManager::fixed_frame_property_
protected

Frame to transform fixed data to.

Definition at line 369 of file visualization_manager.h.

IntProperty* rviz::VisualizationManager::fps_property_
protected

Definition at line 371 of file visualization_manager.h.

uint64_t rviz::VisualizationManager::frame_count_
protected

Definition at line 389 of file visualization_manager.h.

FrameManager* rviz::VisualizationManager::frame_manager_
protected

Definition at line 393 of file visualization_manager.h.

float rviz::VisualizationManager::frame_update_timer_
protected

Definition at line 384 of file visualization_manager.h.

Property* rviz::VisualizationManager::global_options_
protected

Definition at line 368 of file visualization_manager.h.

StatusList* rviz::VisualizationManager::global_status_
protected

Definition at line 370 of file visualization_manager.h.

QString rviz::VisualizationManager::help_path_
private

Definition at line 408 of file visualization_manager.h.

ros::Time rviz::VisualizationManager::last_update_ros_time_
protected

Update stopwatch. Stores how long it's been since the last update.

Definition at line 357 of file visualization_manager.h.

ros::WallTime rviz::VisualizationManager::last_update_wall_time_
protected

Definition at line 358 of file visualization_manager.h.

OgreRenderQueueClearer* rviz::VisualizationManager::ogre_render_queue_clearer_
protected

Definition at line 395 of file visualization_manager.h.

Ogre::Root* rviz::VisualizationManager::ogre_root_
protected

Ogre Root.

Definition at line 353 of file visualization_manager.h.

VisualizationManagerPrivate* rviz::VisualizationManager::private_
private

Definition at line 405 of file visualization_manager.h.

RenderPanel* rviz::VisualizationManager::render_panel_
protected

Definition at line 374 of file visualization_manager.h.

uint32_t rviz::VisualizationManager::render_requested_
protected

Definition at line 388 of file visualization_manager.h.

DisplayGroup* rviz::VisualizationManager::root_display_group_
protected

Definition at line 363 of file visualization_manager.h.

ros::Time rviz::VisualizationManager::ros_time_begin_
protected

Definition at line 377 of file visualization_manager.h.

ros::Duration rviz::VisualizationManager::ros_time_elapsed_
protected

Definition at line 379 of file visualization_manager.h.

Ogre::SceneManager* rviz::VisualizationManager::scene_manager_
protected

Ogre scene manager associated with this panel.

Definition at line 354 of file visualization_manager.h.

SelectionManager* rviz::VisualizationManager::selection_manager_
protected

Definition at line 386 of file visualization_manager.h.

volatile bool rviz::VisualizationManager::shutting_down_
protected

Definition at line 360 of file visualization_manager.h.

float rviz::VisualizationManager::time_update_timer_
protected

Definition at line 383 of file visualization_manager.h.

ToolManager* rviz::VisualizationManager::tool_manager_
protected

Definition at line 365 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 356 of file visualization_manager.h.

ViewManager* rviz::VisualizationManager::view_manager_
protected

Definition at line 366 of file visualization_manager.h.

BitAllocator rviz::VisualizationManager::visibility_bit_allocator_
private

Definition at line 407 of file visualization_manager.h.

ros::WallTime rviz::VisualizationManager::wall_clock_begin_
protected

Definition at line 376 of file visualization_manager.h.

ros::WallDuration rviz::VisualizationManager::wall_clock_elapsed_
protected

Definition at line 378 of file visualization_manager.h.

WindowManagerInterface* rviz::VisualizationManager::window_manager_
protected

Definition at line 391 of file visualization_manager.h.


The documentation for this class was generated from the following files:


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:54