Salome HOME
latests developments debug and porting Python3
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageDlg.h
index 3473fdfb89352a94fb21dcf89266895067b08430..8e5e5e9c09a4d4f49005a863f3ede2da4a4a4d08 100644 (file)
@@ -1,12 +1,8 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #define HYDROGUI_IMPORTIMAGEDLG_H
 
 #include "HYDROGUI_InputPanel.h"
+#include <HYDROData_Image.h>
 
 #include <QMap>
 
+#define LAMBERT_X0 700000
+#define LAMBERT_Y0 6600000
+#define LAMBERT_LONG 3
+#define LAMBERT_LATT 46.5
+#define IMG_DELTA 500
+
 class QButtonGroup;
 class QComboBox;
 class QGroupBox;
@@ -36,6 +39,8 @@ class QCheckBox;
 
 class QtxDoubleSpinBox;
 class QtxIntSpinBox;
+class QAbstractSpinBox;
+class QToolButton;
 
 class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel
 {
@@ -45,7 +50,7 @@ public:
   struct TransformationData
   {
     QPoint  ImagePoint;
-    QPointF LambertPoint;
+    QPointF GeodesicPoint;
     QPointF CartesianPoint;
 
     TransformationData() {}
@@ -53,11 +58,11 @@ public:
     TransformationData( const QPoint& theImagePoint ) :
       ImagePoint( theImagePoint ) {}
 
-    TransformationData( const QPoint& theImagePoint,
-                        const QPointF& theLambertPoint,
+    TransformationData( const QPoint&  theImagePoint,
+                        const QPointF& theGeodesicPoint,
                         const QPointF& theCartesianPoint ) :
       ImagePoint( theImagePoint ),
-      LambertPoint( theLambertPoint ),
+      GeodesicPoint( theGeodesicPoint ),
       CartesianPoint( theCartesianPoint ) {}
   };
   typedef QMap< int, TransformationData > TransformationDataMap;
@@ -80,6 +85,8 @@ public:
   QString                    getRefImageName() const;
 
   QString                    getFileName() const;
+  void                       setFileName( const QString& theName );
+  QString                    getGeoreferencementFileName() const;
 
   void                       setImageSize( const QSize& theSize,
                                            const bool theIsRefImage = false );
@@ -100,6 +107,12 @@ public:
 
   void                       initializePointSelection();
 
+
+  void                       ECW_initializePointSelection(HYDROData_Image::ECW_FileInfo* theECW_FileInfo);
+
+
+  void                       ActivateFile( const QString& theFileName, bool isEnableFilesChoice );
+
 public:
 
   static TransformationData  ComputeTrsfData( const int      theMode,
@@ -108,23 +121,27 @@ public:
 
 protected slots:
   void                       onBrowse();
+  void                       onGeoBrowse();
   void                       onModeActivated( int );
   void                       onRefImageActivated( const QString& );
   void                       onPointBtnToggled( bool );
   void                       onPointCoordChanged( int );
+  void                       onSetCIsUsed( bool theCIsUsed );
 
-  void                       onLambertCoordChanged();
-  void                       onLambertCoordChanged( const int thePointType );
+  void                       onGeodesicCoordChanged();
+  void                       onGeodesicCoordChanged( const int thePointType );
 
   void                       onCartesianCoordChanged();
   void                       onCartesianCoordChanged( const int thePointType );
 
 private:
-  void                       blockSignalsLambert( const bool theState );
-  void                       blockSignalsCartesian( const bool theState );
+  void                       clearSpins( QAbstractSpinBox* theSpin );
+  bool                       blockSignalsPoints( const bool theState );
+  bool                       blockSignalsGeodesic( const bool theState );
+  bool                       blockSignalsCartesian( const bool theState );
 
 signals:
-  void                       createPreview( QImage );
+  void                       createPreview( QImage, HYDROData_Image::ECW_FileInfo* );
   void                       activatePointSelection( int );
   void                       pointCoordChanged( bool theIsRef,
                                                 int thePointType,
@@ -132,42 +149,47 @@ signals:
                                                 int theValue );
   void                       modeActivated( int );
   void                       refImageActivated( const QString& );
+  void                       setCIsUsed( bool theIsByTwoPoints );
+  void                       filesSelected( const QStringList& );
 
 private:
-  QGroupBox*                 myFileNameGroup;
-  QLineEdit*                 myFileName;
+  QGroupBox*                   myFileNameGroup;    //!< The group for the source image file selection
+  QLineEdit*                   myFileName;         //!< Source image file name input field
+  QToolButton*                 myBrowseBtn;
+
+  QGroupBox*                   myImageNameGroup;   //!< The group for the image name input field
+  QLineEdit*                   myImageName;        //!< The image name input field
 
-  QGroupBox*                 myImageNameGroup;
-  QLineEdit*                 myImageName;
+  QGroupBox*                   myTransformGroup;   //!< The group of input contols for points definition
 
-  QGroupBox*                 myTransformGroup;
+  QButtonGroup*                myModeGroup;        //!< The group for the input mode selector
+  QComboBox*                   myRefImage;         //!< Reference image selector
 
-  QButtonGroup*              myModeGroup;
-  QComboBox*                 myRefImage;
+  QLineEdit*                   myGeoFileName;      //!< Image georeferencement file name input field
 
-  QList<QLabel*>             myLambertLabels;
+  QList<QLabel*>               myGeodesicLabels;   //!< Labels for geodesic coords input fields
 
-  QMap<int, QPushButton*>    myPointBtnMap;
-  QMap<int, QtxIntSpinBox*>  myPointXMap;
-  QMap<int, QtxIntSpinBox*>  myPointYMap;
-  QMap<int, QtxIntSpinBox*>  myPointXDegMap;
-  QMap<int, QtxIntSpinBox*>  myPointYDegMap;
-  QMap<int, QtxIntSpinBox*>  myPointXMinMap;
-  QMap<int, QtxIntSpinBox*>  myPointYMinMap;
-  QMap<int, QtxDoubleSpinBox*> myPointXSecMap;
-  QMap<int, QtxDoubleSpinBox*> myPointYSecMap;
+  QMap<int, QPushButton*>      myPointBtnMap;      //!< A,B,C points selection modes activators
+  QMap<int, QtxIntSpinBox*>    myPointXMap;        //!< X coord on the image
+  QMap<int, QtxIntSpinBox*>    myPointYMap;        //!< Y coord on the image
+  QMap<int, QtxIntSpinBox*>    myPointXDegMap;     //!< Longitude degrees
+  QMap<int, QtxIntSpinBox*>    myPointYDegMap;     //!< Latitude degrees
+  QMap<int, QtxIntSpinBox*>    myPointXMinMap;     //!< Longitude minutes
+  QMap<int, QtxIntSpinBox*>    myPointYMinMap;     //!< Latitude minutes
+  QMap<int, QtxDoubleSpinBox*> myPointXSecMap;     //!< Longitude seconds
+  QMap<int, QtxDoubleSpinBox*> myPointYSecMap;     //!< Latitude seconds
 
-  QMap<int, QtxDoubleSpinBox*> myCartPointXMap;
-  QMap<int, QtxDoubleSpinBox*> myCartPointYMap;
+  QMap<int, QtxDoubleSpinBox*> myCartPointXMap;    //!< Lambert93 (cartesian) X coord (m)
+  QMap<int, QtxDoubleSpinBox*> myCartPointYMap;    //!< Lambert93 (cartesian) Y coord (m)
 
-  QMap<int, QtxIntSpinBox*>  myRefPointXMap;
-  QMap<int, QtxIntSpinBox*>  myRefPointYMap;
+  QMap<int, QtxIntSpinBox*>    myRefPointXMap;     //!< X coord on the reference image
+  QMap<int, QtxIntSpinBox*>    myRefPointYMap;     //!< Y coord on the reference image
 
-  QCheckBox*                 myPointCEnabler;
+  QCheckBox*                   myPointCEnabler;    //!< Checkbox for enabling definition of the point C
 
-  PrsPointDataList           myPrsPointDataList;
+  PrsPointDataList             myPrsPointDataList; //!< Points presentations
 
-  bool                       myIsInitialized;
+  bool                         myIsInitialized;    //!< True if a point selection is activated
 };
 
 #endif