1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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 DEPENDENCYTREE_ARROW_H
21 #define DEPENDENCYTREE_ARROW_H
23 #include <QGraphicsLineItem>
25 #include "DependencyTree.h"
27 class DependencyTree_Object;
29 class DEPENDENCYTREE_EXPORT DependencyTree_Arrow : public QGraphicsLineItem
34 DependencyTree_Arrow( DependencyTree_Object* startItem, DependencyTree_Object* endItem,
35 QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 );
36 ~DependencyTree_Arrow();
38 virtual QRectF boundingRect() const;
39 virtual QPainterPath shape() const;
41 void setColor(const QColor& );
42 void setHighlightColor(const QColor& );
43 void setSelectColor(const QColor& );
45 DependencyTree_Object* getStartItem() const;
46 DependencyTree_Object* getEndItem() const;
48 void setIsBiLink( bool );
52 void paint( QPainter*, const QStyleOptionGraphicsItem*, QWidget* = 0 );
56 QPolygonF createArrowHead( QPointF , QPointF, bool = true );
58 DependencyTree_Object* myStartItem;
59 DependencyTree_Object* myEndItem;
63 QColor myHighlightColor;
65 QPolygonF myArrowHead;
66 QPolygonF myReverseArrowHead;
70 QRectF mySelfDependencyArrow;