]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
HYDRO feature 3: Crop image (T 1.3)
authorouv <ouv@opencascade.com>
Wed, 11 Sep 2013 06:29:40 +0000 (06:29 +0000)
committerouv <ouv@opencascade.com>
Wed, 11 Sep 2013 06:29:40 +0000 (06:29 +0000)
16 files changed:
src/HYDROData/HYDROData_Image.cxx
src/HYDROData/HYDROData_Image.h
src/HYDROData/HYDROData_Polyline.cxx
src/HYDROData/HYDROOperations_Factory.cxx
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_ObjSelector.cxx
src/HYDROGUI/HYDROGUI_ObjSelector.h
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_Tool.cxx
src/HYDROGUI/HYDROGUI_TwoImagesDlg.cxx
src/HYDROGUI/HYDROGUI_TwoImagesDlg.h
src/HYDROGUI/HYDROGUI_TwoImagesOp.cxx
src/HYDROGUI/HYDROGUI_TwoImagesOp.h
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 4dcb9e174cc6e77d56a7eeb2514dcd0c8c29096e..88650062dc8ee423ba9f017cf6661675e6a386e5 100644 (file)
@@ -17,6 +17,7 @@
 #include <QStringList>
 
 static const Standard_GUID GUID_MUST_BE_UPDATED("80f2bb81-3873-4631-8ddd-940d2119f000");
+static const Standard_GUID GUID_SELF_SPLITTED("997995aa-5c19-40bf-9a60-ab4b70ad04d8");
 
 #define PYTHON_IMAGE_ID "1"
 
@@ -91,7 +92,7 @@ QStringList HYDROData_Image::DumpToPython( MapOfTreatedObjects& theTreatedObject
 
       for ( int i = 0; i < aNbReferences; ++i )
       {
-        Handle(HYDROData_Image) aRefImg = Reference( i );
+        Handle(HYDROData_Image) aRefImg = Handle(HYDROData_Image)::DownCast( Reference( i ) );
         if ( aRefImg.IsNull() )
           continue;
 
@@ -302,7 +303,13 @@ void HYDROData_Image::TrsfPoints(QPoint& thePointAIn,
   }
 }
 
-void HYDROData_Image::AppendReference(Handle(HYDROData_Image) theReferenced)
+bool HYDROData_Image::HasTrsfPoints() const
+{
+  Handle(TDataStd_RealArray) anArray;
+  return myLab.FindChild(DataTag_TrsfPoints).FindAttribute(TDataStd_RealArray::GetID(), anArray);
+}
+
+void HYDROData_Image::AppendReference(Handle(HYDROData_Object) theReferenced)
 {
   Handle(TDataStd_ReferenceList) aRefs;
   if (!myLab.FindAttribute(TDataStd_ReferenceList::GetID(), aRefs))
@@ -318,22 +325,22 @@ int HYDROData_Image::NbReferences() const
   return aRefs->Extent();
 }
 
-Handle(HYDROData_Image) HYDROData_Image::Reference(const int theIndex) const
+Handle(HYDROData_Object) HYDROData_Image::Reference(const int theIndex) const
 {
   Handle(TDataStd_ReferenceList) aRefs;
   if (!myLab.FindAttribute(TDataStd_ReferenceList::GetID(), aRefs))
-    return Handle(HYDROData_Image)();
+    return Handle(HYDROData_Object)();
   if (theIndex < 0 || theIndex >= aRefs->Extent())
-    return Handle(HYDROData_Image)();
+    return Handle(HYDROData_Object)();
 
   TDF_ListIteratorOfLabelList anIter(aRefs->List());
   for(int anIndex = 0; anIndex != theIndex; anIter.Next(), anIndex++);
   const TDF_Label& aRefLab = anIter.Value();
-  return Handle(HYDROData_Image)::DownCast(HYDROData_Iterator::Object(aRefLab));
+  return Handle(HYDROData_Object)::DownCast(HYDROData_Iterator::Object(aRefLab));
 }
 
 void HYDROData_Image::ChangeReference(
-    const int theIndex, Handle(HYDROData_Image) theReferenced)
+    const int theIndex, Handle(HYDROData_Object) theReferenced)
 {
   Handle(TDataStd_ReferenceList) aRefs;
   if (!myLab.FindAttribute(TDataStd_ReferenceList::GetID(), aRefs))
@@ -415,7 +422,21 @@ void HYDROData_Image::MustBeUpdated(bool theFlag)
   }
 }
 
-bool HYDROData_Image::MustBeUpdated()
+bool HYDROData_Image::MustBeUpdated() const
 {
   return myLab.IsAttribute(GUID_MUST_BE_UPDATED);
 }
+
+void HYDROData_Image::SetIsSelfSplitted(bool theFlag)
+{
+  if (theFlag) {
+    TDataStd_UAttribute::Set(myLab, GUID_SELF_SPLITTED);
+  } else {
+    myLab.ForgetAttribute(GUID_SELF_SPLITTED);
+  }
+}
+
+bool HYDROData_Image::IsSelfSplitted() const
+{
+  return myLab.IsAttribute(GUID_SELF_SPLITTED);
+}
index b9db13c6bde1ea88c4ecff3cdca7305ac19896a1..4966616e7626a22b5349bfe9bc49d17960f392b4 100644 (file)
@@ -112,14 +112,16 @@ public:
                                    QPointF& thePointBOut,
                                    QPointF& thePointCOut) const;
 
+  HYDRODATA_EXPORT bool HasTrsfPoints() const;
+
   /**
-   * Appends reference to other image.
-   * \param theReferenced the image referenced by this
+   * Appends reference to other object (image or polyline).
+   * \param theReferenced the object referenced by this
    */
-  HYDRODATA_EXPORT void AppendReference(Handle(HYDROData_Image) theReferenced);
+  HYDRODATA_EXPORT void AppendReference(Handle(HYDROData_Object) theReferenced);
 
   /**
-   * Returns the number of referenced images
+   * Returns the number of referenced objects
    * \return zero if there is no references
    */
   HYDRODATA_EXPORT int NbReferences() const;
