X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageDlg.h;h=3473fdfb89352a94fb21dcf89266895067b08430;hb=5cae7e874afd2fc1b6f61023e8ebd33a933db3c7;hp=a1dcbda55f2fde8a127b3dd1d827f2e10dfa33fc;hpb=2c7a183c127b169bf0d08c30d493d66f2bd8465f;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h index a1dcbda5..3473fdfb 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageDlg.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageDlg.h @@ -27,17 +27,45 @@ #include +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 LambertPoint; + QPointF CartesianPoint; + + TransformationData() {} + + TransformationData( const QPoint& theImagePoint ) : + ImagePoint( theImagePoint ) {} + + 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; + typedef QList< PrsPointData > PrsPointDataList; + typedef QListIterator< PrsPointData > PrsPointDataListIterator; + public: HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle ); virtual ~HYDROGUI_ImportImageDlg(); @@ -45,34 +73,101 @@ public: void setIsEdit( const bool theIsEdit ); void reset(); + 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 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 ); + void pointCoordChanged( bool theIsRef, + int thePointType, + bool theIsY, + int theValue ); + void modeActivated( int ); + void refImageActivated( const QString& ); private: - QGroupBox* myFileGroup; + QGroupBox* myFileNameGroup; QLineEdit* myFileName; - QGroupBox* myMappingGroup; + QGroupBox* myImageNameGroup; + QLineEdit* myImageName; + + QGroupBox* myTransformGroup; + + QButtonGroup* myModeGroup; + QComboBox* myRefImage; + + QList myLambertLabels; + QMap myPointBtnMap; - QMap myPointXMap; - QMap myPointYMap; - QMap myPointXDegMap; - QMap myPointYDegMap; - QMap myPointXMinMap; - QMap myPointYMinMap; - QMap myPointXSecMap; - QMap myPointYSecMap; + QMap myPointXMap; + QMap myPointYMap; + QMap myPointXDegMap; + QMap myPointYDegMap; + QMap myPointXMinMap; + QMap myPointYMinMap; + QMap myPointXSecMap; + QMap myPointYSecMap; + + QMap myCartPointXMap; + QMap myCartPointYMap; + + QMap myRefPointXMap; + QMap myRefPointYMap; + + QCheckBox* myPointCEnabler; + + PrsPointDataList myPrsPointDataList; + + bool myIsInitialized; }; #endif