return isOK;
}
+//=======================================================================
+// function: Constructor
+// purpose:
+//=======================================================================
+bool CurveCreator_Operation::init(const Type theType, const std::list<int> theParamList)
+{
+ bool isOK = false;
+
+ if (theType == CurveCreator_Operation::Join)
+ {
+ const int aNbPoints = theParamList.size();
+
+ const size_t aSize =
+ sizeof(aNbPoints) +
+ aNbPoints * (sizeof(int));
+
+ int *pIntData = (int *)allocate(aSize);
+
+ *pIntData++ = aNbPoints;
+ std::list<int>::const_iterator anIt = theParamList.begin(), aLast = theParamList.end();
+ for ( ; anIt != aLast; anIt++ )
+ *pIntData++ = *anIt;
+
+ myType = theType;
+ isOK = true;
+ }
+ return isOK;
+}
+
//=======================================================================
// function: Constructor
// purpose:
theCurve->moveSectionInternal(pInt[0], pInt[1]);
break;
case CurveCreator_Operation::Join:
- if (myPData == NULL) {
- theCurve->joinInternal();
- } else {
- theCurve->joinInternal(pInt[0], pInt[1]);
+ if (myPData != NULL)
+ {
+ std::list<int> aListOfSections;
+ int nbSections = pInt[0];
+ for (int i = 1; i < nbSections+1; i++) {
+ aListOfSections.push_back(pInt[i]);
+ }
+ theCurve->joinInternal(aListOfSections);
}
break;
case CurveCreator_Operation::AddSection: