Salome HOME
Create goups for stream.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Operation.cxx
index fa9cdb071f753de652069a14ed1307fd8bb4c980..bd9cab5dcdea6a91a93e4b98ef6f8f760f525da2 100644 (file)
@@ -60,8 +60,7 @@ bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType)
 {
   bool isOK = false;
 
-  if (theType == CurveCreator_Operation::Clear ||
-      theType == CurveCreator_Operation::Join) {
+  if (theType == CurveCreator_Operation::Clear) {
     clear();
     myType = theType;
     isOK   = true;
@@ -103,7 +102,6 @@ bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
   if (theType == CurveCreator_Operation::SetType     ||
       theType == CurveCreator_Operation::SetClosed   ||
       theType == CurveCreator_Operation::MoveSection ||
-      theType == CurveCreator_Operation::RemovePoints ||
       theType == CurveCreator_Operation::Join) {
     int *pData = (int *)allocate(2*sizeof(int));
 
@@ -116,30 +114,6 @@ bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
   return isOK;
 }
 
-//=======================================================================
-// function: Constructor
-// purpose:
-//=======================================================================
-bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
-                                  const int theIntParam1,
-                                  const int theIntParam2,
-                                  const int theIntParam3)
-{
-  bool isOK = false;
-
-  if (theType == CurveCreator_Operation::RemovePoints) {
-    int *pData = (int *)allocate(3*sizeof(int));
-
-    pData[0] = theIntParam1;
-    pData[1] = theIntParam2;
-    pData[2] = theIntParam3;
-    myType   = theType;
-    isOK     = true;
-  }
-
-  return isOK;
-}
-
 //=======================================================================
 // function: Constructor
 // purpose:
@@ -173,41 +147,6 @@ bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
   return isOK;
 }
 
-//=======================================================================
-// function: Constructor
-// purpose:
-//=======================================================================
-bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
-                                  const CurveCreator::Coordinates &theCoords,
-                                  const int theIntParam1,
-                                  const int theIntParam2)
-{
-  bool isOK = false;
-
-  if (theType == CurveCreator_Operation::AddSection) {
-    const int aNbCoords = theCoords.size();
-    const size_t aSize =
-      3*sizeof(theIntParam1) + aNbCoords*sizeof(CurveCreator::TypeCoord);
-    int *pIntData = (int *)allocate(aSize);
-
-    *pIntData++ = theIntParam1;
-    *pIntData++ = theIntParam2;
-    *pIntData++ = aNbCoords;
-
-    CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
-    int i = 0;
-
-    for (; i < aNbCoords; i++) {
-      *pRealData++ = theCoords[i];
-    }
-
-    myType = theType;
-    isOK   = true;
-  }
-
-  return isOK;
-}
-
 //=======================================================================
 // function: Constructor
 // purpose:
@@ -239,7 +178,7 @@ bool CurveCreator_Operation::init(const CurveCreator_Operation::Type theType,
     pIntData = (int*)aStrPtr;
     *pIntData++ = aNbCoords;
 
-    CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)aStrPtr;
+    CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
     int i = 0;
 
     for (; i < aNbCoords; i++) {
@@ -419,7 +358,7 @@ void CurveCreator_Operation::apply(CurveCreator_Curve *theCurve)
         theCurve->clearInternal();
         break;
       case CurveCreator_Operation::SetClosed:
-        theCurve->setClosedInternal((pInt[0] != 0), pInt[1]);
+        theCurve->setClosedInternal(pInt[1], (pInt[0] != 0));
         break;
       case CurveCreator_Operation::MoveSection:
         theCurve->moveSectionInternal(pInt[0], pInt[1]);