//#include "CurveCreator_NewPointDlg.h"
#include "CurveCreator_NewSectionDlg.h"
#include "CurveCreator_Utils.h"
+#include "CurveCreator_TableView.h"
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
connect( mySectionView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenu(QPoint)) );
myLocalPointView = new QTableWidget();
+ myLocalPointView->setItemDelegate( new CurveCreator_TableItemDelegate( myLocalPointView ) );
myLocalPointView->setVisible( false );
myLocalPointView->setColumnCount( 4 );
myLocalPointView->setColumnWidth( 0, SECTION_NAME_COLUMN_WIDTH );
bool isClosed = myNewSectionEditor->isClosed();
CurveCreator::SectionType aSectType = myNewSectionEditor->getSectionType();
// myCurve->startOperation();
- myCurve->setClosed( isClosed, mySection );
- myCurve->setSectionName( mySection , aName.toStdString() );
- myCurve->setSectionType( mySection, aSectType );
+ if( myCurve->getSectionName(mySection) != aName.toStdString() )
+ myCurve->setSectionName( mySection , aName.toStdString() );
+
+ if( myCurve->getSectionType(mySection) != aSectType )
+ myCurve->setSectionType( mySection, aSectType );
+
+ if( myCurve->isClosed(mySection) != isClosed )
+ myCurve->setClosed( mySection, isClosed );
// myCurve->finishOperation();
mySectionView->sectionChanged(mySection);
updateUndoRedo();
// myCurve->startOperation();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
- myCurve->setClosed(true, aSelSections[i]);
+ myCurve->setClosed(aSelSections[i], true);
mySectionView->sectionChanged(aSelSections[i]);
}
// myCurve->finishOperation();
// myCurve->startOperation();
QList<int> aSelSections = mySectionView->getSelectedSections();
for( int i = 0 ; i < aSelSections.size() ; i++ ){
- myCurve->setClosed(false, aSelSections[i]);
+ myCurve->setClosed(aSelSections[i], false);
mySectionView->sectionChanged(aSelSections[i]);
}
// myCurve->finishOperation();
myCurve->undo();
finishCurveModification();
mySectionView->reset();
- updateUndoRedo();
}
void CurveCreator_Widget::onRedo()
myCurve->redo();
finishCurveModification();
mySectionView->reset();
- updateUndoRedo();
}
void CurveCreator_Widget::updateUndoRedo()
SectionToPointList aSelPoints;
startCurveModification( aSelPoints );
- double aX = myLocalPointView->item( theRow, 2 )->text().toDouble();
- double anY = myLocalPointView->item( theRow, 3 )->text().toDouble();
+ double aX = myLocalPointView->item( theRow, 2 )->data( Qt::UserRole ).toDouble();
+ double anY = myLocalPointView->item( theRow, 3 )->data( Qt::UserRole ).toDouble();
std::deque<float> aChangedPos;
aChangedPos.push_back( aX );
aChangedPos.push_back( anY );
finishCurveModification( aSelPoints );
setSelectedPonts();
- updateUndoRedo();
}
void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
std::deque<float> aChangedPos;
SectionToPointList::const_iterator anIt = myDragPoints.begin(), aLast = myDragPoints.end();
for ( ; anIt != aLast; anIt++ ) {
- aChangedPos = myCurve->getPoint( anIt->first, anIt->second );
+ int aSectionId = anIt->first;
+ int aPointId = anIt->second;
+ aChangedPos = myCurve->getPoint( aSectionId, aPointId );
if ( aChangedPos.size() < 2 )
continue;
aChangedPos[0] = aChangedPos[0] - aXDelta;
aChangedPos[1] = aChangedPos[1] - anYDelta;
+
+ aCoordList.push_back(
+ std::make_pair(std::make_pair( aSectionId, aPointId ),
+ aChangedPos ));
}
myCurve->setSeveralPoints( aCoordList );
if ( getActionMode() == ModificationMode )
setLocalPointContext( true );
setSelectedPonts( thePoints );
+ updateUndoRedo();
}
/**