]> SALOME platform Git repositories - modules/geom.git/blob - src/DependencyTree/DependencyTree_Object.h
Salome HOME
4f4eaf14763255e2c737aa289b6510eababae97b
[modules/geom.git] / src / DependencyTree / DependencyTree_Object.h
1 // Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef DEPENDENCYTREE_OBJECT_H
21 #define DEPENDENCYTREE_OBJECT_H
22
23 #include <GraphicsView_Object.h>
24
25 #include <QPen>
26
27 class DependencyTree_Object: public GraphicsView_Object
28 {
29
30 public:
31   DependencyTree_Object( const QString&, QGraphicsItem* = 0 );
32   ~DependencyTree_Object();
33
34   virtual void              compute() {};
35
36   virtual bool              highlight( double, double );
37   virtual void              unhighlight();
38
39   virtual bool              select( double, double, const QRectF& );
40   virtual void              unselect();
41
42   QString                   getEntry() const;
43
44   void                      updateName();
45
46   void                      setColor(const QColor& );
47   void                      setSelectColor(const QColor& );
48   void                      setMainObjectColor(const QColor& );
49
50   void                      setIsMainObject( bool );
51
52 private:
53
54   QPen                      getPen( const QColor& );
55
56   QColor                    myColor;
57   QColor                    mySelectColor;
58   QColor                    myMainObjectColor;
59
60   QGraphicsPolygonItem*     myPolygonItem;
61   QGraphicsSimpleTextItem*  myTextItem;
62
63   QString                   myEntry;
64
65   bool                      myIsMainObject;
66   bool                      myIsLongName;
67
68 };
69
70 #endif