Salome HOME
Dump Image data to python script (Feature #13).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_PrsPolyline.cxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "HYDROGUI_PrsPolyline.h"
24
25 //=======================================================================
26 // name    : HYDROGUI_PrsPolyline
27 // Purpose : Constructor
28 //=======================================================================
29 HYDROGUI_PrsPolyline::HYDROGUI_PrsPolyline( const Handle(HYDROData_Object)& theObject )
30 : HYDROGUI_Prs( theObject ),
31   myPolylineItem( 0 )
32 {
33 }
34
35 //=======================================================================
36 // name    : HYDROGUI_PrsPolyline
37 // Purpose : Destructor
38 //=======================================================================
39 HYDROGUI_PrsPolyline::~HYDROGUI_PrsPolyline()
40 {
41 }
42
43 //================================================================
44 // Function : setPath
45 // Purpose  : 
46 //================================================================
47 void HYDROGUI_PrsPolyline::setPath( const QPainterPath& thePath )
48 {
49   myPath = thePath;
50 }
51
52 //================================================================
53 // Function : getPath
54 // Purpose  : 
55 //================================================================
56 QPainterPath HYDROGUI_PrsPolyline::getPath() const
57 {
58   return myPath;
59 }
60
61 //================================================================
62 // Function : boundingRect
63 // Purpose  : 
64 //================================================================
65 QRectF HYDROGUI_PrsPolyline::boundingRect() const
66 {
67   return myPolylineItem->boundingRect();
68 }
69
70 //================================================================
71 // Function : compute
72 // Purpose  : 
73 //================================================================
74 void HYDROGUI_PrsPolyline::compute()
75 {
76   if( !myPolylineItem )
77   {
78     myPolylineItem = new QGraphicsPathItem( this );
79     addToGroup( myPolylineItem );
80   }
81   myPolylineItem->setPath( myPath );
82 }
83
84 //================================================================
85 // Function : checkHighlight
86 // Purpose  : 
87 //================================================================
88 bool HYDROGUI_PrsPolyline::checkHighlight( double theX, double theY, QCursor& theCursor ) const
89 {
90   // to do
91   return false;
92 }
93
94 //================================================================
95 // Function : select
96 // Purpose  : 
97 //================================================================
98 bool HYDROGUI_PrsPolyline::select( double theX, double theY, const QRectF& theRect )
99 {
100   return GraphicsView_Object::select( theX, theY, theRect );
101 }
102
103 //================================================================
104 // Function : unselect
105 // Purpose  : 
106 //================================================================
107 void HYDROGUI_PrsPolyline::unselect()
108 {
109   GraphicsView_Object::unselect();
110 }
111
112 //================================================================
113 // Function : setSelected
114 // Purpose  : 
115 //================================================================
116 void HYDROGUI_PrsPolyline::setSelected( bool theState )
117 {
118   GraphicsView_Object::setSelected( theState );
119 }