Salome HOME
Merge remote-tracking branch 'origin/BR_IMPROVEMENTS' into BR_v14_rc
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_GeoreferencementDlg.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
20 #ifndef HYDROGUI_GEOREFERENCEMENT_H
21 #define HYDROGUI_GEOREFERENCEMENT_H
22
23 #include "HYDROGUI_InputPanel.h"
24
25 class SUIT_ViewWindow;
26
27 class QGroupBox;
28 class QButtonGroup;
29 class QTableWidget;
30 class QPushButton;
31
32 class HYDROGUI_GeoreferencementDlg : public HYDROGUI_InputPanel
33 {
34   Q_OBJECT
35
36   class Delegate;
37
38 public:
39   enum ProfilesMode { AllProfiles, SelectedProfiles };
40
41   struct ProfileGeoData
42   {
43     double Xg;
44     double Yg;
45     double Xd;
46     double Yd;
47
48     bool isIncomplete, isEmpty;
49
50     QString Name;
51
52     ProfileGeoData( const QString& theName ) :
53       Name( theName ), isEmpty( true ), isIncomplete( false ) {}
54
55     ProfileGeoData( const QString& theName,
56                     const QString& theXg, const QString& theYg, 
57                     const QString& theXd, const QString& theYd );
58
59     ProfileGeoData( const QString& theName,
60                     double theXg, double theYg, 
61                     double theXd, double theYd )
62       : Name( theName ), Xg( theXg ), Yg( theYg ), Xd( theXd ), Yd( theYd ),
63       isIncomplete(false), isEmpty(false) {}
64   };
65   typedef QList<ProfileGeoData> ProfilesGeoDataList;
66
67 public:
68   HYDROGUI_GeoreferencementDlg( HYDROGUI_Module* theModule, const QString& theTitle );
69   virtual ~HYDROGUI_GeoreferencementDlg();
70
71   void                       reset();
72
73   void                       setMode( const int theMode );
74
75   void                       setData( const ProfilesGeoDataList& theData );
76   void                       getData( ProfilesGeoDataList& theData ) const;
77
78   bool                       isModified() const;
79
80 public slots:
81   void                       onMousePress( SUIT_ViewWindow*, QMouseEvent* );
82
83 protected slots:
84   void                       onModeActivated( int );
85   void                       onDataChanged();
86
87 signals:
88   void                       modeActivated( int );
89   void                       updateSelection();
90
91 private:
92   QButtonGroup* myModeButtons;
93   QPushButton* myUpdateSelBtn;
94   QTableWidget* myTable;
95
96   bool myIsModified;
97 };
98
99 #endif