Abstract base class for all displays. More...
#include <display.h>
Signals | |
void | stateChanged (Display *) |
Emitted when this display goes from enabled to disabled or vice-versa. | |
Public Member Functions | |
void | clearStatuses () |
Delete all status children. | |
virtual void | createProperties () |
Called from setPropertyManager, gives the display a chance to create some properties immediately. | |
void | deleteStatus (const std::string &name) |
Delete a status child. | |
void | disable (bool force=false) |
Disable this display. | |
Display () | |
void | enable (bool force=false) |
Enable this display. | |
virtual void | fixedFrameChanged () |
Override to handle changes to fixed_frame_. This base class implementation does nothing. | |
const std::string & | getName () const |
StatusLevel | getStatus () |
Return the current top-level StatusLevel. | |
virtual void | hideVisible () |
Hides all visible parts of this display, so they do not show up when the scene is rendered. | |
void | initialize (const std::string &name, VisualizationManager *manager) |
Main initialization, called right after constructor. | |
bool | isEnabled () |
virtual void | onInitialize () |
Override this function to do subclass-specific initialization. | |
virtual void | reset () |
Called to tell the display to clear its state. | |
virtual void | restoreVisible () |
Restores the display to the state it was in before hideVisible() was called. | |
void | setEnabled (bool enable, bool force=false) |
Call enable() or disable(). | |
void | setFixedFrame (const std::string &frame) |
Set the fixed frame of this display. This is a frame id which should generally be the top-level frame being broadcast through TF. | |
void | setLockRenderCallback (boost::function< void()> func) |
Set the callback used to lock the renderer. | |
void | setName (const std::string &name) |
void | setPropertyManager (PropertyManager *manager, const CategoryPropertyWPtr &parent) |
Sets the property manager and parent category for this display. | |
void | setRenderCallback (boost::function< void()> func) |
Set the callback used for causing a render to happen. | |
void | setStatus (StatusLevel level, const std::string &name, const std::string &text) |
Show status level and text. | |
void | setUnlockRenderCallback (boost::function< void()> func) |
Set the callback used to unlock the renderer. | |
virtual void | update (float wall_dt, float ros_dt) |
Called periodically by the visualization panel. | |
virtual | ~Display () |
Protected Member Functions | |
void | causeRender () |
Cause the scene we're in to be rendered. | |
void | lockRender () |
Lock the renderer. | |
virtual void | onDisable ()=0 |
Derived classes override this to do the actual work of disabling themselves. | |
virtual void | onEnable ()=0 |
Derived classes override this to do the actual work of enabling themselves. | |
void | unlockRender () |
Unlock the renderer. | |
Protected Attributes | |
bool | enabled_ |
Are we enabled? | |
std::string | fixed_frame_ |
The frame we should transform all fixed data into. | |
std::string | name_ |
The name of this display. | |
CategoryPropertyWPtr | parent_category_ |
The parent category to use when creating properties. | |
PropertyManager * | property_manager_ |
The property manager to use to create properties. | |
std::string | property_prefix_ |
Prefix to prepend to our properties. | |
boost::function< void()> | render_callback_ |
Render callback. | |
boost::function< void()> | render_lock_ |
Render lock callback. | |
boost::function< void()> | render_unlock_ |
Render unlock callback. | |
Ogre::SceneManager * | scene_manager_ |
The scene manager we're associated with. | |
StatusLevel | status_ |
StatusPropertyWPtr | status_property_ |
ros::NodeHandle | threaded_nh_ |
ros::NodeHandle | update_nh_ |
VisualizationManager * | vis_manager_ |
Friends | |
class | RenderAutoLock |
Abstract base class for all displays.
Generally, a Display is something which listens for data on some ROS topic and displays it in a 3D scene. Displays do not have to do either though. The GridDisplay displays a grid attached to a TF frame, but doesn't subscribe to any topic itself. The Image display subscribes to an image topic but displays in a 2D window, not a 3D scene.
One thing every display gets is a top-level entry in the "Displays" panel, with a checkbox to enable or disable it. When the checkbox changes state, the virtual onEnable() or onDisable() function is called.
Definition at line 38 of file display.cpp.
rviz::Display::~Display | ( | ) | [virtual] |
Definition at line 47 of file display.cpp.
void rviz::Display::causeRender | ( | ) | [protected] |
Cause the scene we're in to be rendered.
Definition at line 139 of file display.cpp.
void rviz::Display::clearStatuses | ( | ) |
Delete all status children.
This removes all status children and updates the top-level status.
Definition at line 205 of file display.cpp.
virtual void rviz::Display::createProperties | ( | ) | [inline, virtual] |
Called from setPropertyManager, gives the display a chance to create some properties immediately.
When this function is called, the property_manager_ member is valid and will stay valid
Reimplemented in rviz::PointCloudBase, rviz::PoseDisplay, rviz::RobotModelDisplay, rviz::TFDisplay, rviz::GridDisplay, rviz::CameraDisplay, rviz::InteractiveMarkerDisplay, rviz::OdometryDisplay, rviz::MarkerDisplay, rviz::MapDisplay, rviz::RangeDisplay, rviz::GridCellsDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::PoseArrayDisplay, rviz::ImageDisplay, rviz::AxesDisplay, rviz::LaserScanDisplay, rviz::PointCloud2Display, rviz::PointCloudDisplay, and rviz::MarkerArrayDisplay.
void rviz::Display::deleteStatus | ( | const std::string & | name | ) |
Delete a status child.
name | The name of the status child entry to remove. This updates the top-level status after deleting the child. |
Definition at line 190 of file display.cpp.
void rviz::Display::disable | ( | bool | force = false | ) |
Disable this display.
force | If false, does not re-disable if this display is already disabled. If true, it does. |
Definition at line 92 of file display.cpp.
void rviz::Display::enable | ( | bool | force = false | ) |
Enable this display.
force | If false, does not re-enable if this display is already enabled. If true, it does. |
Definition at line 73 of file display.cpp.
virtual void rviz::Display::fixedFrameChanged | ( | ) | [inline, virtual] |
Override to handle changes to fixed_frame_. This base class implementation does nothing.
Reimplemented in rviz::PointCloudBase, rviz::PoseDisplay, rviz::RobotModelDisplay, rviz::TFDisplay, rviz::CameraDisplay, rviz::OdometryDisplay, rviz::InteractiveMarkerDisplay, rviz::MapDisplay, rviz::MarkerDisplay, rviz::RangeDisplay, rviz::GridCellsDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::PoseArrayDisplay, rviz::LaserScanDisplay, rviz::PointCloud2Display, and rviz::PointCloudDisplay.
const std::string& rviz::Display::getName | ( | void | ) | const [inline] |
Return the current top-level StatusLevel.
Definition at line 170 of file display.cpp.
virtual void rviz::Display::hideVisible | ( | ) | [inline, virtual] |
Hides all visible parts of this display, so they do not show up when the scene is rendered.
Reimplemented in rviz::PointCloudBase, rviz::InteractiveMarkerDisplay, rviz::RobotModelDisplay, rviz::MarkerDisplay, rviz::GridCellsDisplay, and rviz::MapDisplay.
void rviz::Display::initialize | ( | const std::string & | name, |
VisualizationManager * | manager | ||
) |
Main initialization, called right after constructor.
Definition at line 55 of file display.cpp.
bool rviz::Display::isEnabled | ( | ) | [inline] |
void rviz::Display::lockRender | ( | ) | [protected] |
Lock the renderer.
Definition at line 147 of file display.cpp.
virtual void rviz::Display::onDisable | ( | ) | [protected, pure virtual] |
Derived classes override this to do the actual work of disabling themselves.
Implemented in rviz::PointCloudBase, rviz::InteractiveMarkerDisplay, rviz::PoseDisplay, rviz::RobotModelDisplay, rviz::TFDisplay, rviz::CameraDisplay, rviz::MarkerDisplay, rviz::OdometryDisplay, rviz::GridCellsDisplay, rviz::GridDisplay, rviz::RangeDisplay, rviz::MapDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::ImageDisplay, rviz::PoseArrayDisplay, rviz::LaserScanDisplay, rviz::PointCloud2Display, rviz::PointCloudDisplay, and rviz::AxesDisplay.
virtual void rviz::Display::onEnable | ( | ) | [protected, pure virtual] |
Derived classes override this to do the actual work of enabling themselves.
Implemented in rviz::PointCloudBase, rviz::InteractiveMarkerDisplay, rviz::PoseDisplay, rviz::RobotModelDisplay, rviz::TFDisplay, rviz::CameraDisplay, rviz::MarkerDisplay, rviz::OdometryDisplay, rviz::GridCellsDisplay, rviz::GridDisplay, rviz::RangeDisplay, rviz::MapDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::ImageDisplay, rviz::PoseArrayDisplay, rviz::LaserScanDisplay, rviz::PointCloud2Display, rviz::PointCloudDisplay, and rviz::AxesDisplay.
virtual void rviz::Display::onInitialize | ( | ) | [inline, virtual] |
Override this function to do subclass-specific initialization.
This is called after vis_manager_ and scene_manager_ are set.
Reimplemented in rviz::PointCloudBase, rviz::InteractiveMarkerDisplay, rviz::MarkerDisplay, rviz::PoseDisplay, rviz::TFDisplay, rviz::CameraDisplay, rviz::ImageDisplay, rviz::OdometryDisplay, rviz::GridCellsDisplay, rviz::LaserScanDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::PoseArrayDisplay, rviz::RangeDisplay, rviz::MapDisplay, rviz::PointCloud2Display, rviz::PointCloudDisplay, rviz::RobotModelDisplay, rviz::GridDisplay, and rviz::AxesDisplay.
void rviz::Display::reset | ( | ) | [virtual] |
Called to tell the display to clear its state.
Reimplemented in rviz::PointCloudBase, rviz::PoseDisplay, rviz::RobotModelDisplay, rviz::TFDisplay, rviz::CameraDisplay, rviz::OdometryDisplay, rviz::InteractiveMarkerDisplay, rviz::MapDisplay, rviz::MarkerDisplay, rviz::RangeDisplay, rviz::GridCellsDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::PoseArrayDisplay, and rviz::ImageDisplay.
Definition at line 232 of file display.cpp.
virtual void rviz::Display::restoreVisible | ( | ) | [inline, virtual] |
Restores the display to the state it was in before hideVisible() was called.
Reimplemented in rviz::PointCloudBase, rviz::InteractiveMarkerDisplay, rviz::RobotModelDisplay, rviz::MarkerDisplay, rviz::GridCellsDisplay, and rviz::MapDisplay.
void rviz::Display::setEnabled | ( | bool | enable, |
bool | force = false |
||
) |
Definition at line 111 of file display.cpp.
void rviz::Display::setFixedFrame | ( | const std::string & | frame | ) |
Set the fixed frame of this display. This is a frame id which should generally be the top-level frame being broadcast through TF.
frame | The fixed frame |
Definition at line 163 of file display.cpp.
void rviz::Display::setLockRenderCallback | ( | boost::function< void()> | func | ) |
Set the callback used to lock the renderer.
Definition at line 128 of file display.cpp.
void rviz::Display::setName | ( | const std::string & | name | ) |
Definition at line 67 of file display.cpp.
void rviz::Display::setPropertyManager | ( | PropertyManager * | manager, |
const CategoryPropertyWPtr & | parent | ||
) |
Sets the property manager and parent category for this display.
manager | The property manager |
parent | The parent category |
Definition at line 220 of file display.cpp.
void rviz::Display::setRenderCallback | ( | boost::function< void()> | func | ) |
Set the callback used for causing a render to happen.
func | a void(void) function that will cause a render to happen from the correct thread |
Definition at line 123 of file display.cpp.
void rviz::Display::setStatus | ( | StatusLevel | level, |
const std::string & | name, | ||
const std::string & | text | ||
) |
Show status level and text.
level | One of status_levels::Ok, status_levels::Warn, or status_levels::Error. |
name | The name of the child entry to set. |
text | Description of the child's state. |
Every Display has a StatusProperty to indicate how it is doing. The StatusProperty has children in the PropertyTreeWidget indicating the status of various subcomponents of the Display. Each child of the status has a level, a name, and descriptive text. The top-level StatusProperty has a level which is set to the worst of all the children's levels.
Definition at line 175 of file display.cpp.
void rviz::Display::setUnlockRenderCallback | ( | boost::function< void()> | func | ) |
Set the callback used to unlock the renderer.
Definition at line 133 of file display.cpp.
void rviz::Display::stateChanged | ( | Display * | ) | [signal] |
Emitted when this display goes from enabled to disabled or vice-versa.
void rviz::Display::unlockRender | ( | ) | [protected] |
Unlock the renderer.
Definition at line 155 of file display.cpp.
virtual void rviz::Display::update | ( | float | wall_dt, |
float | ros_dt | ||
) | [inline, virtual] |
Called periodically by the visualization panel.
dt | Wall-clock time, in seconds, since the last time the update list was run through. |
Reimplemented in rviz::PointCloudBase, rviz::PoseDisplay, rviz::TFDisplay, rviz::GridDisplay, rviz::CameraDisplay, rviz::OdometryDisplay, rviz::MapDisplay, rviz::InteractiveMarkerDisplay, rviz::RangeDisplay, rviz::GridCellsDisplay, rviz::MarkerDisplay, rviz::PathDisplay, rviz::PolygonDisplay, rviz::PoseArrayDisplay, rviz::ImageDisplay, rviz::AxesDisplay, and rviz::RobotModelDisplay.
friend class RenderAutoLock [friend] |
bool rviz::Display::enabled_ [protected] |
std::string rviz::Display::fixed_frame_ [protected] |
std::string rviz::Display::name_ [protected] |
CategoryPropertyWPtr rviz::Display::parent_category_ [protected] |
PropertyManager* rviz::Display::property_manager_ [protected] |
std::string rviz::Display::property_prefix_ [protected] |
boost::function<void ()> rviz::Display::render_callback_ [protected] |
boost::function<void ()> rviz::Display::render_lock_ [protected] |
boost::function<void ()> rviz::Display::render_unlock_ [protected] |
Ogre::SceneManager* rviz::Display::scene_manager_ [protected] |
The scene manager we're associated with.
Reimplemented in rviz::ImageDisplay.
StatusLevel rviz::Display::status_ [protected] |
StatusPropertyWPtr rviz::Display::status_property_ [protected] |
ros::NodeHandle rviz::Display::threaded_nh_ [protected] |
ros::NodeHandle rviz::Display::update_nh_ [protected] |
VisualizationManager* rviz::Display::vis_manager_ [protected] |