const int theIndex,
CurveCreator_Operation &theOperation) const
{
+ const std::string aName = theCurve->getSectionName(theIndex);
const CurveCreator::Coordinates &aPnts = theCurve->getPoints(theIndex);
const CurveCreator::SectionType aType = theCurve->getSectionType(theIndex);
const bool isClosed = theCurve->isClosed(theIndex);
bool isOK = theOperation.init(CurveCreator_Operation::AddSection,
- aPnts, aType, isClosed);
+ aName, aPnts, aType, isClosed);
return isOK;
}
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:
pIntData = (int*)aStrPtr;
*pIntData++ = aNbCoords;
- CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)aStrPtr;
+ CurveCreator::TypeCoord *pRealData = (CurveCreator::TypeCoord *)pIntData;
int i = 0;
for (; i < aNbCoords; i++) {
bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
const int theIntParam);
- /**
- * This method initializes the object with an operation with one
- * CurveCreator::Coordinates parameter and two integer parameters.
- * It is applicable to the following operations:
- * <UL>
- * <LI>AddSection</LI>
- * <LI>InsertPoints</LI>
- * <LI>SetCoordinates</LI>
- * </UL>
- * @return true in case of success; false otherwise.
- */
- bool init(const Type theType, const CurveCreator::Coordinates &theCoords,
- const int theIntParam1, const int theIntParam2);
/**
* This method initializes the object with an operation with
* list of pairs of integer parameters and CurveCreator::Coordinates parameters.