32 #include <QApplication> 34 #include <QDockWidget> 36 #include <QMetaObject> 39 #include <OgreSceneManager.h> 40 #include <OgreSceneNode.h> 51 #include <boost/filesystem.hpp> 60 , initialized_( false )
61 , visibility_bits_( 0xFFFFFFFF )
62 , associated_widget_(
NULL )
63 , associated_widget_panel_(
NULL )
66 qRegisterMetaType<ros::Time>();
111 case Qt::BackgroundRole:
119 return QColor( Qt::white );
121 case Qt::ForegroundRole:
135 return QColor( 40, 120, 197 );
140 return QColor( Qt::black );
150 font.setBold(
true );
154 case Qt::DecorationRole:
188 QMetaObject::invokeMethod(
this,
"setStatusInternal", Qt::QueuedConnection,
190 Q_ARG( QString, name ),
191 Q_ARG( QString, text ));
212 QMetaObject::invokeMethod(
this,
"deleteStatusInternal", Qt::QueuedConnection,
213 Q_ARG( QString, name ));
226 QMetaObject::invokeMethod(
this,
"clearStatusesInternal", Qt::QueuedConnection );
250 setObjectName( name );
307 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
342 QApplication::restoreOverrideCursor();
virtual void setIcon(const QIcon &icon)
Set the Display's icon.
PanelDockWidget * associated_widget_panel_
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz...
void changed()
Emitted by setValue() just after the value has changed.
PropertyTreeModel * model_
Pointer to the PropertyTreeModel managing this property tree.
void setDisableChildrenIfFalse(bool disable)
virtual void load(const Config &config)
Load the value of this property and/or its children from the given Config reference.
void emitTimeSignal(ros::Time time)
Emit a time signal that other Displays can synchronize to.
virtual bool setValue(const QVariant &new_value)
Set the new value for this property. Returns true if the new value is different from the old value...
virtual QIcon getIcon() const
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
virtual void onEnableChanged()
virtual QVariant getViewData(int column, int role) const
Return data appropriate for the given column (0 or 1) and role for this Property. ...
virtual void setName(const QString &name)
Set the name.
virtual ros::CallbackQueueInterface * getUpdateQueue()=0
Return the CallbackQueue using the main GUI thread.
virtual Level getLevel() const
uint32_t visibility_bits_
Ogre::SceneNode * scene_node_
The Ogre::SceneNode to hold all 3D scene elements shown by this Display.
void unsetVisibilityBits(uint32_t bits)
bool mapGetString(const QString &key, QString *value_out) const
Convenience function for looking up a named string.
void timeSignal(rviz::Display *display, ros::Time time)
void mapSetValue(const QString &key, QVariant value)
Set a named child to the given value.
bool isEnabled() const
Return true if this Display is enabled, false if not.
Configuration data storage class.
virtual bool getBool() const
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
Pure-virtual base class for objects which give Display subclasses context in which to work...
virtual void save(Config config) const
Write the value of this property and/or its children into the given Config reference.
virtual void clearStatuses()
Delete all status children. This is thread-safe.
virtual QString getClassId() const
Return the class identifier which was used to create this instance. This version just returns whateve...
virtual PanelDockWidget * addPane(const QString &name, QWidget *pane, Qt::DockWidgetArea area=Qt::LeftDockWidgetArea, bool floating=true)=0
void clearStatusesInternal()
virtual void reset()
Called to tell the display to clear its state.
QWidget * associated_widget_
virtual void onEnable()
Derived classes override this to do the actual work of enabling themselves.
virtual QVariant getViewData(int column, int role) const
Return data appropriate for the given column (0 or 1) and role for this Display.
void setCallbackQueue(CallbackQueueInterface *queue)
void setAssociatedWidget(QWidget *widget)
Associate the given widget with this Display.
static QColor statusColor(Level level)
Return the color appropriate for the given status level.
void queueRender()
Convenience function which calls context_->queueRender().
bool mapGetBool(const QString &key, bool *value_out) const
Convenience function for looking up a named boolean.
QIcon statusIcon(Level level) const
virtual void save(Config config) const
Write this display to the given Config node.
void setVisibilityBits(uint32_t bits)
void setFixedFrame(const QString &fixed_frame)
Set the fixed frame in this display.
Ogre::SceneManager * scene_manager_
A convenience variable equal to context_->getSceneManager().
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
virtual void load(const Config &config)
Load the settings for this display from the given Config node, which must be a map.
virtual QString getFixedFrame() const =0
Return the fixed frame name.
ros::NodeHandle threaded_nh_
A NodeHandle whose CallbackQueue is run from a different thread than the GUI.
virtual void onDisable()
Derived classes override this to do the actual work of disabling themselves.
void setEnabled(bool enabled)
Enable or disable this Display.
void setStatus(Level level, const QString &name, const QString &text)
void setName(const QString &name)
Overridden from Property to set associated widget title to the new name.
virtual void fixedFrameChanged()
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
virtual void addChild(Property *child, int index=-1)
Add a child property.
void emitDataChanged(Property *property)
virtual void onInitialize()
Override this function to do subclass-specific initialization.
void initialize(DisplayContext *context)
Main initialization, called after constructor, before load() or setEnabled().
virtual void deleteStatus(const QString &name)
Delete the status entry with the given name. This is thread-safe.
void associatedPanelVisibilityChange(bool visible)
void applyVisibilityBits(uint32_t bits, Ogre::SceneNode *node)
virtual Qt::ItemFlags getViewFlags(int column) const
Return item flags appropriate for the given column (0 or 1) for this Display.
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
virtual QString getName() const
Return the name of this Property as a QString.
void deleteStatusInternal(const QString &name)
virtual WindowManagerInterface * getWindowManager() const =0
Return the window manager, if any.
virtual Qt::ItemFlags getViewFlags(int column) const
Return item flags appropriate for the given column (0 or 1) for this Property.
virtual ros::CallbackQueueInterface * getThreadedQueue()=0
Return a CallbackQueue using a different thread than the main GUI one.
void deleteStatus(const QString &name)
void setStatusInternal(int level, const QString &name, const QString &text)