startOperation();
// Set the difference.
if (addEmptyDiff()) {
- myListDiffs.back().init(this, CurveCreator_Operation::Clear);
+ myListDiffs.back().init(this);
}
res = clearInternal();
finishOperation();
aSection2->myPoints.begin(),
aSection2->myPoints.end());
- res = removeSection(theISectionFrom);
+ res = removeSectionInternal(theISectionFrom);
redisplayCurve();
return res;
}
return false;
}
+/**
+ * Saves points coordinates difference.
+ * \param theOldCoords the old points coordinates
+ */
+void CurveCreator_Curve::saveCoordDiff( const SectionToPointCoordsList &theOldCoords )
+{
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, theOldCoords);
+ }
+ finishOperation();
+}
+
//! Get "closed" flag of the specified section
bool CurveCreator_Curve::isClosed( const int theISection ) const
{
}
//! Set coordinates of specified points from different sections
-bool CurveCreator_Curve::setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords)
+bool CurveCreator_Curve::setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
+ const bool theIsToSaveDiff )
{
bool res = false;
// Set the difference.
startOperation();
- if (addEmptyDiff()) {
+ if (theIsToSaveDiff && addEmptyDiff()) {
myListDiffs.back().init(this, CurveCreator_Operation::SetCoordinates,
theSectionToPntCoords);
}
bool res = false;
// Set the difference.
startOperation();
+ SectionToPointList aListOfSectionsToPoints;
+ aListOfSectionsToPoints.push_back(std::make_pair(theISection, theIPnt));
if (addEmptyDiff()) {
myListDiffs.back().init(this, CurveCreator_Operation::RemovePoints,
- theISection, theIPnt);
+ aListOfSectionsToPoints);
}
- SectionToPointList aListOfSectionsToPoints;
- aListOfSectionsToPoints.push_back(std::make_pair(theISection, theIPnt));
res = removePointsInternal( aListOfSectionsToPoints );
finishOperation();
return res;