44 #ifndef VSI_SCENEELEMENT_HH 45 #define VSI_SCENEELEMENT_HH 48 #include <QGraphicsWidget> 50 #include <QDomDocument> 51 #include <QDomElement> 55 class QGraphicsLinearLayout;
64 class ElementFunction;
85 void paint (QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0);
91 QVector<ElementInput *>
inputs () {
return inputs_; };
94 QVector<ElementOutput *>
outputs () {
return outputs_; };
97 QVector<ElementFunction *>
functions () {
return functions_; };
115 int id () {
return id_; };
118 QString
code () {
return code_; };
127 void saveToXml (QDomDocument &_doc, QDomElement &_root);
138 void mousePressEvent (QGraphicsSceneMouseEvent *_event);
139 void mouseMoveEvent (QGraphicsSceneMouseEvent *_event);
140 void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event);
144 void moveEvent (QGraphicsSceneMoveEvent *_event);
149 void showInputConfig ();
154 void invalidateConnections ();
161 QVector<ElementInput *> inputs_;
162 QVector<ElementOutput *> outputs_;
167 QVector<ElementFunction *> functions_;
169 QVector<ElementInput *> configInputs_;
177 QGraphicsLinearLayout *nameLayout_;
GraphicsScene * graphicsScene()
Scene.
void resetCodeGeneration()
Reset code block for code generation.
void replaceCodeBlock(QString _name, QString _id, QString _value)
Replace block with name _name and id _id with _value.
~SceneElement()
Destructor.
void loadFromXml(QXmlQuery &_xml)
Load from xml.
void paint(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
Background painting.
QString variableId()
Unique variable name for code generation.
bool isBefore(SceneElement *_e)
Will this element be executed before _e bacause of its connections?
QVector< ElementFunction * > functions()
Functions.
bool isAfter(SceneElement *_e)
Will this element be executed after _e bacause of its connections?
QString code()
Code block.
QVector< ElementOutput * > outputs()
Outputs.
void saveToXml(QDomDocument &_doc, QDomElement &_root)
Save to xml.
Element * element() const
Context VSI::Element.
QVector< ElementInput * > inputs()
Inputs.
SceneElement(GraphicsScene *_scene, Element *_element)
Constructor.
ElementOutput * dataOut()
Scene output.
int id()
Unique id for identification.
ElementInput * dataIn()
Scene input.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event)
Double click occured. We can't use mouseDoubleClickEvent because we won't get one for the ConecctionP...