@@ -127,18 +129,18 @@ public:
   /**
    * Returns reference by index.
    * \param theIndex number of reference [0; NbReference)
-   * \returns the referenced image, or Null if index is invalid
+   * \returns the referenced object, or Null if index is invalid
    */
-  HYDRODATA_EXPORT Handle(HYDROData_Image) Reference(const int theIndex) const;
+  HYDRODATA_EXPORT Handle(HYDROData_Object) Reference(const int theIndex) const;
 
   /**
    * Updates reference by index. If index is one-bigger than \a NbReferences, 
    * this method appends it to the end (NbReferences is incremented).
    * \param theIndex number of reference [0; NbReference]
-   * \param theReferenced the image referenced by this
+   * \param theReferenced the object referenced by this
    */
   HYDRODATA_EXPORT void ChangeReference(
-    const int theIndex, Handle(HYDROData_Image) theReferenced);
+    const int theIndex, Handle(HYDROData_Object) theReferenced);
 
   /**
    * Removes reference by index
@@ -185,7 +187,19 @@ public:
    * Returns the "MustBeUpdated" flag: is image must be recomputed or not
    * \returns false if image is up to date
    */
-  HYDRODATA_EXPORT bool MustBeUpdated();
+  HYDRODATA_EXPORT bool MustBeUpdated() const;
+
+  /**
+   * Marks the image as self-splitted.
+   * \param theFlag is true for self-splitted image
+   */
+  HYDRODATA_EXPORT void SetIsSelfSplitted(bool theFlag);
+
+  /**
+   * Checks that the image is self-splitted.
+   * \returns true if image is self-splitted
+   */
+  HYDRODATA_EXPORT bool IsSelfSplitted() const;
 
 protected:
 
