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