1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "HYDROGUI_PrsPolyline.h"
25 //=======================================================================
26 // name : HYDROGUI_PrsPolyline
27 // Purpose : Constructor
28 //=======================================================================
29 HYDROGUI_PrsPolyline::HYDROGUI_PrsPolyline( const Handle(HYDROData_Object)& theObject )
30 : HYDROGUI_Prs( theObject ),
35 //=======================================================================
36 // name : HYDROGUI_PrsPolyline
37 // Purpose : Destructor
38 //=======================================================================
39 HYDROGUI_PrsPolyline::~HYDROGUI_PrsPolyline()
43 //================================================================
46 //================================================================
47 void HYDROGUI_PrsPolyline::setPath( const QPainterPath& thePath )
52 //================================================================
55 //================================================================
56 QPainterPath HYDROGUI_PrsPolyline::getPath() const
61 //================================================================
62 // Function : boundingRect
64 //================================================================
65 QRectF HYDROGUI_PrsPolyline::boundingRect() const
67 return myPolylineItem->boundingRect();
70 //================================================================
73 //================================================================
74 void HYDROGUI_PrsPolyline::compute()
78 myPolylineItem = new QGraphicsPathItem( this );
79 addToGroup( myPolylineItem );
81 myPolylineItem->setPath( myPath );
84 //================================================================
85 // Function : checkHighlight
87 //================================================================
88 bool HYDROGUI_PrsPolyline::checkHighlight( double theX, double theY, QCursor& theCursor ) const
94 //================================================================
97 //================================================================
98 bool HYDROGUI_PrsPolyline::select( double theX, double theY, const QRectF& theRect )
100 return GraphicsView_Object::select( theX, theY, theRect );
103 //================================================================
104 // Function : unselect
106 //================================================================
107 void HYDROGUI_PrsPolyline::unselect()
109 GraphicsView_Object::unselect();
112 //================================================================
113 // Function : setSelected
115 //================================================================
116 void HYDROGUI_PrsPolyline::setSelected( bool theState )
118 GraphicsView_Object::setSelected( theState );