Salome HOME
Merge branch 'BR_H2018_2' of https://codev-tuleap.cea.fr/plugins/git/salome/hydro...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_MeasurementToolOp.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROGUI_MEASUREMENTTOOLOP_H
20 #define HYDROGUI_MEASUREMENTTOOLOP_H
21
22 #include "HYDROGUI_Operation.h"
23
24 #include <HYDROData_Entity.h>
25 #include <TopoDS_Wire.hxx>
26 #include <AIS_Shape.hxx>
27
28 class HYDROGUI_MeasurementToolDlg;
29 class QMouseEvent;
30 class SUIT_ViewWindow;
31 class HYDROData_PolylineXY;
32 class BRepLib_MakePolygon;
33
34 class HYDROGUI_MeasurementToolOp : public HYDROGUI_Operation
35 {
36   Q_OBJECT
37
38 public:
39   HYDROGUI_MeasurementToolOp( HYDROGUI_Module* theModule );
40   virtual ~HYDROGUI_MeasurementToolOp();
41
42 protected:
43   virtual void startOperation();
44   virtual void abortOperation();
45
46 protected slots:
47   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
48   void onClearLine();
49   void onExit();
50
51 private:
52   void eraseLine();
53
54 private:
55
56   Handle(AIS_Shape) myAISLineM;
57   BRepLib_MakePolygon* myLineMaker; 
58   HYDROGUI_MeasurementToolDlg* myMeasDlg;
59   double myDist;
60   TopoDS_Wire myFW;
61   double myFu;
62   std::vector<Handle(HYDROData_PolylineXY)> myPolyObjs;
63
64 };
65
66 #endif