Salome HOME
Image positioning by two points.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ImportImageOp.h
index 66537e2566b7f42db0fb7e9a9d6fef072a3c43f4..ad45664edab7f1b025326372048b95cc786f8cf8 100644 (file)
 
 #include "HYDROGUI_Operation.h"
 
+#include <HYDROData_Image.h>
+
+#include <QImage>
+
 class GraphicsView_ViewManager;
 
 class SUIT_ViewManager;
@@ -36,30 +40,56 @@ class HYDROGUI_ImportImageOp : public HYDROGUI_Operation
   Q_OBJECT
 
 public:
-  HYDROGUI_ImportImageOp( HYDROGUI_Module* theModule );
+  HYDROGUI_ImportImageOp( HYDROGUI_Module* theModule, const bool theIsEdit );
   virtual ~HYDROGUI_ImportImageOp();
 
 protected:
   virtual void               startOperation();
+  virtual void               abortOperation();
+  virtual void               commitOperation();
 
   virtual HYDROGUI_InputPanel* createInputPanel() const;
 
-protected slots:
-  virtual void               OnApply();
-  virtual void               OnCancel();
+  virtual bool               processApply( int& theUpdateFlags, QString& theErrorMsg );
 
-  void                       onCreatePreview( QString );
+protected slots:
+  void                       onCreatePreview( QImage );
   void                       onActivatePointSelection( int );
+  void                       onPointCoordChanged( bool, int, bool, int );
+  void                       onModeActivated( int );
+  void                       onRefImageActivated( const QString& );
+
+  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;
 
 private:
-  SUIT_ViewManager*          myActiveViewManager;
+  bool                       myIsEdit;
+  Handle(HYDROData_Image)    myEditedObject;
+
+  SUIT_ViewManager*          myActiveViewManager;  //!< The previous view to come back to after the operation
+
+  GraphicsView_ViewManager*  myPreviewViewManager; //!< The operation preview window
+  GraphicsView_ViewManager*  myRefViewManager;     //!< The reference image view window
+  HYDROGUI_PrsImage*         myPreviewPrs;         //!< The loaded image preview presentation
+  HYDROGUI_PrsImage*         myRefPreviewPrs;      //!< The reference image presentation
 
-  GraphicsView_ViewManager*  myPreviewViewManager;
-  HYDROGUI_PrsImage*         myPreviewPrs;
+  QImage                     myImage;              //!< The loaded image to import
 
   int                        myPointType;
 };