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_;
void saveToXml(QDomDocument &_doc, QDomElement &_root)
Save to xml.
GraphicsScene * graphicsScene()
Scene.
void resetCodeGeneration()
Reset code block for code generation.
SceneElement(GraphicsScene *_scene, Element *_element)
Constructor.
ElementOutput * dataOut()
Scene output.
void paint(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
Background painting.
QVector< ElementOutput * > outputs()
Outputs.
int id()
Unique id for identification.
QString code()
Code block.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *_event)
Double click occured. We can't use mouseDoubleClickEvent because we won't get one for the ConecctionP...
QString variableId()
Unique variable name for code generation.
ElementInput * dataIn()
Scene input.
bool isBefore(SceneElement *_e)
Will this element be executed before _e bacause of its connections?
QVector< ElementFunction * > functions()
Functions.
QVector< ElementInput * > inputs()
Inputs.
void replaceCodeBlock(QString _name, QString _id, QString _value)
Replace block with name _name and id _id with _value.
void loadFromXml(QXmlQuery &_xml)
Load from xml.
bool isAfter(SceneElement *_e)
Will this element be executed after _e bacause of its connections?
Element * element() const
Context VSI::Element.
~SceneElement()
Destructor.