+void CurveCreator_Curve::SetEraseAllState(bool toEraseAll)
+{
+ myEraseAll = toEraseAll;
+}
+//=======================================================================
+// function: clear
+// purpose:
+//=======================================================================
+bool CurveCreator_Curve::GetEraseAllState() const
+{
+ return myEraseAll;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
+{
+ bool res = false;
+ if ( theSections.empty() )
+ return res;
+
+ int anISectionMain = theSections.front();
+ CurveCreator_Section* aSectionMain =
+ (CurveCreator_Section*)getSection( anISectionMain );
+
+ std::list <int> aSectionsToJoin = theSections;
+ aSectionsToJoin.erase( aSectionsToJoin.begin() ); // skip the main section
+ // it is important to sort and reverse the section ids in order to correctly remove them
+ aSectionsToJoin.sort();
+ aSectionsToJoin.reverse();
+
+ std::list<int>::const_iterator anIt = aSectionsToJoin.begin(), aLast = aSectionsToJoin.end();
+ CurveCreator_Section* aSection;
+ for (; anIt != aLast; anIt++) {
+ aSection = (CurveCreator_Section*)getSection( *anIt );
+ aSectionMain->myPoints.insert(aSectionMain->myPoints.end(), aSection->myPoints.begin(),
+ aSection->myPoints.end());
+ res = removeSectionInternal(*anIt);
+ if ( !res )
+ break;
+ }
+
+ redisplayCurve(false);
+ return res;
+}
+
+bool CurveCreator_Curve::join( const std::list<int>& theSections )
+{
+ bool res = false;
+
+ if ( !theSections.empty() )
+ {
+ startOperation();
+ if (addEmptyDiff())
+ myListDiffs.back().init(this, CurveCreator_Operation::Join, theSections);
+
+ res = joinInternal( theSections );
+
+ finishOperation();
+ }
+ return res;
+}
+
+//! Get number of sections
+int CurveCreator_Curve::getNbSections() const
+{
+ return mySections.size();
+}
+
+//! For internal use only! Undo/Redo are not used here.
+int CurveCreator_Curve::addSectionInternal
+ (const std::string& theName, const CurveCreator::SectionType theType,
+ const bool theIsClosed, const CurveCreator::Coordinates &thePoints,
+ const Quantity_Color& aColor)
+{
+ CurveCreator_Section *aSection = new CurveCreator_Section;
+
+ std::string aName = theName;
+ if( aName.empty() ){
+ aName = getUniqSectionName();
+ }
+ aSection->myName = aName;
+ aSection->myType = theType;
+ aSection->myIsClosed = theIsClosed;
+ aSection->myPoints = thePoints;
+ aSection->myColor = aColor;//getRandColor(); //TODO temp
+ mySections.push_back(aSection);
+ redisplayCurve(false);
+ return mySections.size()-1;
+}
+
+//=======================================================================
+// function: addSection
+// purpose: adds an empty section
+//=======================================================================
+int CurveCreator_Curve::addSection
+ (const std::string& theName, const CurveCreator::SectionType theType,
+ const bool theIsClosed)
+{
+ int resISection = -1;
+ // Set the difference.
+ startOperation();
+ CurveCreator::Coordinates aCoords; //empty list
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::AddSection,
+ theName, aCoords, theType, theIsClosed);
+ }
+
+ Quantity_Color aRColor = CurveCreator_Utils::getRandColor();
+
+ resISection = addSectionInternal(theName, theType, theIsClosed, aCoords, aRColor);
+
+ finishOperation();
+ return resISection;
+}
+//=======================================================================
+// function: addSection
+// purpose: adds a section with the given points
+//=======================================================================
+int CurveCreator_Curve::addSection
+ (const std::string& theName, const CurveCreator::SectionType theType,
+ const bool theIsClosed, const CurveCreator::Coordinates &thePoints)
+{
+ int resISection = -1;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::AddSection,
+ theName, thePoints, theType, theIsClosed);
+ }
+
+ resISection = addSectionInternal(theName, theType, theIsClosed, thePoints, Quantity_NOC_YELLOW);
+
+ finishOperation();
+ return resISection;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::removeSectionInternal( const int theISection )
+{
+ if (theISection == -1) {
+ myRemColors.push_back(mySections.back()->myColor);
+ delete mySections.back();
+ mySections.pop_back();
+ } else {
+ CurveCreator::Sections::iterator anIterRm = mySections.begin() + theISection;
+
+ myRemColors.push_back((*anIterRm)->myColor);
+
+ delete *anIterRm;
+ mySections.erase(anIterRm);
+ }
+ redisplayCurve(false);
+ return true;
+}
+
+//! Removes the given sections.
+bool CurveCreator_Curve::removeSection( const int theISection )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff())
+ myListDiffs.back().init(this, CurveCreator_Operation::RemoveSection, theISection);
+
+ res = removeSectionInternal( theISection );
+
+ finishOperation();
+ return res;
+}
+
+bool CurveCreator_Curve::setColorSection( int SectInd, Quantity_Color theNewColor )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+
+ int ColorParam[3] = { (int)( theNewColor.Red() * 255 ),
+ (int)( theNewColor.Green() * 255 ),
+ (int)( theNewColor.Blue() * 255 ) };
+
+ if (addEmptyDiff())
+ myListDiffs.back().init(this, CurveCreator_Operation::SetColorSection, SectInd, ColorParam);
+
+ setColorSectionInternal(SectInd, theNewColor);
+
+ finishOperation();
+ return res;
+}
+
+void CurveCreator_Curve::setColorSectionInternal( int SectInd, Quantity_Color theNewColor )
+{
+ CurveCreator_Section* aSec = (CurveCreator_Section*)(getSection(SectInd));
+ aSec->myColor = theNewColor;
+
+ redisplayCurve(false);
+}
+
+Quantity_Color CurveCreator_Curve::getColorSection( int SectInd ) const
+{
+ CurveCreator_Section* aSec = (CurveCreator_Section*)(getSection(SectInd));
+ return aSec->myColor;
+}
+
+Quantity_Color CurveCreator_Curve::getLastRemovedColor() const
+{
+ return myRemColors.empty() ? Quantity_NOC_BLACK : myRemColors.back();
+}
+
+void CurveCreator_Curve::popLastRemovedColor()
+{
+ myRemColors.pop_back();
+}
+
+/**
+ * Get number of points in specified section or (the total number of points
+ * in Curve if theISection is equal to -1).
+ */
+int CurveCreator_Curve::getNbPoints( const int theISection ) const
+{
+ int aNbCoords = 0;
+
+ CurveCreator_Section* aSection;
+ if (theISection == -1) {
+ int i = 0;
+ const int aNbSections = getNbSections();
+
+ for (; i < aNbSections; i++) {
+ aSection = (CurveCreator_Section*)getSection( i );
+ if ( aSection )
+ aNbCoords += aSection->myPoints.size();
+ }
+ } else {
+ aSection = (CurveCreator_Section*)getSection( theISection );
+ if ( aSection )
+ aNbCoords = aSection->myPoints.size();
+ }
+
+ return aNbCoords/myDimension;
+}
+
+void CurveCreator_Curve::setSkipSorting( const bool theIsToSkip )
+{
+ mySkipSorting = theIsToSkip;
+}
+
+bool CurveCreator_Curve::canPointsBeSorted()
+{
+ 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
+{
+ const CurveCreator_Section* aSection =
+ (CurveCreator_Section*)getSection( theISection );
+ return aSection ? aSection->myIsClosed : false;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setClosedInternal( const int theISection,
+ const bool theIsClosed )
+{
+ CurveCreator_Section* aSection = 0;
+ if (theISection == -1) {
+ int aSize = mySections.size();
+ int i;
+
+ for (i = 0; i < aSize; i++) {
+ aSection = (CurveCreator_Section*)getSection( i );
+ if( aSection ) {
+ aSection->myIsClosed = theIsClosed;
+ redisplayCurve(false);
+ }
+ }
+ } else {
+ aSection = (CurveCreator_Section*)getSection( theISection );
+ if ( aSection ) {
+ aSection->myIsClosed = theIsClosed;
+ redisplayCurve(false);
+ }
+ }
+ return true;
+}
+
+/**
+ * Set "closed" flag of the specified section (all sections if
+ * \a theISection is -1).
+ */
+bool CurveCreator_Curve::setClosed( const int theISection,
+ const bool theIsClosed )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::SetClosed,
+ theIsClosed, theISection);
+ }
+ res = setClosedInternal( theISection, theIsClosed );
+ finishOperation();
+ return res;
+}
+
+//! Returns specified section name
+std::string CurveCreator_Curve::getSectionName( const int theISection ) const
+{
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+ return aSection ? aSection->myName : "";
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setSectionNameInternal( const int theISection,
+ const std::string& theName )
+{
+ bool res = false;
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+ if( aSection ) {
+ aSection->myName = theName;
+ res = true;
+ }
+ return res;
+}
+
+/** Set name of the specified section */
+bool CurveCreator_Curve::setSectionName( const int theISection,
+ const std::string& theName )
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::RenameSection,
+ theName, theISection);
+ }
+ res = setSectionNameInternal( theISection, theName );
+ finishOperation();
+ return res;
+}
+
+//! Get type of the specified section
+CurveCreator::SectionType CurveCreator_Curve::getSectionType
+ ( const int theISection ) const
+{
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+ return aSection ? aSection->myType : CurveCreator::Polyline;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setSectionTypeInternal( const int theISection,
+ const CurveCreator::SectionType theType )
+{
+ CurveCreator_Section* aSection;
+ if (theISection == -1) {
+ int i = 0;
+ const int aNbSections = getNbSections();
+
+ for (; i < aNbSections; i++) {
+ aSection = (CurveCreator_Section*)getSection( i );
+ if ( aSection )
+ aSection->myType = theType;
+ }
+ redisplayCurve(false);
+ } else {
+ aSection = (CurveCreator_Section*)getSection( theISection );
+ if ( aSection && aSection->myType != theType ){
+ aSection->myType = theType;
+ redisplayCurve(false);
+ }
+ }
+ return true;
+}
+
+/**
+ * Set type of the specified section (or all sections
+ * if \a theISection is -1).
+ */
+bool CurveCreator_Curve::setSectionType( const int theISection,
+ const CurveCreator::SectionType theType )
+{
+ bool res = false;
+ startOperation();
+ // Set the difference.
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::SetType,
+ theType, theISection);
+ }
+
+ res = setSectionTypeInternal( theISection, theType );
+
+ finishOperation();
+ return res;
+}
+
+
+/***********************************************/
+/*** Point methods ***/
+/***********************************************/
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap )
+{
+ bool res = false;
+ CurveCreator::SectionsMap::const_iterator anIt = theSectionsMap.begin();
+ CurveCreator_Section *aSection = 0;
+ for ( ; anIt != theSectionsMap.end(); anIt++ ) {
+ int anISection = anIt->first;
+ aSection = (CurveCreator_Section*)getSection( anISection );
+ if( aSection ) {
+ CurveCreator::PosPointsList aSectionPoints = anIt->second;
+ CurveCreator::PosPointsList::const_iterator aPntIt = aSectionPoints.begin();
+ for( ; aPntIt != aSectionPoints.end(); aPntIt++ ){
+ int anIPnt = (*aPntIt)->myID;
+ CurveCreator::Coordinates aCoords = (*aPntIt)->myCoords;
+ CurveCreator::Coordinates::iterator anIterPosition;
+ if(anIPnt == -1)
+ anIterPosition = aSection->myPoints.end();
+ else
+ anIterPosition = aSection->myPoints.begin() + toICoord(anIPnt);
+ /*CurveCreator::Coordinates::const_iterator aFirstPosition =
+ aCoords.begin();*/
+ aSection->myPoints.insert(anIterPosition,
+ aCoords.begin(), aCoords.end());
+ }
+ res = true;
+ }
+ }
+ if(res)
+ redisplayCurve(false);
+ return res;
+}
+
+/**
+ * Add one point to the specified section starting from the given theIPnt index
+ * (or at the end of points if \a theIPnt is -1).
+ */
+bool CurveCreator_Curve::addPoints( const CurveCreator::Coordinates& theCoords,
+ const int theISection,
+ const int theIPnt )
+{
+ //DEBTRACE("addPoints");
+ bool res = false;
+ CurveCreator::Coordinates aCoords = theCoords;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ CurveCreator_ICurve::SectionToPointCoordsList aList;
+ aList.push_back(std::make_pair(std::make_pair(theISection, theIPnt), theCoords));
+ myListDiffs.back().init(this, CurveCreator_Operation::InsertPoints,
+ aList);
+ }
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPoints;
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( theIPnt, theCoords );
+ aPoints.push_back( aPosPoint );
+ aSectionsMap[theISection] = aPoints;
+
+ res = addPointsInternal( aSectionsMap );
+
+ finishOperation();
+ return res;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::setPointInternal( const CurveCreator::SectionsMap &theSectionsMap )
+{
+ bool res = false;
+ // Update the curve.
+ CurveCreator::SectionsMap::const_iterator anIt = theSectionsMap.begin();
+ CurveCreator_Section *aSection = 0;
+ for ( ; anIt != theSectionsMap.end(); anIt++ ) {
+ int anISection = anIt->first;
+ aSection = (CurveCreator_Section*)getSection( anISection );
+ if( aSection ) {
+ CurveCreator::PosPointsList aSectionPoints = anIt->second;
+ CurveCreator::PosPointsList::const_iterator aPntIt = aSectionPoints.begin();
+ for( ; aPntIt != aSectionPoints.end(); aPntIt++ ){
+ int anIPnt = (*aPntIt)->myID;
+ CurveCreator::Coordinates aCoords = (*aPntIt)->myCoords;
+ for ( int i = 0; i < myDimension; i++)
+ aSection->myPoints.at(toICoord(anIPnt) + i) = aCoords[i];
+ }
+ res = true;
+ }
+ }
+ if(res)
+ redisplayCurve(false);
+
+ return res;
+}
+
+//! Set coordinates of specified point
+bool CurveCreator_Curve::setPoint( const int theISection,
+ const int theIPnt,
+ const CurveCreator::Coordinates& theNewCoords )
+{
+ //DEBTRACE("setPoint");
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ CurveCreator_ICurve::SectionToPointCoordsList aList;
+ aList.push_back(std::make_pair(std::make_pair(theISection, theIPnt), theNewCoords));
+ myListDiffs.back().init(this, CurveCreator_Operation::SetCoordinates,
+ aList);
+ }
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPoints;
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( theIPnt, theNewCoords );
+ aPoints.push_back( aPosPoint );
+ aSectionsMap[theISection] = aPoints;
+
+ /*int aSize1 = */getNbPoints( theISection ); // todo: unused variable
+ res = setPointInternal( aSectionsMap );
+ /*int aSize2 = */getNbPoints( theISection ); // todo: unused variable
+
+ finishOperation();
+
+ return res;
+}
+
+//! Set coordinates of specified points from different sections
+bool CurveCreator_Curve::setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
+ const bool theIsToSaveDiff )
+{
+ //DEBTRACE("setSeveralPoints");
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (theIsToSaveDiff && addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::SetCoordinates,
+ theSectionToPntCoords);
+ }
+ CurveCreator::SectionsMap aSectionsMap;
+ CurveCreator::PosPointsList aPosPoints;
+ CurveCreator_ICurve::SectionToPointCoordsList::const_iterator anIt =
+ theSectionToPntCoords.begin(), aLast = theSectionToPntCoords.end();
+ int aSectionId, aPointId;
+ for ( ; anIt != aLast; anIt++ ) {
+ aPosPoints.clear();
+ aSectionId = anIt->first.first;
+ aPointId = anIt->first.second;
+ CurveCreator::Coordinates aNewCoords = anIt->second;
+ CurveCreator_PosPoint* aPosPoint =
+ new CurveCreator_PosPoint( aPointId, aNewCoords );
+ if( aSectionsMap.find(aSectionId) != aSectionsMap.end() )
+ aPosPoints = aSectionsMap[aSectionId];
+ aPosPoints.push_back( aPosPoint );
+ aSectionsMap[aSectionId] = aPosPoints;
+
+ }
+ res = setPointInternal( aSectionsMap );
+ finishOperation();
+
+ return res;
+}
+
+//! For internal use only! Undo/Redo are not used here.
+bool CurveCreator_Curve::removePointsInternal( const SectionToPointList &thePoints )
+{
+ bool aRes = false;
+ std::map<int, std::list<int> > aConvPoints;
+ convert( thePoints, aConvPoints );
+ std::map<int, std::list<int> >::const_iterator anIt = aConvPoints.begin(),
+ aLast = aConvPoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ int aSectionId = anIt->first;
+ aRes = removeSectionPoints(aSectionId, anIt->second);
+ }
+ if( aRes)
+ redisplayCurve(false);
+
+ return aRes;
+}
+
+//! Remove point with given id
+bool CurveCreator_Curve::removePoint( const int theISection, const int theIPnt )
+{
+ 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,
+ aListOfSectionsToPoints);
+ }
+ res = removePointsInternal( aListOfSectionsToPoints );
+ finishOperation();
+ return res;
+}
+
+//! Remove several points from different sections with given ids
+bool CurveCreator_Curve::removeSeveralPoints( const SectionToPointList &theSectionToPntIDs)
+{
+ bool res = false;
+ // Set the difference.
+ startOperation();
+ if (addEmptyDiff()) {
+ myListDiffs.back().init(this, CurveCreator_Operation::RemovePoints,
+ theSectionToPntIDs);
+ }
+ res = removePointsInternal( theSectionToPntIDs );
+ finishOperation();
+ return res;
+}
+
+ //=======================================================================
+// function: getCoordinates
+// purpose:
+//=======================================================================
+CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection,
+ const int theIPnt) const
+{
+ //DEBTRACE("getPoint");
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+ CurveCreator::Coordinates::const_iterator
+ anIter = aSection->myPoints.begin() + toICoord(theIPnt);
+ CurveCreator::Coordinates aResult(anIter, anIter + myDimension);
+
+ return aResult;
+}
+
+//=======================================================================
+// function: getPoints
+// purpose:
+//=======================================================================
+CurveCreator::Coordinates CurveCreator_Curve::getCoords( int theISection ) const
+{
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+ return aSection ? aSection->myPoints : CurveCreator::Coordinates();
+}
+
+Handle(TColgp_HArray1OfPnt) CurveCreator_Curve::GetDifferentPoints( int theISection ) const
+{
+ //DEBTRACE("getPoints");
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+ return aSection ? aSection->GetDifferentPoints( (int)myDimension ) : Handle(TColgp_HArray1OfPnt)();
+}
+
+void CurveCreator_Curve::constructAISObject()
+{
+ //DEBTRACE("constructAISObject");
+ TopoDS_Shape aShape;
+ mySect2Shape.Clear();
+ CurveCreator_Utils::constructShape( this, aShape, &mySect2Shape );
+ myAISShape = new AIS_ColoredShape( aShape );
+ AIS_ColoredShape* AISColoredShape = dynamic_cast<AIS_ColoredShape*>(myAISShape);
+
+ std::map<int, TopoDS_Shape>::iterator it;
+
+ //for ( it = mySect2Shape.begin(); it != mySect2Shape.end(); it++ )
+ for (int i = 1; i <= mySect2Shape.Extent(); i++ )
+ {
+ CurveCreator_Section* aSect = (CurveCreator_Section*)getSection(mySect2Shape.FindKey(i));
+ Quantity_Color aColor = aSect->myColor;
+ const TopoDS_Shape& aShape = mySect2Shape.FindFromIndex(i); //should contain: one wire + vertices
+ TopoDS_Iterator it(aShape);
+ for (;it.More();it.Next())
+ {
+ if (it.Value().ShapeType() == TopAbs_WIRE)
+ AISColoredShape->SetCustomColor(it.Value(), aColor);
+ }
+ }
+
+ // myAISShape->SetColor( myCurveColor );
+ myAISShape->SetWidth( myLineWidth );
+ Handle(Prs3d_PointAspect) anAspect = myAISShape->Attributes()->PointAspect();
+ anAspect->SetScale( 3.0 );
+ anAspect->SetTypeOfMarker(Aspect_TOM_O_POINT);
+ anAspect->SetColor(myPointAspectColor);
+ myAISShape->Attributes()->SetPointAspect( anAspect );
+}
+
+Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const
+{
+ //DEBTRACE("getAISObject");
+ if ( !myAISShape && theNeedToBuild )
+ {
+ CurveCreator_Curve* aCurve = (CurveCreator_Curve*)this;
+ aCurve->constructAISObject();
+ }
+ return myAISShape;
+}
+
+bool CurveCreator_Curve::removeSectionPoints( const int theSectionId,
+ const std::list<int>& thePointIds )
+{
+ bool aRes = false;
+
+ CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theSectionId );
+ if ( !aSection )
+ return aRes;
+
+ std::list<int> aSectionPoints = thePointIds;
+ aSectionPoints.sort();
+ std::list<int>::const_reverse_iterator aPntIt = aSectionPoints.rbegin();
+ for ( ; aPntIt != aSectionPoints.rend(); aPntIt++ ) {
+ int aPntIndx = *aPntIt;
+ CurveCreator::Coordinates::iterator aFirstPosition;
+ if ( aPntIndx == -1 )
+ aFirstPosition = aSection->myPoints.end() - getDimension();
+ else
+ aFirstPosition = aSection->myPoints.begin() + toICoord( aPntIndx );
+ aSection->myPoints.erase( aFirstPosition, aFirstPosition + getDimension() );
+ aRes = true;
+ }
+ return aRes;
+}
+
+void CurveCreator_Curve::convert( const SectionToPointList& thePoints,
+ std::map< int, std::list<int> >& theConvPoints )