]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #249 - Undo after Join selected sections operation works not properly
authornds <nds@opencascade.com>
Wed, 18 Dec 2013 05:03:47 +0000 (05:03 +0000)
committernds <nds@opencascade.com>
Wed, 18 Dec 2013 05:03:47 +0000 (05:03 +0000)
src/HYDROCurveCreator/CurveCreator_Curve.cxx
src/HYDROCurveCreator/CurveCreator_Diff.cxx

index a4f9947cfb14327c7a7d95d8f730329b0f65f5df..438b4215c3469591af946d1150274ac13d42ea3a 100644 (file)
@@ -394,7 +394,7 @@ bool CurveCreator_Curve::joinInternal( const int theISectionTo,
                              aSection2->myPoints.begin(), 
                              aSection2->myPoints.end());
 
-  res = removeSection(theISectionFrom);
+  res = removeSectionInternal(theISectionFrom);
   redisplayCurve();
   return res;
 }
index b2cecfd8c5c12cf66a2fdf0802407d0c16fda75b..797cc68b18d7fdc797bb1f9f74ca6b4b268151ff 100644 (file)
@@ -190,8 +190,18 @@ bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
               setNbUndos(3);
             }
 
+            // Construct undo for RemovePoints command.
+            int anISection = theIntParam1;
+            const int aNbPoints2  = theCurve->getNbPoints(theIntParam2);
+            CurveCreator_ICurve::SectionToPointList aSectionToPointList;
+            int aJoinedSize = aNbPoints + aNbPoints2;
+            for (int anIPoint = aNbPoints; anIPoint < aJoinedSize; anIPoint++)
+              aSectionToPointList.push_back(std::make_pair( anISection, anIPoint ) );
             isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints,
-                                   theIntParam1, aNbPoints, -1);
+                                   aSectionToPointList);
+
+            //isOK = myPUndo[0].init(CurveCreator_Operation::RemovePoints,
+            //                       theIntParam1, aNbPoints, -1);
 
             if (isOK) {
               isOK = addSectionToUndo(theCurve, theIntParam2, myPUndo[1]);