-//=======================================================================
-// 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;
-}
-