Salome HOME
Drawing of zones in OCC view improved.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageDlg.h
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..284f2999cd649338745e31d370ac500c2df1aae9 100644 (file)
@@ -0,0 +1,128 @@
+// 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
+//
+// 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.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_IMPORTIMAGEDLG_H
+#define HYDROGUI_IMPORTIMAGEDLG_H
+
+#include "HYDROGUI_InputPanel.h"
+
+#include <QMap>
+
+class QButtonGroup;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+
+class QtxDoubleSpinBox;
+class QtxIntSpinBox;
+
+class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  enum TransformationMode { Manual = 0, RefImage };
+
+public:
+  typedef QPair< QPoint, QPointF >        TransformationData;
+  typedef QMap< int, TransformationData > TransformationDataMap;
+
+  typedef QPair< QString, TransformationDataMap > PrsPointData;
+  typedef QList< PrsPointData >                   PrsPointDataList;
+  typedef QListIterator< PrsPointData >           PrsPointDataListIterator;
+
+public:
+  HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_ImportImageDlg();
+
+  void                       setIsEdit( const bool theIsEdit );
+  void                       reset();
+
+  void                       setImageName( const QString& theName );
+  QString                    getImageName() const;
+
+  QString                    getFileName() const;
+
+  void                       setImageSize( const QSize& theSize,
+                                           const bool theIsRefImage = false );
+
+  int                        getTransformationMode() const;
+
+  void                       setTransformationDataMap( const TransformationDataMap& theMap,
+                                                       const bool theIsOnlyInput = false,
+                                                       const bool theIsRefImage = false );
+  bool                       getTransformationDataMap( TransformationDataMap& theMap,
+                                                       const bool theIsRefImage = false ) const;
+
+  void                       setPrsPointDataList( const PrsPointDataList& theList );
+
+  void                       initializePointSelection();
+
+protected slots:
+  void                       onBrowse();
+  void                       onModeActivated( int );
+  void                       onRefImageActivated( const QString& );
+  void                       onPointBtnToggled( bool );
+  void                       onPointCoordChanged( int );
+
+signals:
+  void                       createPreview( QImage );
+  void                       activatePointSelection( int );
+  void                       pointCoordChanged( bool theIsRef,
+                                                int thePointType,
+                                                bool theIsY,
+                                                int theValue );
+  void                       refImageActivated( const QString& );
+
+private:
+  QGroupBox*                 myFileNameGroup;
+  QLineEdit*                 myFileName;
+
+  QGroupBox*                 myImageNameGroup;
+  QLineEdit*                 myImageName;
+
+  QGroupBox*                 myTransformGroup;
+  QButtonGroup*              myModeGroup;
+
+  QWidget*                   myRefImageWg;
+  QComboBox*                 myRefImage;
+
+  QList<QLabel*>             myLambertLabels;
+
+  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, QtxIntSpinBox*>  myRefPointXMap;
+  QMap<int, QtxIntSpinBox*>  myRefPointYMap;
+
+  PrsPointDataList           myPrsPointDataList;
+};
+
+#endif