{
if( !myCurve )
return;
+
+ stopModificationMode();
myNewSectionEditor->clear();
myNewSectionEditor->setEditMode(false);
QString aSectName = QString( CurveCreator_UtilsICurve::getUniqSectionName( myCurve ).c_str() );
{
if( !myCurve )
return;
+
+ stopModificationMode();
mySection = theSection;
QString aSectName = QString::fromStdString( myCurve->getSectionName(theSection));
bool isClosed = myCurve->isClosed(theSection);
QString aName = myNewSectionEditor->getName();
bool isClosed = myNewSectionEditor->isClosed();
CurveCreator::SectionType aSectType = myNewSectionEditor->getSectionType();
-// myCurve->startOperation();
if( myCurve->getSectionName(mySection) != aName.toStdString() )
myCurve->setSectionName( mySection , aName.toStdString() );
if( myCurve->isClosed(mySection) != isClosed )
myCurve->setClosed( mySection, isClosed );
-// myCurve->finishOperation();
mySectionView->sectionChanged(mySection);
updateUndoRedo();
onCancelSection();
if( aSections.size() == 0 ){
return;
}
+ stopModificationMode();
+
int aMainSect = aSections[0];
int aMainSectSize = myCurve->getNbPoints(aMainSect);
-// myCurve->startOperation();
for( int i = 1 ; i < aSections.size() ; i++ ){
int aSectNum = aSections[i] - (i-1);
myCurve->join( aMainSect, aSectNum );
mySectionView->sectionsRemoved( aSectNum );
}
-// myCurve->finishOperation();
int aNewSectSize = myCurve->getNbPoints(aMainSect);
if( aNewSectSize != aMainSectSize )
mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );
{
if( !myCurve )
return;
+ stopModificationMode();
myCurve->clear();
mySectionView->reset();
updateActionsStates();
{
if( !myCurve )
return;
+ stopModificationMode();
myCurve->join();
mySectionView->reset();
updateActionsStates();
{
if( !myCurve )
return;
+ stopModificationMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
-// myCurve->startOperation();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
myCurve->setSectionType(aSelSections[i], CurveCreator::Spline );
mySectionView->sectionChanged(aSelSections[i]);
}
-// myCurve->finishOperation();
updateUndoRedo();
}
{
if( !myCurve )
return;
-// myCurve->startOperation();
+ stopModificationMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
myCurve->setSectionType( aSelSections[i], CurveCreator::Polyline );
mySectionView->sectionChanged( aSelSections[i] );
}
-// myCurve->finishOperation();
updateUndoRedo();
}
{
if( !myCurve )
return;
-// myCurve->startOperation();
+ stopModificationMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
myCurve->setClosed(aSelSections[i], true);
mySectionView->sectionChanged(aSelSections[i]);
}
-// myCurve->finishOperation();
updateUndoRedo();
}
{
if( !myCurve )
return;
-// myCurve->startOperation();
+ stopModificationMode();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
myCurve->setClosed(aSelSections[i], false);
mySectionView->sectionChanged(aSelSections[i]);
}
-// myCurve->finishOperation();
updateUndoRedo();
}
*/
void CurveCreator_Widget::removeSection()
{
+ stopModificationMode();
+
QList< QPair<int,int> > aSelPoints = mySectionView->getSelectedPoints();
int aCurrSect=-1;
int aRemoveCnt = 0;
-// myCurve->startOperation();
for( int i = 0 ; i < aSelPoints.size() ; i++ ){
if( aCurrSect != aSelPoints[i].first ){
aRemoveCnt = 0;
myCurve->removeSection( aSectNum );
mySectionView->sectionsRemoved( aSectNum );
}
-// myCurve->finishOperation();
mySectionView->clearSelection();
updateUndoRedo();
}
updateLocalPointView();
}
+void CurveCreator_Widget::stopModificationMode()
+{
+ QAction* anAction = myActionMap[MODIFICATION_MODE_ID];
+ if ( anAction ) {
+ if ( anAction->isChecked() )
+ anAction->setChecked( false );
+ }
+ onModificationMode( false );
+}
+
/**
* Get viewer information before perform the curve modification.
* Take a list of selected cuve points an close local context.