index 34ebfe25c64a5a22658195e83d5c3b5f85e6092d..4360cc15e5bd2eb3704798741bff72f06b1365ec 100755 (executable)
@@ -202,10 +202,10 @@ QPainterPath HYDROData_Polyline::painterPath()
 {
   QPainterPath aPath;
   int aDim = getDimension();
-  if( ( aDim != 2 ) || ( aDim != 3) )
+  if( ( aDim != 2 ) && ( aDim != 3) )
       return aPath;
   QList<PolylineSection> aSects = getPolylineData();
-  for( int i = 0 ; aSects.size() ; i++ ){
+  for( int i = 0 ; i < aSects.size() ; i++ ){
     int aPntCnt = aSects[i].myCoords.size()/aDim;
     if( aPntCnt ){
       aPath.moveTo(aSects[i].myCoords[0], aSects[i].myCoords[1] );
index bfbfbdbf32df934e01e4ac44b1a0528eb804c4c3..c4fff685724e5dbd3441769175467ea4c8b0d78c 100644 (file)
@@ -81,16 +81,24 @@ void HYDROOperations_Factory::UpdateImage(
     QTransform aTransform;
     ImageComposer_Image anImage1; // first referenced image
     if (theImage->NbReferences()) {
-      Handle(HYDROData_Image) anImage = theImage->Reference(0);
-      anImage1 = anImage->Image();
-      anImage1.setTransform(anImage->Trsf());
-      aTransform = anImage1.transform();
+      Handle(HYDROData_Image) anImage =
+        Handle(HYDROData_Image)::DownCast( theImage->Reference(0) );
+      if( !anImage.IsNull() )
+      {
+        anImage1 = anImage->Image();
+        anImage1.setTransform(anImage->Trsf());
+        aTransform = anImage1.transform();
+      }
     }
     ImageComposer_Image anImage2; // second referenced image
     if (theImage->NbReferences() > 1) {
-      Handle(HYDROData_Image) anImage = theImage->Reference(1);
-      anImage2 = anImage->Image();
-      anImage2.setTransform(anImage->Trsf());
+      Handle(HYDROData_Image) anImage =
+        Handle(HYDROData_Image)::DownCast( theImage->Reference(1) );
+      if( !anImage.IsNull() )
+      {
+        anImage2 = anImage->Image();
+        anImage2.setTransform(anImage->Trsf());
+      }
     }
     ImageComposer_Image aResImg = anOp->process(anImage1, anImage2);
     theImage->SetImage(aResImg);
@@ -116,7 +124,9 @@ void HYDROOperations_Factory::SetMustBeUpdatedImages(
       if (!anImage->MustBeUpdated()) {
         int a, aNBRefs = anImage->NbReferences();
         for(a = 0; a < aNBRefs; a++) {
-          if (anImage->Reference(a)->MustBeUpdated()) {
+          Handle(HYDROData_Image) aRefImage =
+            Handle(HYDROData_Image)::DownCast(anImage->Reference(a));
+          if (!aRefImage.IsNull() && aRefImage->MustBeUpdated()) {
              // image references to updated => also must be updated
              anImage->MustBeUpdated(true);
              aChanged = true;
index 0991095322c92b49950f6d8d1de81d722096d64c..e72d9488163a46cac9d7c3e38bcad4d7852a9836 100644 (file)
@@ -229,9 +229,9 @@ void HYDROGUI_DataModel::update( const int theStudyId )
       {
         for( int anIndex = 0, aNbRef = anImageObj->NbReferences(); anIndex < aNbRef; anIndex++ )
         {
-          Handle(HYDROData_Image) aRefImageObj = anImageObj->Reference( anIndex );
-          if( !aRefImageObj.IsNull() && !aRefImageObj->IsRemoved() )
-            createObject( anImageDataObj, aRefImageObj, anImageDataObj->entry() );
+          Handle(HYDROData_Object) aRefObj = anImageObj->Reference( anIndex );
+          if( !aRefObj.IsNull() && !aRefObj->IsRemoved() )
+            createObject( anImageDataObj, aRefObj, anImageDataObj->entry() );
         }
       }
     }
index c436594d9192a536fec78d1c26fbd8b50dcebfe8..33a57e03eb449a17c8dd74c74e5974030b5dc485 100644 (file)
 
 #include <HYDROData_Image.h>
 
+#include <HYDROOperations_Factory.h>
+
 #include <GraphicsView_ViewFrame.h>
 #include <GraphicsView_ViewManager.h>
 #include <GraphicsView_ViewPort.h>
 #include <GraphicsView_Viewer.h>
 
+#include <ImageComposer_CutOperator.h>
+#include <ImageComposer_CropOperator.h>
+#include <ImageComposer_FuseOperator.h>
+
 #include <LightApp_Application.h>
 #include <LightApp_GVSelector.h>
 #include <LightApp_SelectionMgr.h>
@@ -150,7 +156,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   bool anIsHiddenInSelection = false;
 
   bool anIsImage = false;
+  bool anIsImportedImage = false;
   bool anIsCompositeImage = false;
+  bool anIsFusedImage = false;
+  bool anIsCutImage = false;
+  bool anIsSplittedImage = false;
   bool anIsMustBeUpdatedImage = false;
   bool anIsPolyline = false;
   bool anIsVisualState = false;
@@ -173,7 +183,20 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast( anObject );
         if( !anImage.IsNull() )
         {
+          anIsImportedImage = anImage->HasTrsfPoints() && !anImage->IsSelfSplitted();
           anIsCompositeImage = anImage->NbReferences() > 0;
+          if( HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory() )
+          {
+            if( ImageComposer_Operator* anOperator = aFactory->Operator( anImage ) )
+            {
+              if( dynamic_cast<ImageComposer_FuseOperator*>( anOperator ) )
+                anIsFusedImage = true;
+              else if( dynamic_cast<ImageComposer_CutOperator*>( anOperator ) )
+                anIsCutImage = true;
+              else if( dynamic_cast<ImageComposer_CropOperator*>( anOperator ) )
+                anIsSplittedImage = true;
+            }
+          }
           anIsMustBeUpdatedImage = anImage->MustBeUpdated();
         }
       }
@@ -200,7 +223,18 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   {
     if( anIsImage )
     {
-      theMenu->addAction( action( anIsCompositeImage ? EditCompositeImageId : EditImportedImageId ) );
+      if( anIsImportedImage )
+        theMenu->addAction( action( EditImportedImageId ) );
+      else if( anIsCompositeImage )
+      {
+        if( anIsFusedImage )
+          theMenu->addAction( action( EditFusedImageId ) );
+        else if( anIsCutImage )
+          theMenu->addAction( action( EditCutImageId ) );
+        else if( anIsSplittedImage )
+          theMenu->addAction( action( EditSplittedImageId ) );
+      }
+
       theMenu->addAction( action( ObserveImageId ) );
       theMenu->addAction( action( ExportImageId ) );
       theMenu->addSeparator();
index 04bd20f0c0c4d67f5386a436cfe388b0278763d3..f97212a04ae532b222dc4ef024fcceb7530c43e8 100644 (file)
 #include <QLineEdit>
 #include <QToolButton>
 
-HYDROGUI_ObjSelector::HYDROGUI_ObjSelector( HYDROGUI_Module* theModule, QWidget* theParent )
-: QAbstractButton( theParent ), myModule( theModule )
+HYDROGUI_ObjSelector::HYDROGUI_ObjSelector( HYDROGUI_Module* theModule,
+                                            const ObjectKind theObjectKind,
+                                            QWidget* theParent )
+: QAbstractButton( theParent ),
+  myObjectKind( theObjectKind ),
+  myModule( theModule )
 {
   QHBoxLayout* aLayout = new QHBoxLayout( this );
   aLayout->setMargin( 0 );
@@ -97,7 +101,8 @@ void HYDROGUI_ObjSelector::OnSelectionChanged()
   QString anObjName;
   Handle(HYDROData_Object) anObject = HYDROGUI_Tool::GetSelectedObject( myModule );
   if( !anObject.IsNull() )
-    anObjName = anObject->GetName();
+    if( myObjectKind == KIND_UNKNOWN || myObjectKind == anObject->GetKind() )
+      anObjName = anObject->GetName();
 
   SetName( anObjName );
 }
index f3853d741e36cbc57b82c68f52eb36c7005b206b..ba1ff514f8a0f8994ff96846513edf3aaa845053 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef HYDROGUI_OBJSELECTOR_H
 #define HYDROGUI_OBJSELECTOR_H
 
+#include <HYDROData_Object.h>
+
 #include <QAbstractButton>
 
 class QToolButton;
@@ -34,7 +36,9 @@ class HYDROGUI_ObjSelector : public QAbstractButton
   Q_OBJECT
 
 public:
-  HYDROGUI_ObjSelector( HYDROGUI_Module* theModule, QWidget* theParent );
+  HYDROGUI_ObjSelector( HYDROGUI_Module* theModule,
+                        const ObjectKind theObjectKind,
+                        QWidget* theParent );
   virtual ~HYDROGUI_ObjSelector();
 
   void Clear();
@@ -52,6 +56,8 @@ protected slots:
 
 private:
   HYDROGUI_Module* myModule;
+  ObjectKind myObjectKind;
+
   QToolButton* myBtn;
   QLineEdit* myObjName;
 };
index e5e3ea7788b1f6cccb76381d5693f5f83325ed65..5a9529fca20455c44fa3490e4f1594fec3f8281d 100644 (file)
@@ -72,7 +72,6 @@ void HYDROGUI_Module::createActions()
 
   createAction( ImportImageId, "IMPORT_IMAGE", "", Qt::CTRL + Qt::Key_I );
   createAction( EditImportedImageId, "EDIT_IMPORTED_IMAGE" );
-  createAction( EditCompositeImageId, "EDIT_COMPOSITE_IMAGE" );
   createAction( ObserveImageId, "OBSERVE_IMAGE" );
   createAction( ExportImageId, "EXPORT_IMAGE" );
   createAction( UpdateImageId, "UPDATE_IMAGE" );
@@ -82,8 +81,14 @@ void HYDROGUI_Module::createActions()
 
   createAction( ImportBathymetryId, "IMPORT_BATHYMETRY", "", Qt::CTRL + Qt::SHIFT + Qt::Key_I );
 
-  createAction( FuseId, "FUSE_IMAGES" );
-  createAction( CutId, "CUT_IMAGES" );
+  createAction( FuseImagesId, "FUSE_IMAGES" );
+  createAction( EditFusedImageId, "EDIT_FUSED_IMAGE" );
+
+  createAction( CutImagesId, "CUT_IMAGES" );
+  createAction( EditCutImageId, "EDIT_CUT_IMAGE" );
+
+  createAction( SplitImageId, "SPLIT_IMAGE" );
+  createAction( EditSplittedImageId, "EDIT_SPLITTED_IMAGE" );
 
   createAction( DeleteId, "DELETE", "", Qt::Key_Delete );
 
@@ -110,8 +115,9 @@ void HYDROGUI_Module::createMenus()
   createMenu( ImportImageId, aHydroId, -1, -1 );
   createMenu( ImportBathymetryId, aHydroId, -1, -1 );
   createMenu( CreatePolylineId, aHydroId, -1, -1 );
-  createMenu( FuseId, aHydroId, -1, -1 );
-  createMenu( CutId, aHydroId, -1, -1 );
+  createMenu( FuseImagesId, aHydroId, -1, -1 );
+  createMenu( CutImagesId, aHydroId, -1, -1 );
+  createMenu( SplitImageId, aHydroId, -1, -1 );
 }
 
 void HYDROGUI_Module::createPopups()
@@ -245,17 +251,20 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case EditPolylineId:
     anOp = new HYDROGUI_PolylineOp( aModule, theId == EditPolylineId );
     break;
-  case FuseId:
-    anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Fuse );
+  case ImportBathymetryId:
+    anOp = new HYDROGUI_ImportBathymetryOp( aModule );
     break;
-  case CutId:
-    anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Cut );
+  case FuseImagesId:
+  case EditFusedImageId:
+    anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Fuse, theId == EditFusedImageId );
     break;
-  case EditCompositeImageId:
-    anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Edit );
+  case CutImagesId:
+  case EditCutImageId:
+    anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Cut, theId == EditCutImageId );
     break;
-  case ImportBathymetryId:
-    anOp = new HYDROGUI_ImportBathymetryOp( aModule );
+  case SplitImageId:
+  case EditSplittedImageId:
+    anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Split, theId == EditSplittedImageId );
     break;
   case DeleteId:
     anOp = new HYDROGUI_DeleteOp( aModule );
index 012320351e3e5c75529829429ea01af38ef8056a..77ddc3f85126df9a8b18710c61347bb816429b32 100644 (file)
@@ -35,7 +35,6 @@ enum OperationId
 
   ImportImageId,
   EditImportedImageId,
-  EditCompositeImageId,
   ObserveImageId,
   ExportImageId,
   UpdateImageId,
@@ -46,8 +45,15 @@ enum OperationId
   ImportBathymetryId,
   EditImportedBathymetryId,
 
-  FuseId,
-  CutId,
+  FuseImagesId,
+  EditFusedImageId,
+
+  CutImagesId,
+  EditCutImageId,
+
+  SplitImageId,
+  EditSplittedImageId,
+
   DeleteId,
 
   ShowId,
index 991dff2564ed7865717bc2d6fad8e44ae9f42eaf..e224ff808bf4275a0bea639c0d9d41e417369ac7 100644 (file)
@@ -342,15 +342,20 @@ void HYDROGUI_Tool::GetObjectReferences( const Handle(HYDROData_Image)& theImage
 
   for( int anIndex = 0, aNbRef = theImage->NbReferences(); anIndex < aNbRef; anIndex++ )
   {
-    Handle(HYDROData_Image) aRefImage = theImage->Reference( anIndex );
-    if( !aRefImage.IsNull() && !aRefImage->IsRemoved() )
+    Handle(HYDROData_Object) aRefObj = theImage->Reference( anIndex );
+    if( !aRefObj.IsNull() && !aRefObj->IsRemoved() )
     {
-      QString aName = aRefImage->GetName();
+      QString aName = aRefObj->GetName();
       if( !theRefNames.contains( aName ) )
       {
-        theRefObjects.Append( aRefImage );
-        theRefNames.append( aRefImage->GetName() );
-        GetObjectReferences( aRefImage, theRefObjects, theRefNames );
+        theRefObjects.Append( aRefObj );
+        theRefNames.append( aRefObj->GetName() );
+        if( aRefObj->GetKind() == KIND_IMAGE )
+        {
+          Handle(HYDROData_Image) aRefImage = Handle(HYDROData_Image)::DownCast( aRefObj );
+          if( !aRefImage.IsNull() )
+            GetObjectReferences( aRefImage, theRefObjects, theRefNames );
+        }
       }
     }
   }
index 145db26b49c28aff3a077a5aa9e9597692d58cdf..5a80d9e2c8ac6b294bffa44240fd3cb1e4426c50 100644 (file)
@@ -25,6 +25,7 @@
 #include "HYDROGUI_ColorWidget.h"
 #include "HYDROGUI_ObjSelector.h"
 
+#include <QCheckBox>
 #include <QGroupBox>
 #include <QLabel>
 #include <QLayout>
@@ -32,7 +33,9 @@
 #include <QRadioButton>
 
 HYDROGUI_TwoImagesDlg::HYDROGUI_TwoImagesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
-: HYDROGUI_InputPanel( theModule, theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle ),
+  myMode( TwoImages ),
+  myIsEdit( false )
 {
   // Image name
   QGroupBox* anImageNameGroup = new QGroupBox( tr( "IMAGE_NAME" ) );
@@ -40,20 +43,26 @@ HYDROGUI_TwoImagesDlg::HYDROGUI_TwoImagesDlg( HYDROGUI_Module* theModule, const
   QLabel* anImageNameLabel = new QLabel( tr( "NAME" ), anImageNameGroup );
   myImageName = new QLineEdit( anImageNameGroup );
 
-  QBoxLayout* anImageNameLayout = new QHBoxLayout( anImageNameGroup );
+  myModifySelectedImage = new QCheckBox( tr( "MODIFY_SELECTED_IMAGE" ) );
+
+  QGridLayout* anImageNameLayout = new QGridLayout( anImageNameGroup );
   anImageNameLayout->setMargin( 5 );
   anImageNameLayout->setSpacing( 5 );
-  anImageNameLayout->addWidget( anImageNameLabel );
-  anImageNameLayout->addWidget( myImageName );
+  anImageNameLayout->addWidget( anImageNameLabel,      0, 0 );
+  anImageNameLayout->addWidget( myImageName,           0, 1 );
+  anImageNameLayout->addWidget( myModifySelectedImage, 1, 0, 1, 2 );
 
-  // Image name
+  // Parameters
   QGroupBox* aParamGroup = new QGroupBox( tr( "PARAMETERS" ) );
 
-  QLabel* anImage1Label = new QLabel( tr( "IMAGE_1" ), aParamGroup );
-  myImage1 = new HYDROGUI_ObjSelector( theModule, aParamGroup );
+  myImage1Label = new QLabel( tr( "IMAGE_1" ), aParamGroup );
+  myImage1 = new HYDROGUI_ObjSelector( theModule, KIND_IMAGE, aParamGroup );
+
+  myImage2Label = new QLabel( tr( "IMAGE_2" ), aParamGroup );
+  myImage2 = new HYDROGUI_ObjSelector( theModule, KIND_IMAGE, aParamGroup );
 
-  QLabel* anImage2Label = new QLabel( tr( "IMAGE_2" ), aParamGroup );
-  myImage2 = new HYDROGUI_ObjSelector( theModule, aParamGroup );
+  myPolylineLabel = new QLabel( tr( "POLYLINE" ), aParamGroup );
+  myPolyline = new HYDROGUI_ObjSelector( theModule, KIND_POLYLINE, aParamGroup );
 
   QFrame* aBackgroundFrame = new QFrame( aParamGroup );
   QLabel* aBackgroundLabel = new QLabel( tr( "BACKGROUND" ), aBackgroundFrame );
@@ -73,16 +82,23 @@ HYDROGUI_TwoImagesDlg::HYDROGUI_TwoImagesDlg( HYDROGUI_Module* theModule, const
   QGridLayout* aParamLayout = new QGridLayout( aParamGroup );
   aParamLayout->setMargin( 5 );
   aParamLayout->setSpacing( 5 );
-  aParamLayout->addWidget( anImage1Label,    0, 0 );
+  aParamLayout->addWidget( myImage1Label,    0, 0 );
   aParamLayout->addWidget( myImage1,         0, 1 );
-  aParamLayout->addWidget( anImage2Label,    1, 0 );
+  aParamLayout->addWidget( myImage2Label,    1, 0 );
   aParamLayout->addWidget( myImage2,         1, 1 );
+  aParamLayout->addWidget( myPolylineLabel,  1, 0 );
+  aParamLayout->addWidget( myPolyline,       1, 1 );
   aParamLayout->addWidget( aBackgroundFrame, 2, 0, 1, 2 );
 
   // Common
   addWidget( anImageNameGroup );
   addWidget( aParamGroup );
   addStretch();
+
+  connect( myModifySelectedImage, SIGNAL( toggled( bool ) ),
+           this, SLOT( onModifySelectedImage( bool ) ) );
+
+  setMode( myMode, myIsEdit );
 }
 
 HYDROGUI_TwoImagesDlg::~HYDROGUI_TwoImagesDlg()
@@ -92,12 +108,36 @@ HYDROGUI_TwoImagesDlg::~HYDROGUI_TwoImagesDlg()
 void HYDROGUI_TwoImagesDlg::reset()
 {
   myImageName->clear();
+  myModifySelectedImage->setChecked( false );
   myImage1->Clear();
   myImage2->Clear();
+  myPolyline->Clear();
   myTransparent->setChecked( true );
   myColorBox->resetColor();
 }
 
+void HYDROGUI_TwoImagesDlg::setMode( const int theMode, const bool theIsEdit )
+{
+  myMode = theMode;
+  myIsEdit = theIsEdit;
+
+  bool anIsTwoImages = myMode == TwoImages;
+
+  myModifySelectedImage->setVisible( !anIsTwoImages && !myIsEdit );
+
+  myImage1Label->setText( anIsTwoImages ? tr( "IMAGE_1" ) : tr( "IMAGE" ) );
+
+  myImage2Label->setVisible( anIsTwoImages );
+  myImage2->setVisible( anIsTwoImages );
+  myPolylineLabel->setVisible( !anIsTwoImages );
+  myPolyline->setVisible( !anIsTwoImages );
+}
+
+bool HYDROGUI_TwoImagesDlg::isModifySelected() const
+{
+  return myModifySelectedImage->isChecked();
+}
+
 void HYDROGUI_TwoImagesDlg::setImageName( const QString& theName )
 {
   myImageName->setText( theName );
@@ -108,18 +148,24 @@ QString HYDROGUI_TwoImagesDlg::getImageName() const
   return myImageName->text();
 }
 
-void HYDROGUI_TwoImagesDlg::setSelectedImages( const QString& theName1,
-                                               const QString& theName2 )
+void HYDROGUI_TwoImagesDlg::setSelectedObjects( const QString& theName1,
+                                                const QString& theName2 )
 {
   myImage1->SetName( theName1 );
-  myImage2->SetName( theName2 );
+  if( myMode == TwoImages )
+    myImage2->SetName( theName2 );
+  else
+    myPolyline->SetName( theName2 );
 }
 
-bool HYDROGUI_TwoImagesDlg::getSelectedImages( QString& theName1,
-                                               QString& theName2 ) const
+bool HYDROGUI_TwoImagesDlg::getSelectedObjects( QString& theName1,
+                                                QString& theName2 ) const
 {
   theName1 = myImage1->GetName();
-  theName2 = myImage2->GetName();
+  if( myMode == TwoImages )
+    theName2 = myImage2->GetName();
+  else
+    theName2 = myPolyline->GetName();
   return !theName1.isEmpty() && !theName2.isEmpty();
 }
 
@@ -139,3 +185,8 @@ QColor HYDROGUI_TwoImagesDlg::getColor() const
     aColor = myColorBox->color();
   return aColor;
 }
+
+void HYDROGUI_TwoImagesDlg::onModifySelectedImage( bool theState )
+{
+  myImageName->setEnabled( !theState );
+}
index c3c14d82b0aa6ff44f08fecdcf0569905314cc59..8ac3bce73c226095aacdda5918c9306f5f48c5e4 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "HYDROGUI_InputPanel.h"
 
+class QCheckBox;
+class QLabel;
 class QLineEdit;
 class QRadioButton;
 
@@ -35,27 +37,49 @@ class HYDROGUI_TwoImagesDlg : public HYDROGUI_InputPanel
 {
   Q_OBJECT
 
+public:
+  enum Mode { TwoImages = 0, ImageAndPolyline };
+
 public:
   HYDROGUI_TwoImagesDlg( HYDROGUI_Module* theModule, const QString& theTitle );
   virtual ~HYDROGUI_TwoImagesDlg();
 
   void                       reset();
 
+  void                       setMode( const int theMode, const bool theIsEdit );
+
+  bool                       isModifySelected() const;
+
   void                       setImageName( const QString& theName );
   QString                    getImageName() const;
 
-  void                       setSelectedImages( const QString& theName1,
-                                                const QString& theName2 );
-  bool                       getSelectedImages( QString& theName1,
-                                                QString& theName2 ) const;
+  void                       setSelectedObjects( const QString& theName1,
+                                                 const QString& theName2 );
+  bool                       getSelectedObjects( QString& theName1,
+                                                 QString& theName2 ) const;
 
   void                       setColor( const QColor& theColor );
   QColor                     getColor() const;
 
+protected slots:
+  void                       onModifySelectedImage( bool theState );
+
 private:
+  int                        myMode;
+  bool                       myIsEdit;
+
   QLineEdit*                 myImageName;
+  QCheckBox*                 myModifySelectedImage;
+
+  QLabel*                    myImage1Label;
   HYDROGUI_ObjSelector*      myImage1;
+
+  QLabel*                    myImage2Label;
   HYDROGUI_ObjSelector*      myImage2;
+
+  QLabel*                    myPolylineLabel;
+  HYDROGUI_ObjSelector*      myPolyline;
+
   QRadioButton*              myTransparent;
   QRadioButton*              myColor;
   HYDROGUI_ColorWidget*      myColorBox;
index 74deaf716f1e178ad6f5c9d3fbd6803096467413..19baa6a735c42a902779bedb56a32e215ddbed79 100644 (file)
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Image.h>
+#include <HYDROData_Polyline.h>
 
 #include <HYDROOperations_Factory.h>
 
 #include <ImageComposer_CutOperator.h>
+#include <ImageComposer_CropOperator.h>
 #include <ImageComposer_FuseOperator.h>
 
-HYDROGUI_TwoImagesOp::HYDROGUI_TwoImagesOp( HYDROGUI_Module* theModule, const int theType )
+HYDROGUI_TwoImagesOp::HYDROGUI_TwoImagesOp( HYDROGUI_Module* theModule,
+                                            const int theType,
+                                            const bool theIsEdit )
 : HYDROGUI_Operation( theModule ),
   myType( theType ),
-  myIsEdit( false ),
+  myIsEdit( theIsEdit ),
   myEditedObject( 0 )
 {
-  if( myType == Edit )
-  {
-    myIsEdit = true;
-    myEditedObject = Handle(HYDROData_Image)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
-    if( !myEditedObject.IsNull() )
-    {
-      if( HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory() )
-      {
-        if( ImageComposer_Operator* anOperator = aFactory->Operator( myEditedObject ) )
-        {
-          if( dynamic_cast<ImageComposer_FuseOperator*>( anOperator ) )
-            myType = Fuse;
-          else if( dynamic_cast<ImageComposer_CutOperator*>( anOperator ) )
-            myType = Cut;
-        }
-      }
-    }
-  }
-
   QString aName;
   switch( myType )
   {
-    case Fuse: aName = tr( "FUSE" ); break;
-    case Cut: aName = tr( "CUT" ); break;
+    case Fuse: aName = theIsEdit ? tr( "EDIT_FUSED_IMAGE" ) : tr( "FUSE_IMAGES" ); break;
+    case Cut: aName = theIsEdit ? tr( "EDIT_CUT_IMAGE" ) : tr( "CUT_IMAGES" ); break;
+    case Split: aName = theIsEdit ? tr( "EDIT_SPLITTED_IMAGE" ) : tr( "SPLIT_IMAGE" ); break;
     default: break;
   }
   setName( aName );
@@ -86,14 +72,30 @@ void HYDROGUI_TwoImagesOp::startOperation()
   HYDROGUI_TwoImagesDlg* aPanel = (HYDROGUI_TwoImagesDlg*)inputPanel();
   aPanel->reset();
 
+  if( myType == Fuse || myType == Cut )
+    aPanel->setMode( HYDROGUI_TwoImagesDlg::TwoImages, myIsEdit );
+  else if( myType == Split )
+    aPanel->setMode( HYDROGUI_TwoImagesDlg::ImageAndPolyline, myIsEdit );
+
   QString anImageName;
   if( myIsEdit )
   {
+    myEditedObject = Handle(HYDROData_Image)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
     if( !myEditedObject.IsNull() )
       anImageName = myEditedObject->GetName();
   }
   else
-    anImageName = HYDROGUI_Tool::GenerateObjectName( module(), getName() );
+  {
+    QString aPrefix;
+    switch( myType )
+    {
+      case Fuse: aPrefix = tr( "FUSE" ); break;
+      case Cut: aPrefix = tr( "CUT" ); break;
+      case Split: aPrefix = tr( "SPLIT" ); break;
+      default: break;
+    }
+    anImageName = HYDROGUI_Tool::GenerateObjectName( module(), aPrefix );
+  }
   aPanel->setImageName( anImageName );
 
   QString aSelectedName1, aSelectedName2;
@@ -101,17 +103,17 @@ void HYDROGUI_TwoImagesOp::startOperation()
   {
     if( myEditedObject->NbReferences() > 0 )
     {
-      Handle(HYDROData_Image) anImage1 = myEditedObject->Reference( 0 );
-      if( !anImage1.IsNull() )
-        aSelectedName1 = anImage1->GetName();
+      Handle(HYDROData_Object) anObject1 = myEditedObject->Reference( 0 );
+      if( !anObject1.IsNull() )
+        aSelectedName1 = anObject1->GetName();
     }
     if( myEditedObject->NbReferences() > 1 )
     {
-      Handle(HYDROData_Image) anImage2 = myEditedObject->Reference( 1 );
-      if( !anImage2.IsNull() )
-        aSelectedName2 = anImage2->GetName();
+      Handle(HYDROData_Object) anObject2 = myEditedObject->Reference( 1 );
+      if( !anObject2.IsNull() )
+        aSelectedName2 = anObject2->GetName();
     }
-    aPanel->setSelectedImages( aSelectedName1, aSelectedName2 );
+    aPanel->setSelectedObjects( aSelectedName1, aSelectedName2 );
 
     HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory();
     if( ImageComposer_Operator* anOperator = aFactory->Operator( myEditedObject ) )
@@ -128,15 +130,18 @@ bool HYDROGUI_TwoImagesOp::processApply( int& theUpdateFlags,
 {
   HYDROGUI_TwoImagesDlg* aPanel = dynamic_cast<HYDROGUI_TwoImagesDlg*>( inputPanel() );
 
+  bool anIsModifySelected = myType == Split && aPanel->isModifySelected();
+
   QString anImageName = aPanel->getImageName();
-  if( anImageName.isEmpty() )
+  if( !anIsModifySelected && anImageName.isEmpty() )
     return false;
 
   QString aSelectedName1, aSelectedName2;
-  if( !aPanel->getSelectedImages( aSelectedName1, aSelectedName2 ) )
+  if( !aPanel->getSelectedObjects( aSelectedName1, aSelectedName2 ) )
     return false;
 
-  if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anImageName ) )
+  if( !anIsModifySelected &&
+      ( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anImageName ) ) )
   {
     // check that there are no other objects with the same name in the document
     Handle(HYDROData_Object) anObject = HYDROGUI_Tool::FindObjectByName( module(), anImageName );
@@ -147,11 +152,11 @@ bool HYDROGUI_TwoImagesOp::processApply( int& theUpdateFlags,
     }
   }
 
-  Handle(HYDROData_Image) anImage1 = Handle(HYDROData_Image)::DownCast(
-    HYDROGUI_Tool::FindObjectByName( module(), aSelectedName1, KIND_IMAGE ) );
-  Handle(HYDROData_Image) anImage2 = Handle(HYDROData_Image)::DownCast(
-    HYDROGUI_Tool::FindObjectByName( module(), aSelectedName2, KIND_IMAGE ) );
-  if( anImage1.IsNull() || anImage2.IsNull() )
+  Handle(HYDROData_Object) anObject1 = Handle(HYDROData_Object)::DownCast(
+    HYDROGUI_Tool::FindObjectByName( module(), aSelectedName1, KIND_UNKNOWN ) );
+  Handle(HYDROData_Object) anObject2 = Handle(HYDROData_Object)::DownCast(
+    HYDROGUI_Tool::FindObjectByName( module(), aSelectedName2, KIND_UNKNOWN ) );
+  if( anObject1.IsNull() || anObject2.IsNull() )
     return false;
 
   HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory();
@@ -168,6 +173,7 @@ bool HYDROGUI_TwoImagesOp::processApply( int& theUpdateFlags,
     {
       case Fuse: anOperator = new ImageComposer_FuseOperator(); break;
       case Cut: anOperator = new ImageComposer_CutOperator(); break;
+      case Split: anOperator = new ImageComposer_CropOperator(); break;
       default: break;
     }
 
@@ -181,22 +187,45 @@ bool HYDROGUI_TwoImagesOp::processApply( int& theUpdateFlags,
     return false;
 
   aResult->SetName( anImageName );
-  aResult->AppendReference( anImage1 );
-  aResult->AppendReference( anImage2 );
+  aResult->AppendReference( anObject1 );
+  aResult->AppendReference( anObject2 );
 
+  // Setting the operator arguments (probably, it should be done somewhere else).
+  // For Fuse and Cut operators: setting background color.
+  // For Crop operator: setting background color and polyline path to crop.
   if( ImageComposer_Operator* anOperator = aFactory->Operator( aResult ) )
   {
-    anOperator->setArgs( aPanel->getColor() );
+    if( ImageComposer_CropOperator* aCropOperator =
+      dynamic_cast<ImageComposer_CropOperator*>( anOperator ) )
+    {
+      Handle(HYDROData_Polyline) aPolyline = Handle(HYDROData_Polyline)::DownCast( anObject2 );
+      if( !aPolyline.IsNull() )
+        aCropOperator->setArgs( aPanel->getColor(), aPolyline->painterPath() );
+    }
+    else
+      anOperator->setArgs( aPanel->getColor() );
     aResult->SetArgs( anOperator->getBinArgs() );
   }
 
   aFactory->UpdateImage( doc(), aResult );
 
-  if( !myIsEdit )
+  if( anIsModifySelected )
+  {
+    Handle(HYDROData_Image) aSelectedImage = Handle(HYDROData_Image)::DownCast( anObject1 );
+    if( !aSelectedImage.IsNull() )
+    {
+      aSelectedImage->SetIsSelfSplitted( true );
+      aSelectedImage->SetImage( aResult->Image() );
+      aSelectedImage->SetTrsf( aResult->Trsf() );
+      aResult->Remove();
+    }
+  }
+
+  if( !myIsEdit && !anIsModifySelected )
   {
     size_t aViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
-    module()->setObjectVisible( aViewId, anImage1, false );
-    module()->setObjectVisible( aViewId, anImage2, false );
+    module()->setObjectVisible( aViewId, anObject1, false );
+    module()->setObjectVisible( aViewId, anObject2, false );
     module()->setObjectVisible( aViewId, aResult, true );
   }
 
index d537f4c6ef8ca8e42597e2ec31ec65fc2438e569..83ef1de94f2e4ae824acf17180492e2299c1d46e 100644 (file)
@@ -32,10 +32,10 @@ class HYDROGUI_TwoImagesOp : public HYDROGUI_Operation
   Q_OBJECT
 
 public:
-  enum OperationType { Fuse, Cut, Edit };
+  enum OperationType { Fuse, Cut, Split };
 
 public:
-  HYDROGUI_TwoImagesOp( HYDROGUI_Module* theModule, const int theType );
+  HYDROGUI_TwoImagesOp( HYDROGUI_Module* theModule, const int theType, const bool theIsEdit );
   virtual ~HYDROGUI_TwoImagesOp();
 
 protected:
index 4ebc63822354885d61dc569064f44dbbdeb570a6..64a96777199f118eb18b2f006897c342f74661dc 100644 (file)
@@ -228,8 +228,12 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <translation>Delete</translation>
     </message>
     <message>
-      <source>DSK_EDIT_COMPOSITE_IMAGE</source>
-      <translation>Edit composite image</translation>
+      <source>DSK_EDIT_CUT_IMAGE</source>
+      <translation>Edit cut image</translation>
+    </message>
+    <message>
+      <source>DSK_EDIT_FUSED_IMAGE</source>
+      <translation>Edit fused image</translation>
     </message>
     <message>
       <source>DSK_EDIT_IMPORTED_IMAGE</source>
@@ -239,6 +243,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>DSK_EDIT_POLYLINE</source>
       <translation>Edit polyline</translation>
     </message>
+    <message>
+      <source>DSK_EDIT_SPLITTED_IMAGE</source>
+      <translation>Edit splitted image</translation>
+    </message>
     <message>
       <source>DSK_EXPORT_IMAGE</source>
       <translation>Export image</translation>
@@ -291,6 +299,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>DSK_SHOW_ONLY</source>
       <translation>Show only</translation>
     </message>
+    <message>
+      <source>DSK_SPLIT_IMAGE</source>
+      <translation>Split image</translation>
+    </message>
     <message>
       <source>DSK_UNDO</source>
       <translation>Undo</translation>
@@ -320,8 +332,12 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <translation>HYDRO</translation>
     </message>
     <message>
-      <source>MEN_EDIT_COMPOSITE_IMAGE</source>
-      <translation>Edit composite image</translation>
+      <source>MEN_EDIT_CUT_IMAGE</source>
+      <translation>Edit cut image</translation>
+    </message>
+    <message>
+      <source>MEN_EDIT_FUSED_IMAGE</source>
+      <translation>Edit fused image</translation>
     </message>
     <message>
       <source>MEN_EDIT_IMPORTED_IMAGE</source>
@@ -331,6 +347,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>MEN_EDIT_POLYLINE</source>
       <translation>Create polyline</translation>
     </message>
+    <message>
+      <source>MEN_EDIT_SPLITTED_IMAGE</source>
+      <translation>Edit splitted image</translation>
+    </message>
     <message>
       <source>MEN_EXPORT_IMAGE</source>
       <translation>Export image</translation>
@@ -383,6 +403,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>MEN_SHOW_ONLY</source>
       <translation>Show only</translation>
     </message>
+    <message>
+      <source>MEN_SPLIT_IMAGE</source>
+      <translation>Split image</translation>
+    </message>
     <message>
       <source>MEN_UNDO</source>
       <translation>Undo</translation>
@@ -404,8 +428,12 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <translation>Delete</translation>
     </message>
     <message>
-      <source>STB_EDIT_COMPOSITE_IMAGE</source>
-      <translation>Edit composite image</translation>
+      <source>STB_EDIT_CUT_IMAGE</source>
+      <translation>Edit cut image</translation>
+    </message>
+    <message>
+      <source>STB_EDIT_FUSED_IMAGE</source>
+      <translation>Edit fused image</translation>
     </message>
     <message>
       <source>STB_EDIT_IMPORTED_IMAGE</source>
@@ -415,6 +443,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>STB_EDIT_POLYLINE</source>
       <translation>Edit polyline</translation>
     </message>
+    <message>
+      <source>STB_EDIT_SPLITTED_IMAGE</source>
+      <translation>Edit splitted image</translation>
+    </message>
     <message>
       <source>STB_EXPORT_IMAGE</source>
       <translation>Export image</translation>
@@ -467,6 +499,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>STB_SHOW_ONLY</source>
       <translation>Show only</translation>
     </message>
+    <message>
+      <source>STB_SPLIT_IMAGE</source>
+      <translation>Split image</translation>
+    </message>
     <message>
       <source>STB_UNDO</source>
       <translation>Undo</translation>
@@ -539,6 +575,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>COLOR</source>
       <translation>Color</translation>
     </message>
+    <message>
+      <source>IMAGE</source>
+      <translation>Image</translation>
+    </message>
     <message>
       <source>IMAGE_1</source>
       <translation>Image 1</translation>
@@ -551,6 +591,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>IMAGE_NAME</source>
       <translation>Image name</translation>
     </message>
+    <message>
+      <source>MODIFY_SELECTED_IMAGE</source>
+      <translation>Modify selected image</translation>
+    </message>
     <message>
       <source>NAME</source>
       <translation>Name</translation>
@@ -559,6 +603,10 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>PARAMETERS</source>
       <translation>Parameters</translation>
     </message>
+    <message>
+      <source>POLYLINE</source>
+      <translation>Polyline</translation>
+    </message>
     <message>
       <source>TRANSPARENT</source>
       <translation>Transparent</translation>
@@ -571,10 +619,38 @@ file cannot be correctly imported for a Bathymetry definition.</translation>
       <source>CUT</source>
       <translation>Cut</translation>
     </message>
+    <message>
+      <source>CUT_IMAGES</source>
+      <translation>Cut images</translation>
+    </message>
+    <message>
+      <source>EDIT_CUT_IMAGE</source>
+      <translation>Edit cut image</translation>
+    </message>
+    <message>
+      <source>EDIT_FUSED_IMAGE</source>
+      <translation>Edit fused image</translation>
+    </message>
+    <message>
+      <source>EDIT_SPLITTED_IMAGE</source>
+      <translation>Edit splitted image</translation>
+    </message>
     <message>
       <source>FUSE</source>
       <translation>Fuse</translation>
     </message>
+    <message>
+      <source>FUSE_IMAGES</source>
+      <translation>Fuse images</translation>
+    </message>
+    <message>
+      <source>SPLIT</source>
+      <translation>Split</translation>
+    </message>
+    <message>
+      <source>SPLIT_IMAGE</source>
+      <translation>Split image</translation>
+    </message>
   </context>
 
   <context>