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