roviz  0.7
Code Documentation of roviz
Public Member Functions | Protected Member Functions | Friends | List of all members
RovizItemBaseDev Class Referenceabstract

Base class that binds RovizItem to the itemframework/Qt. More...

#include <roviz_item_base_dev.h>

Inheritance diagram for RovizItemBaseDev:
Inheritance graph
Collaboration diagram for RovizItemBaseDev:
Collaboration graph

Public Member Functions

 RovizItemBaseDev (std::string type_name)
 
virtual QWidget * widget (void)
 
- Public Member Functions inherited from AbstractItem
 AbstractItem (QString typeName)
 Constructs an AbstractItem with the name typeName. More...
 
QString typeName () const
 
QString name () const
 
QString description () const
 
void setName (QString name)
 Set this items name. More...
 
QRectF boundingRect () const override
 Returns the bounding box of the item. More...
 
QPainterPath shape () const override
 Returns the graphical shape of the item's image. More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) override
 Paints the contents of the item. More...
 
QList< ItemInput * > const inputs () const
 
QList< ItemOutput * > const outputs () const
 
QImage const image () const
 
int progress () const
 
virtual bool load (class QDomElement &element)
 Loads persistent settings for this item from given XML element. More...
 
virtual bool save (class QDomDocument &document, class QDomElement &element) const
 Saves persistent settings for this item into the given XML element. More...
 
SettingsScopesettingsScope () const
 Returns a pointer to the settings scope associated with this item. More...
 

Protected Member Functions

void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 Opens the item in the SharedWindow.
 
void contextMenuPrepare (QMenu &menu) const override
 Show the 'Configure' option in the context menu if the item has configs. More...
 
- Protected Member Functions inherited from AbstractItem
ItemInputaddInput (int transportType, QString const &description="")
 Adds an input to this item. More...
 
ItemOutputaddOutput (int transportType, QString const &description="")
 Adds an output to this item. More...
 
void remove (ItemInput *input)
 Removes an input from this item. More...
 
void remove (ItemOutput *output)
 Removes an output from this item. More...
 
void clearInputs ()
 Remove all the inputs from this item. More...
 
void clearOutputs ()
 Remove all the outputs from this item. More...
 
void setDescription (QString const &description)
 Set the description of the item. More...
 
void setImage (QImage const &image)
 Set the image displayed in the item. More...
 
void setOutputData (ItemOutput *output, QObject *data)
 Set the data of a given output. More...
 
void setProgress (int progress)
 Set the current progress of the item. More...
 
void setProgressAutohide (int ms)
 Sets the progress to -1 after a certain amount of time. More...
 
virtual void paintItemBox (QPainter *painter)
 This Method paints the Item Rectangle, the Icon and the progress bar of the item. Override for custom behavior. More...
 
void timerEvent (QTimerEvent *t) override
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override
 

Friends

class RovizItemBaseDevPrivate
 

Interface implementation

Implementation of the interface that RovizItem demands. See the documentation of RovizItem to see what these functions do.

virtual void pause (void)=0
 
virtual void unpause (void)=0
 
virtual bool running (void) const =0
 
virtual void join (void)=0
 
template<class T >
Input< T > addInputBase (std::string name, RovizItem *item)
 
template<class T >
Output< T > addOutputBase (std::string name)
 
TrimImplgetTrimImpl (std::string name, double default_value, double min, double max, int steps, bool logarithmic, std::function< void(double)> notifier_func)
 
ConfigImplgetConfigImpl (const std::string &name, const typename ConfigStorageType< int >::type &default_value, int min, int max, bool restart_when_changed)
 
ConfigImplgetConfigImpl (const std::string &name, const typename ConfigStorageType< double >::type &default_value, double min, double max, bool restart_when_changed)
 
ConfigImplgetConfigImpl (const std::string &name, const typename ConfigStorageType< std::string >::type &default_value, std::function< bool(std::string &)> checker, bool restart_when_changed)
 
ConfigImplgetConfigImpl (const std::string &name, const typename ConfigStorageType< std::list< std::string > >::type &default_index, const std::list< std::string > &possibilities, bool restart_when_changed)
 
ConfigImplgetConfigImpl (const std::string &name, const typename ConfigStorageType< bool >::type &default_value, bool restart_when_changed)
 
ConfigImplgetConfigImpl (const std::string &name, const typename ConfigStorageType< FilePath >::type &default_value, enum FilePath::Mode file_mode, const std::string &filter, bool restart_when_changed)
 
virtual void start (void)
 
virtual void stop (void)
 
void restart (void)
 

Additional Inherited Members

- Public Slots inherited from AbstractItem
void disconnectConnections ()
 Disconnects all connections from/to the item.
 
- Signals inherited from AbstractItem
void changed ()
 This signal should be emitted by the derived class whenever the items state has changed and needs to be saved again.
 
void nameChanged ()
 This signal is emitted whenever the name has changed.
 
void descriptionChanged ()
 This signal is emitted whenever the description has changed.
 
void progressChanged ()
 This signal is emitted whenever the progress has changed.
 
- Static Public Member Functions inherited from AbstractItem
static int connectorHeight ()
 
static int connectorWidth ()
 
static bool registerConnectorStyle (QColor const &color, int transportType)
 Register a connector style for a transport type. More...
 
static QPen connectorStyle (int transportType)
 
- Properties inherited from AbstractItem
SettingsScope settingsScope
 

Detailed Description

Base class that binds RovizItem to the itemframework/Qt.

See also
RovizItem
RovizItemDevBasePrivate

Constructor & Destructor Documentation

◆ RovizItemBaseDev()

RovizItemBaseDev::RovizItemBaseDev ( std::string  type_name)
explicit
Parameters
type_nameName of the item
Here is the call graph for this function:

Member Function Documentation

◆ contextMenuPrepare()

void RovizItemBaseDev::contextMenuPrepare ( QMenu &  menu) const
overrideprotectedvirtual

Show the 'Configure' option in the context menu if the item has configs.

Parameters
menuThe context menu

Reimplemented from AbstractItem.

Here is the call graph for this function:

◆ widget()

QWidget * RovizItemBaseDev::widget ( void  )
virtual
Returns
The main widget of the item

Can be overwritten to show a custom widget. Before doing that, consider using a custom stream and setting a new widget there.

See also
SharedWindow
Here is the caller graph for this function:

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