50 #ifndef VSI_SCENEELEMENT_HH
51 #define VSI_SCENEELEMENT_HH
54 #include <QGraphicsWidget>
56 #include <QDomDocument>
57 #include <QDomElement>
61 class QGraphicsLinearLayout;
70 class ElementFunction;
91 void paint (QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0);
97 QVector<ElementInput *>
inputs () {
return inputs_; };
100 QVector<ElementOutput *>
outputs () {
return outputs_; };
103 QVector<ElementFunction *>
functions () {
return functions_; };
121 int id () {
return id_; };
124 QString
code () {
return code_; };
133 void saveToXml (QDomDocument &_doc, QDomElement &_root);
144 void mousePressEvent (QGraphicsSceneMouseEvent *_event);
145 void mouseMoveEvent (QGraphicsSceneMouseEvent *_event);
146 void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event);
150 void moveEvent (QGraphicsSceneMoveEvent *_event);
155 void showInputConfig ();
160 void invalidateConnections ();
167 QVector<ElementInput *> inputs_;
168 QVector<ElementOutput *> outputs_;
173 QVector<ElementFunction *> functions_;
175 QVector<ElementInput *> configInputs_;
183 QGraphicsLinearLayout *nameLayout_;
int id()
Unique id for identification.
QVector< ElementInput * > inputs()
Inputs.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event)
Double click occured. We can't use mouseDoubleClickEvent because we won't get one for the ConecctionP...
void saveToXml(QDomDocument &_doc, QDomElement &_root)
Save to xml.
SceneElement(GraphicsScene *_scene, Element *_element)
Constructor.
bool isBefore(SceneElement *_e)
Will this element be executed before _e bacause of its connections?
~SceneElement()
Destructor.
void paint(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
Background painting.
void loadFromXml(QXmlQuery &_xml)
Load from xml.
GraphicsScene * graphicsScene()
Scene.
QVector< ElementFunction * > functions()
Functions.
Element * element() const
Context VSI::Element.
ElementInput * dataIn()
Scene input.
ElementOutput * dataOut()
Scene output.
void replaceCodeBlock(QString _name, QString _id, QString _value)
Replace block with name _name and id _id with _value.
QString code()
Code block.
QString variableId()
Unique variable name for code generation.
QVector< ElementOutput * > outputs()
Outputs.
bool isAfter(SceneElement *_e)
Will this element be executed after _e bacause of its connections?
void resetCodeGeneration()
Reset code block for code generation.