]> SALOME platform Git repositories - modules/hydro.git/blobdiff - src/HYDROGUI/HYDROGUI_ImportImageDlg.h
Salome HOME
Name validator is added to the Calculation Case dialog.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageDlg.h
index 284f2999cd649338745e31d370ac500c2df1aae9..8823389061318ba782c955bbc0b022c5d158648c 100644 (file)
@@ -32,6 +32,7 @@ class QComboBox;
 class QGroupBox;
 class QLabel;
 class QLineEdit;
+class QCheckBox;
 
 class QtxDoubleSpinBox;
 class QtxIntSpinBox;
@@ -41,10 +42,24 @@ class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel
   Q_OBJECT
 
 public:
-  enum TransformationMode { Manual = 0, RefImage };
+  enum TransformationMode { ManualLambert = 0, ManualCartesian, RefImage };
 
 public:
-  typedef QPair< QPoint, QPointF >        TransformationData;
+  struct TransformationData
+  {
+    QPoint  ImagePoint;
+    QPointF LambertPoint;
+    QPointF CartesianPoint;
+
+    TransformationData() {}
+
+    TransformationData( const QPoint& theImagePoint,
+                        const QPointF& theLambertPoint,
+                        const QPointF& theCartesianPoint ) :
+      ImagePoint( theImagePoint ),
+      LambertPoint( theLambertPoint ),
+      CartesianPoint( theCartesianPoint ) {}
+  };
   typedef QMap< int, TransformationData > TransformationDataMap;
 
   typedef QPair< QString, TransformationDataMap > PrsPointData;
@@ -66,6 +81,7 @@ public:
   void                       setImageSize( const QSize& theSize,
                                            const bool theIsRefImage = false );
 
+  void                       setTransformationMode( const int theMode );
   int                        getTransformationMode() const;
 
   void                       setTransformationDataMap( const TransformationDataMap& theMap,
@@ -74,6 +90,8 @@ public:
   bool                       getTransformationDataMap( TransformationDataMap& theMap,
                                                        const bool theIsRefImage = false ) const;
 
+  QString                    getRefImageName() const;
+
   void                       setPrsPointDataList( const PrsPointDataList& theList );
 
   void                       initializePointSelection();
@@ -85,6 +103,16 @@ protected slots:
   void                       onPointBtnToggled( bool );
   void                       onPointCoordChanged( int );
 
+  void                       onLambertCoordChanged();
+  void                       onLambertCoordChanged( const int thePointType );
+
+  void                       onCartesianCoordChanged();
+  void                       onCartesianCoordChanged( const int thePointType );
+
+private:
+  void                       blockSignalsLambert( const bool theState );
+  void                       blockSignalsCartesian( const bool theState );
+
 signals:
   void                       createPreview( QImage );
   void                       activatePointSelection( int );
@@ -92,6 +120,7 @@ signals:
                                                 int thePointType,
                                                 bool theIsY,
                                                 int theValue );
+  void                       modeActivated( int );
   void                       refImageActivated( const QString& );
 
 private:
@@ -102,9 +131,8 @@ private:
   QLineEdit*                 myImageName;
 
   QGroupBox*                 myTransformGroup;
-  QButtonGroup*              myModeGroup;
 
-  QWidget*                   myRefImageWg;
+  QButtonGroup*              myModeGroup;
   QComboBox*                 myRefImage;
 
   QList<QLabel*>             myLambertLabels;
@@ -119,10 +147,17 @@ private:
   QMap<int, QtxDoubleSpinBox*> myPointXSecMap;
   QMap<int, QtxDoubleSpinBox*> myPointYSecMap;
 
+  QMap<int, QtxDoubleSpinBox*> myCartPointXMap;
+  QMap<int, QtxDoubleSpinBox*> myCartPointYMap;
+
   QMap<int, QtxIntSpinBox*>  myRefPointXMap;
   QMap<int, QtxIntSpinBox*>  myRefPointYMap;
 
+  QCheckBox*                 myPointCEnabler;
+
   PrsPointDataList           myPrsPointDataList;
+
+  bool                       myIsInitialized;
 };
 
 #endif