X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROCurveCreator%2FCurveCreator_TreeView.cxx;h=36d1dfcfb5dfc3c85f68468445cfdf826ae61514;hb=a46541e0be13311c6bf3a14265f4f79d059af360;hp=c48eb510185e64da8fd76ee859f5b80a9b05edeb;hpb=254aba54a085eac64aa4ec13f1d46beac722a252;p=modules%2Fhydro.git diff --git a/src/HYDROCurveCreator/CurveCreator_TreeView.cxx b/src/HYDROCurveCreator/CurveCreator_TreeView.cxx index c48eb510..36d1dfcf 100755 --- a/src/HYDROCurveCreator/CurveCreator_TreeView.cxx +++ b/src/HYDROCurveCreator/CurveCreator_TreeView.cxx @@ -249,7 +249,6 @@ QList CurveCreator_TreeView::getSelectedSections() const aSect << aModel->getSection( anIndxs[i] ); } } - qSort(aSect.begin(), aSect.end()); return aSect; } @@ -365,16 +364,6 @@ void CurveCreator_TreeView::sectionsSwapped( int theSection, int theOffset ) } } -void CurveCreator_TreeView::pointsSwapped( int theSection, int thePointNum, int theOffset ) -{ - CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); - if( aModel ){ - QModelIndex aFirstIndex = aModel->pointIndex( theSection, thePointNum ); - QModelIndex aSecondIndex = aModel->pointIndex( theSection, thePointNum + theOffset ); - swapIndexes( aFirstIndex, aSecondIndex ); - } -} - void CurveCreator_TreeView::setSelectedSections( const QList& theList ) { CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); @@ -387,18 +376,6 @@ void CurveCreator_TreeView::setSelectedSections( const QList& theList ) } } -void CurveCreator_TreeView::setSelectedPoints( const QList< QPair >& thePointsList ) -{ - CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); - if( aModel ){ - selectionModel()->clearSelection(); - for( int i = 0 ; i < thePointsList.size() ; i++ ){ - QModelIndex aSectIndx = aModel->pointIndex( thePointsList[i].first, thePointsList[i].second ); - selectionModel()->select(aSectIndx, QItemSelectionModel::Select ); - } - } -} - bool pointLessThan(const QPair &s1, const QPair &s2) { if( s1.first < s2.first ) @@ -408,25 +385,6 @@ bool pointLessThan(const QPair &s1, const QPair &s2) return s1.second < s2.second; } -QList< QPair< int, int > > CurveCreator_TreeView::getSelectedPoints() const -{ - QList< QPair< int, int > > aPoints; - CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); - if( !aModel ) - return aPoints; - QModelIndexList anIndxs = selectionModel()->selectedIndexes(); - for( int i = 0 ; i < anIndxs.size() ; i++ ){ - if( !aModel->isSection( anIndxs[i] ) ){ - int aSect = aModel->getSection(anIndxs[i]); - int aPointNum = aModel->getPoint(anIndxs[i]); - QPair< int, int > aPoint = QPair( aSect, aPointNum ); - aPoints.push_back( aPoint ); - } - } - qSort( aPoints.begin(), aPoints.end(), pointLessThan ); - return aPoints; -} - CurveCreator_TreeView::SelectionType CurveCreator_TreeView::getSelectionType() const { CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); @@ -474,10 +432,7 @@ void CurveCreator_TreeView::onActivated( QModelIndex theIndx ) int aSect = aModel->getSection(theIndx); if( aModel->isSection(theIndx) ){ emit sectionEntered( aSect ); - return; } - int aPointNum = aModel->getPoint( theIndx ); - emit pointEntered( aSect, aPointNum ); } void CurveCreator_TreeView::setCurve( CurveCreator_ICurve* theCurve )