1 // Copyright (C) 2006-2012 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
20 #ifndef _SCENEHEADERNODEITEM_HXX_
21 #define _SCENEHEADERNODEITEM_HXX_
23 #include "SceneHeaderItem.hxx"
24 #include "SceneNodeItem.hxx"
30 class SceneInPortItem;
31 class SceneOutPortItem;
32 class SceneCtrlPortItem;
34 class SceneHeaderNodeItem: public SceneHeaderItem
37 SceneHeaderNodeItem(QGraphicsScene *scene, SceneItem *parent,
39 virtual ~SceneHeaderNodeItem();
41 virtual void paint(QPainter *painter,
42 const QStyleOptionGraphicsItem *option,
44 virtual void setText(QString label);
45 virtual qreal getHeaderBottom() const;
46 virtual void autoPosControl(AbstractSceneItem *item);
47 virtual void autoPosNewPort(AbstractSceneItem *item);
48 virtual void reorganizePorts(shownState ss);
49 virtual void popupMenu(QWidget *caller, const QPoint &globalPos);
50 virtual void adjustGeometry();
51 virtual void adjustPosPorts();
52 virtual QRectF getMinimalBoundingRect() const;
53 virtual void adaptComposedNode(SceneItem* port, qreal deltaY);
54 virtual void setEdited(bool isEdited);
55 virtual void setValid(bool isValid);
56 virtual void setExecState(int execState);
57 virtual SceneCtrlPortItem* getCtrlInPortItem();
58 virtual SceneCtrlPortItem* getCtrlOutPortItem();
59 QColor getValidColor();
62 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
63 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
65 SceneHeaderItem *_header;
66 SceneCtrlPortItem *_controlIn;
67 SceneCtrlPortItem *_controlOut;
68 std::list<SceneInPortItem*> _inPorts;
69 std::list<SceneOutPortItem*> _outPorts;