44#ifndef VSI_SCENEELEMENT_HH
45#define VSI_SCENEELEMENT_HH
48#include <QGraphicsWidget>
50#include <QDomDocument>
54class QGraphicsLinearLayout;
84 void paint (QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0);
90 QVector<ElementInput *>
inputs () {
return inputs_; };
93 QVector<ElementOutput *>
outputs () {
return outputs_; };
96 QVector<ElementFunction *>
functions () {
return functions_; };
108 void replaceCodeBlock (
const QString& _name,
const QString& _id,
const QString& _value);
114 int id () {
return id_; };
117 QString
code () {
return code_; };
126 void saveToXml (QDomDocument &_doc, QDomElement &_root);
135 void loadFromXml (QDomElement& _domElement,std::vector<QString>& _connections);
143 void mousePressEvent (QGraphicsSceneMouseEvent *_event);
144 void mouseMoveEvent (QGraphicsSceneMouseEvent *_event);
145 void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event);
149 void moveEvent (QGraphicsSceneMoveEvent *_event);
154 void showInputConfig ();
159 void invalidateConnections ();
166 QVector<ElementInput *> inputs_;
167 QVector<ElementOutput *> outputs_;
172 QVector<ElementFunction *> functions_;
174 QVector<ElementInput *> configInputs_;
182 QGraphicsLinearLayout *nameLayout_;
QString variableId()
Unique variable name for code generation.
~SceneElement()
Destructor.
SceneElement(GraphicsScene *_scene, Element *_element)
Constructor.
GraphicsScene * graphicsScene()
Scene.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event)
Double click occured. We can't use mouseDoubleClickEvent because we won't get one for the ConecctionP...
void paint(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
Background painting.
QVector< ElementOutput * > outputs()
Outputs.
void replaceCodeBlock(const QString &_name, const QString &_id, const QString &_value)
Replace block with name _name and id _id with _value.
void saveToXml(QDomDocument &_doc, QDomElement &_root)
Save to xml.
void loadFromXml(QDomElement &_domElement, std::vector< QString > &_connections)
Load one scene Element from xml.
ElementInput * dataIn()
Scene input.
bool isBefore(SceneElement *_e)
Will this element be executed before _e bacause of its connections?
void resetCodeGeneration()
Reset code block for code generation.
Element * element() const
Context VSI::Element.
ElementOutput * dataOut()
Scene output.
QString code()
Code block.
bool isAfter(SceneElement *_e)
Will this element be executed after _e bacause of its connections?
QVector< ElementFunction * > functions()
Functions.
int id()
Unique id for identification.
QVector< ElementInput * > inputs()
Inputs.