X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageDlg.h;h=59de8c6c6c89aebb9f4a79710099a1d41ab96bd1;hb=844c6abc897469c996e8df5a1569c3aeaa08c446;hp=752a520182bc83bf16e1b7bfd9a3579db9e932ae;hpb=b475ac9f5ce7ab52045e70fec0c8e6f8ffb51432;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h index 752a5201..59de8c6c 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h @@ -27,17 +27,51 @@ #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 HYDROGUI_ImportImageDlg : public HYDROGUI_InputPanel { Q_OBJECT 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; + typedef QList< PrsPointData > PrsPointDataList; + typedef QListIterator< PrsPointData > PrsPointDataListIterator; + public: HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle ); virtual ~HYDROGUI_ImportImageDlg(); @@ -48,37 +82,99 @@ public: void setImageName( const QString& theName ); QString getImageName() const; + void setRefImageName( const QString& theName ); + QString getRefImageName() const; + + QString getFileName() 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 ); - bool getTransformationDataMap( TransformationDataMap& theMap ) const; + const bool theIsOnlyInput = false, + const bool theIsRefImage = false ); + bool getTransformationDataMap( TransformationDataMap& theMap, + const bool theIsRefImage = false ) const; + + void setPrsPointDataList( const PrsPointDataList& theList ); void initializePointSelection(); +public: + + static TransformationData ComputeTrsfData( const int theMode, + const QPoint& theLocalPoint, + const QPointF& theGlobalPoint ); + protected slots: void onBrowse(); + void onModeActivated( int ); + void onRefImageActivated( const QString& ); void onPointBtnToggled( bool ); + void onPointCoordChanged( int ); + + void onGeodesicCoordChanged(); + void onGeodesicCoordChanged( const int thePointType ); + + void onCartesianCoordChanged(); + void onCartesianCoordChanged( const int thePointType ); + +private: + void blockSignalsGeodesic( const bool theState ); + void blockSignalsCartesian( const bool theState ); signals: void createPreview( QImage ); void activatePointSelection( int ); + void pointCoordChanged( bool theIsRef, + int thePointType, + bool theIsY, + int theValue ); + void modeActivated( int ); + void refImageActivated( const QString& ); + void setIsByTwoPoints( bool theIsByTwoPoints ); private: - QGroupBox* myFileNameGroup; - QLineEdit* myFileName; - - QGroupBox* myImageNameGroup; - QLineEdit* myImageName; - - QGroupBox* myMappingGroup; - QMap myPointBtnMap; - QMap myPointXMap; - QMap myPointYMap; - QMap myPointXDegMap; - QMap myPointYDegMap; - QMap myPointXMinMap; - QMap myPointYMinMap; - QMap myPointXSecMap; - QMap myPointYSecMap; + QGroupBox* myFileNameGroup; //!< The group for the source image file selection + QLineEdit* myFileName; //!< Source image file name input field + + 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 + + QList myGeodesicLabels; //!< Labels for geodesic coords input fields + + 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 + + QMap myCartPointXMap; //!< Lambert93 (cartesian) X coord (m) + QMap myCartPointYMap; //!< Lambert93 (cartesian) Y coord (m) + + QMap myRefPointXMap; //!< X coord on the reference image + QMap myRefPointYMap; //!< Y coord on the reference image + + QCheckBox* myPointCEnabler; //!< Checkbox for enabling definition of the point C + + PrsPointDataList myPrsPointDataList; //!< Points presentations + + bool myIsInitialized; //!< True if a point selection is activated }; #endif