X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageOp.h;h=0acdd0bc9b7aa8ab8ffb01817f67747708ca3302;hb=a4583c5dce2b21c67fb215131ff02243ca4811f1;hp=c931a9dac71b1a0bf00fa663ca64bf0e42779abd;hpb=8138ea79ff2b25c45aa08124d6c6c7214dccbdc2;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.h b/src/HYDROGUI/HYDROGUI_ImportImageOp.h index c931a9da..0acdd0bc 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.h +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.h @@ -24,15 +24,14 @@ #define HYDROGUI_IMPORTIMAGEOP_H #include "HYDROGUI_Operation.h" +#include "HYDROGUI_ImportImageDlg.h" #include #include class GraphicsView_ViewManager; - class SUIT_ViewManager; - class HYDROGUI_PrsImage; class HYDROGUI_ImportImageOp : public HYDROGUI_Operation @@ -51,23 +50,65 @@ protected: virtual HYDROGUI_InputPanel* createInputPanel() const; virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg ); + bool isReferenceCorrect() const; protected slots: + virtual void onApply(); + void onCreatePreview( QImage ); void onActivatePointSelection( int ); void onPointCoordChanged( bool, int, bool, int ); void onModeActivated( int ); void onRefImageActivated( const QString& ); + void onSetCIsUsed( bool theCIsUsed ); void onLastViewClosed( SUIT_ViewManager* ); void onPointSelected(); + void onRefPointSelected(); void onPointSelected( bool theIsRefImage ); private: void closePreview(); void closeView( GraphicsView_ViewManager* &aViewMgr ); + bool checkPoints( const QPointF& thePointA, + const QPointF& thePointB, + const QPointF& thePointC, + const bool theIsByTwoPoints, + const QString& theLineErrMsg, + const QString& thePoinErrMsg, + QString& theErrorMsg, + const bool theIsToCheckInvertibles ) const; + + /** + * Build the local-global points mapping. + */ + void computeTrsfData( HYDROData_Image::TransformationMode theTrsfMode, + bool theIsByTwoPoints, + const QPoint& theLocalPointA, + const QPoint& theLocalPointB, + const QPoint& theLocalPointC, + const QPointF& theGlobalPointA, + const QPointF& theGlobalPointB, + const QPointF& theGlobalPointC, + HYDROGUI_ImportImageDlg::TransformationDataMap& theDataMap ) const; + + /** + * Set transformation points A,B,C to the image presentation. + */ + void setPresentationTrsfPoints( HYDROGUI_PrsImage* thePrs, + bool theIsByTwoPoints, + const QPoint theLocalPointA, + const QPoint theLocalPointB, + const QPoint theLocalPointC ); + + /* + * Initialize the combobox in the dialog with the list of available reference images + */ + void getReferenceDataList( + HYDROGUI_ImportImageDlg::PrsPointDataList& theList ) const; + private: bool myIsEdit; Handle(HYDROData_Image) myEditedObject; @@ -80,7 +121,6 @@ private: HYDROGUI_PrsImage* myRefPreviewPrs; //!< The reference image presentation QImage myImage; //!< The loaded image to import - QTransform myRefTransform; //!< The loaded image transformation int myPointType; };