X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageDlg.h;h=2adcb89592d532a9bb874e9e6b2da8494969c923;hb=36005df362d7bee6db949b079960cec90333aed2;hp=18e8b54c66b0f7d44808754e352ea606b9c20ad6;hpb=859543b7cf29f1d56c1dc1aaf4811b22b7b0bf16;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h index 18e8b54c..2adcb895 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h @@ -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 @@ -27,24 +23,47 @@ #include +#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; class QLabel; class QLineEdit; +class QCheckBox; class QtxDoubleSpinBox; class QtxIntSpinBox; +class QAbstractSpinBox; +class QToolButton; class HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel { Q_OBJECT public: - enum TransformationMode { Manual = 0, RefImage }; - -public: - typedef QPair< QPoint, QPointF > TransformationData; + struct TransformationData + { + QPoint ImagePoint; + QPointF GeodesicPoint; + QPointF CartesianPoint; + + TransformationData() {} + + TransformationData( const QPoint& theImagePoint ) : + ImagePoint( theImagePoint ) {} + + TransformationData( const QPoint& theImagePoint, + const QPointF& theGeodesicPoint, + const QPointF& theCartesianPoint ) : + ImagePoint( theImagePoint ), + GeodesicPoint( theGeodesicPoint ), + CartesianPoint( theCartesianPoint ) {} + }; typedef QMap< int, TransformationData > TransformationDataMap; typedef QPair< QString, TransformationDataMap > PrsPointData; @@ -61,11 +80,22 @@ public: void setImageName( const QString& theName ); QString getImageName() const; + void setRefImageName( const QString& theName ); + QString getRefImageName() const; + + QString getFileName() const; + void setFileName( const QString& theName ); + QString getGeoreferencementFileName() const; + void setImageSize( const QSize& theSize, const bool theIsRefImage = false ); + void setTransformationMode( const int theMode ); int getTransformationMode() const; + void setByTwoPoints( const bool theIsByTwoPoints ); + bool isByTwoPoints() const; + void setTransformationDataMap( const TransformationDataMap& theMap, const bool theIsOnlyInput = false, const bool theIsRefImage = false ); @@ -76,12 +106,34 @@ public: void initializePointSelection(); + void ActivateFile( const QString& theFileName, bool isEnableFilesChoice ); + +public: + + static TransformationData ComputeTrsfData( const int theMode, + const QPoint& theLocalPoint, + const QPointF& theGlobalPoint ); + protected slots: void onBrowse(); + void onGeoBrowse(); void onModeActivated( int ); void onRefImageActivated( const QString& ); void onPointBtnToggled( bool ); void onPointCoordChanged( int ); + void onSetCIsUsed( bool theCIsUsed ); + + void onGeodesicCoordChanged(); + void onGeodesicCoordChanged( const int thePointType ); + + void onCartesianCoordChanged(); + void onCartesianCoordChanged( const int thePointType ); + +private: + void clearSpins( QAbstractSpinBox* theSpin ); + bool blockSignalsPoints( const bool theState ); + bool blockSignalsGeodesic( const bool theState ); + bool blockSignalsCartesian( const bool theState ); signals: void createPreview( QImage ); @@ -90,37 +142,49 @@ signals: int thePointType, bool theIsY, 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* myTransformGroup; //!< The group of input contols for points definition + + QButtonGroup* myModeGroup; //!< The group for the input mode selector + QComboBox* myRefImage; //!< Reference image selector + + QLineEdit* myGeoFileName; //!< Image georeferencement file name input field - QGroupBox* myImageNameGroup; - QLineEdit* myImageName; + QList myGeodesicLabels; //!< Labels for geodesic coords input fields - QGroupBox* myTransformGroup; - QButtonGroup* myModeGroup; + QMap myPointBtnMap; //!< A,B,C points selection modes activators + QMap myPointXMap; //!< X coord on the image + QMap myPointYMap; //!< Y coord on the image + QMap myPointXDegMap; //!< Longitude degrees + QMap myPointYDegMap; //!< Latitude degrees + QMap myPointXMinMap; //!< Longitude minutes + QMap myPointYMinMap; //!< Latitude minutes + QMap myPointXSecMap; //!< Longitude seconds + QMap myPointYSecMap; //!< Latitude seconds - QWidget* myRefImageWg; - QComboBox* myRefImage; + QMap myCartPointXMap; //!< Lambert93 (cartesian) X coord (m) + QMap myCartPointYMap; //!< Lambert93 (cartesian) Y coord (m) - QList myLambertLabels; + QMap myRefPointXMap; //!< X coord on the reference image + QMap myRefPointYMap; //!< Y coord on the reference image - QMap myPointBtnMap; - QMap myPointXMap; - QMap myPointYMap; - QMap myPointXDegMap; - QMap myPointYDegMap; - QMap myPointXMinMap; - QMap myPointYMinMap; - QMap myPointXSecMap; - QMap myPointYSecMap; + QCheckBox* myPointCEnabler; //!< Checkbox for enabling definition of the point C - QMap myRefPointXMap; - QMap myRefPointYMap; + PrsPointDataList myPrsPointDataList; //!< Points presentations - PrsPointDataList myPrsPointDataList; + bool myIsInitialized; //!< True if a point selection is activated }; #endif