*/
virtual int getNbPoints( const int theISection ) const;
+ /**
+ * Set skip sorting flag. If the flag is true - points sorting will be skipped.
+ */
+ virtual void setSkipSorting( const bool theIsToSkip );
+
+ /**
+ * Indicates whether the points can be sorted.
+ */
+ virtual bool canPointsBeSorted();
/***********************************************/
/*** Presentation methods ***/
protected:
virtual void constructAISObject();
+protected:
+ bool mySkipSorting;
+
public:
bool myIsLocked;
CurveCreator::Sections mySections; //!< curve data
aDraggedPoints = myDragPoints;
setDragStarted( false );
- // if the drag of some points has happened, restore the drag selection
- if ( aDraggedPoints.size() > 0 )
- {
- START_MEASURE_TIME;
- setSelectedPoints( aDraggedPoints );
- END_MEASURE_TIME( "drop" );
+
+ if ( aDraggedPoints.size() > 0 ) {
+ if ( myCurve->canPointsBeSorted() ) {
+ // Apply points sorting
+ CurveCreator_ICurve::SectionToPointList aPoints;
+ startCurveModification( aPoints, false );
+
+ myCurve->setSkipSorting( false );
+
+ CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = aDraggedPoints.begin(),
+ aLast = aDraggedPoints.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ int aSectionId = anIt->first;
+ int aPointId = anIt->second;
+ std::deque<float> aPos = myCurve->getPoint( aSectionId, aPointId );
+
+ aCoordList.push_back(
+ std::make_pair( std::make_pair( aSectionId, aPointId ), aPos ) );
+ }
+
+ myCurve->setSeveralPoints( aCoordList );
+
+ finishCurveModification( aDraggedPoints );
+ } else {
+ // if the drag of some points has happened, restore the drag selection
+ if ( aDraggedPoints.size() > 0 ) {
+ START_MEASURE_TIME;
+ setSelectedPoints( aDraggedPoints );
+ END_MEASURE_TIME( "drop" );
+ }
+ }
}
}
else // check whether the segment is clicked an a new point should be added to the segment
CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
int aNbPoints = myLocalPoints.size();
+
bool isRowLimit = aNbPoints > myLocalPointRowLimit;
myLocalPointView->setVisible( getActionMode() == ModificationMode && !isRowLimit );
{
if ( theState ) {
getSelectedPoints( myDragPoints );
+
myDragStarted = myDragPoints.size();
myDragStartPosition = thePoint;
if ( myDragStarted ) {
// change a viewer interaction style in order to avoid a select rectangle build
myDragInteractionStyle = changeInteractionStyle( SUIT_ViewModel::KEY_FREE );
+ myCurve->setSkipSorting( true );
}
}
else {