X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROCurveCreator%2FCurveCreator_Curve.cxx;h=f056b03426ae1b2c486c6de592bacf4d73193df8;hb=1f844eb06506171b54541cc0caf1a0c237fe0dbf;hp=69b0c38d4fc207f525c5bbc4949f1ba4c95cdfd8;hpb=2686c62a9139e3b8f81549e62063500ca52a8163;p=modules%2Fhydro.git diff --git a/src/HYDROCurveCreator/CurveCreator_Curve.cxx b/src/HYDROCurveCreator/CurveCreator_Curve.cxx index 69b0c38d..f056b034 100644 --- a/src/HYDROCurveCreator/CurveCreator_Curve.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Curve.cxx @@ -347,6 +347,48 @@ void CurveCreator_Curve::redisplayCurve() } } +//! For internal use only! Undo/Redo are not used here. +bool CurveCreator_Curve::moveSectionInternal(const int theISection, + const int theNewIndex) +{ + bool res = false; + if (theISection != theNewIndex) { + CurveCreator_Section *aSection = mySections.at(theISection); + + // Remove section + CurveCreator::Sections::iterator anIter = mySections.begin() + theISection; + + mySections.erase(anIter); + + // Insert section. + anIter = mySections.begin() + theNewIndex; + mySections.insert(anIter, aSection); + res = true; + } + return res; +} + +//======================================================================= +// function: moveSection +// purpose: +//======================================================================= +bool CurveCreator_Curve::moveSection(const int theISection, + const int theNewIndex) +{ + bool res = false; + // Set the difference. + startOperation(); + if (addEmptyDiff()) { + myListDiffs.back().init(this, CurveCreator_Operation::MoveSection, + theISection, theNewIndex); + } + + // Update the curve. + res = moveSectionInternal(theISection, theNewIndex); + finishOperation(); + return res; +} + /************ Implementation of INTERFACE methods ************/ /***********************************************/ @@ -818,6 +860,12 @@ bool CurveCreator_Curve::setPoint( const int theISection, return res; } +//! Set coordinates of specified points from different sections +bool CurveCreator_Curve::setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords) +{ + return false; +} + //! For internal use only! Undo/Redo are not used here. bool CurveCreator_Curve::removePointsInternal( const std::vector &theISections, const std::vector &theIPnts ) @@ -862,7 +910,13 @@ bool CurveCreator_Curve::removePoint( const int theISection, const int theIPnt ) return res; } -//======================================================================= +//! Remove several points from different sections with given ids +bool CurveCreator_Curve::removeSeveralPoints( const SectionToPointList &theSectionToPntIDs) +{ + return false; +} + + //======================================================================= // function: getCoordinates // purpose: //=======================================================================