1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef _SCENEHEADERNODEITEM_HXX_
20 #define _SCENEHEADERNODEITEM_HXX_
22 #include "SceneHeaderItem.hxx"
23 #include "SceneNodeItem.hxx"
29 class SceneInPortItem;
30 class SceneOutPortItem;
31 class SceneCtrlPortItem;
33 class SceneHeaderNodeItem: public SceneHeaderItem
36 SceneHeaderNodeItem(QGraphicsScene *scene, SceneItem *parent,
38 virtual ~SceneHeaderNodeItem();
40 virtual void paint(QPainter *painter,
41 const QStyleOptionGraphicsItem *option,
43 virtual void setText(QString label);
44 virtual qreal getHeaderBottom() const;
45 virtual void autoPosControl(AbstractSceneItem *item);
46 virtual void autoPosNewPort(AbstractSceneItem *item);
47 virtual void popupMenu(QWidget *caller, const QPoint &globalPos);
48 virtual void adjustGeometry();
49 virtual void adjustPosPorts();
50 virtual QRectF getMinimalBoundingRect() const;
51 virtual void adaptComposedNode(qreal deltaY);
52 virtual void setEdited(bool isEdited);
53 virtual void setValid(bool isValid);
54 virtual void setExecState(int execState);
55 virtual SceneCtrlPortItem* getCtrlInPortItem();
56 virtual SceneCtrlPortItem* getCtrlOutPortItem();
59 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
60 QColor getValidColor(bool isValid);
62 SceneHeaderItem *_header;
63 SceneCtrlPortItem *_controlIn;
64 SceneCtrlPortItem *_controlOut;
65 std::list<SceneInPortItem*> _inPorts;
66 std::list<SceneOutPortItem*> _outPorts;
76 static QColor _editedNodeBrushColor;
77 static QColor _normalNodeBrushColor;
78 static QColor _runNodeBrushColor;
79 static QColor _validNodeColor;
80 static QColor _invalidNodeColor;