if ( removeEnabled() )
anEnabledAct << REMOVE_ID;
QList<int> aSelSections = mySectionView->getSelectedSections();
- QList< QPair< int, int > > aSelPoints = mySectionView->getSelectedPoints();
CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
switch( aSelType ){
case CurveCreator_TreeView::ST_NOSEL:{
if( aSelSection.size() > 0 ){
mySection = aSelSection[0];
}
- else{
- QList< QPair<int,int> > aSelPoints = mySectionView->getSelectedPoints();
- if( aSelPoints.size() > 0 ){
- mySection = aSelPoints[0].first;
- myPointNum = aSelPoints[0].second + 1;
- }
- }
// emit subOperationStarted( myNewPointEditor );
}
myCurve->join( aMainSect, aSectNum );
mySectionView->sectionsRemoved( aSectNum );
}
- int aNewSectSize = myCurve->getNbPoints(aMainSect);
- if( aNewSectSize != aMainSectSize )
- mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );
updateUndoRedo();
}
if( !myCurve )
return;
stopActionMode();
- myCurve->join( 0, myCurve->getNbSections() );
+ myCurve->join( 0, myCurve->getNbSections()-1 );
mySectionView->reset();
updateActionsStates();
updateUndoRedo();
return mySectionView->getSelectedSections();
}
-QList< QPair< int, int > > CurveCreator_Widget::getSelectedPoints()
-{
- return mySectionView->getSelectedPoints();
-}
-
/**
* According to the widget state, performs the remove action
*/
if ( myDragStarted ) {
bool isDragged = myDragged;
CurveCreator_ICurve::SectionToPointList aDraggedPoints;
- QMap<CurveCreator_ICurve::SectionToPoint, std::deque< float >> anInitialDragPointsCoords;
+ QMap<CurveCreator_ICurve::SectionToPoint, std::deque< float > > anInitialDragPointsCoords;
if ( myDragged ) {
aDraggedPoints = myDragPoints;
anInitialDragPointsCoords = myInitialDragPointsCoords;
{
stopActionMode();
- QList< QPair<int,int> > aSelPoints = mySectionView->getSelectedPoints();
- int aCurrSect=-1;
- int aRemoveCnt = 0;
- for( int i = 0 ; i < aSelPoints.size() ; i++ ){
- if( aCurrSect != aSelPoints[i].first ){
- aRemoveCnt = 0;
- aCurrSect = aSelPoints[i].first;
- }
- int aPntIndx = aSelPoints[i].second - aRemoveCnt;
- myCurve->removePoint( aCurrSect, aPntIndx );
- mySectionView->pointsRemoved( aCurrSect, aPntIndx );
- aRemoveCnt++;
- }
QList<int> aSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSections.size() ; i++ ){
int aSectNum = aSections[i] - (i);
}
int aSection = aSections[0];
myCurve->addPoints(theCoords, aSection); // add to the end of section
- mySectionView->pointsAdded( aSection, myCurve->getNbPoints( aSection ) );
updateActionsStates();
updateUndoRedo();
}
anInsertPos = aPoint1Id < aPoint2Id ? aPoint1Id + 1 : aPoint2Id + 1;
myCurve->addPoints( aCoords, aSectionId, anInsertPos );
- mySectionView->pointsAdded( aSectionId, myCurve->getNbPoints( aSectionId ) );
finishCurveModification( aSelPoints );
if ( !isRowLimit ) {
bool isBlocked = myLocalPointView->blockSignals(true);
- myLocalPointView->setRowCount( 0 );
- CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myLocalPoints.begin(),
- aLast = myLocalPoints.end();
- for ( ; anIt != aLast; anIt++ )
- myLocalPointView->addLocalPointToTable( *anIt );
+
+ myLocalPointView->setLocalPointsToTable( myLocalPoints );
myLocalPointView->blockSignals( isBlocked );
}