X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_StricklerTableOp.cxx;h=2433bca6e6ef285602b853c2162c5b3172464cb8;hb=36005df362d7bee6db949b079960cec90333aed2;hp=289bfb90625257bd8eae50fad2c0abfe1ffd4d5d;hpb=09203a28a524e987ab86ad2c85026555e4f37c98;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx index 289bfb90..2433bca6 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx +++ b/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx @@ -20,8 +20,11 @@ #include "HYDROGUI_StricklerTableDlg.h" #include "HYDROGUI_DataObject.h" +#include "HYDROGUI_Module.h" +#include "HYDROGUI_OCCDisplayer.h" #include "HYDROGUI_Operations.h" #include "HYDROGUI_Tool.h" +#include "HYDROGUI_UpdateFlags.h" #include @@ -57,14 +60,7 @@ void HYDROGUI_StricklerTableOp::startOperation() { // Edit selected Strickler table aPanel->setTableName( myObject->GetName() ); - - // Get Strickler table data from the data model - HYDROGUI_StricklerTableDlg::StricklerCoefficientList aData; - QStringList aTypes = myObject->GetTypes(); - for ( QStringList::iterator it = aTypes.begin(); it != aTypes.end(); ++it ) - aData.append( HYDROGUI_StricklerTableDlg::StricklerCoefficient( *it, myObject->Get( *it, 0 ) ) ); - - aPanel->setData( aData ); + aPanel->setGuiData( myObject ); } } else if ( isExport() ) @@ -147,7 +143,7 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE bool res = false; QString aFilePath = aPanel->getFileName().simplified(); if ( !aFilePath.isEmpty() ) - res = aStricklerTableObj->Export( HYDROGUI_Tool::ToAsciiString( aFilePath ) ); + res = aStricklerTableObj->Export( aFilePath ); return res; } @@ -158,18 +154,12 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE if( isEdit() ) { // Get data from input panel's table and save it into data model object - aStricklerTableObj->Clear(); - HYDROGUI_StricklerTableDlg::StricklerCoefficientList aData = aPanel->getData(); - for ( HYDROGUI_StricklerTableDlg::StricklerCoefficientList::iterator it = aData.begin(); it != aData.end(); ++it ) - { - const HYDROGUI_StricklerTableDlg::StricklerCoefficient& anInfo = *it; - aStricklerTableObj->Set( anInfo.myType, anInfo.myCoefficient ); - } + aPanel->getGuiData( aStricklerTableObj ); } else { // Import data from Strickler table file into data model object - aStricklerTableObj->Import( HYDROGUI_Tool::ToAsciiString( aFilePath ) ); + aStricklerTableObj->Import( aFilePath ); } aStricklerTableObj->Update(); @@ -180,9 +170,11 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE { QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aStricklerTableObj ); theBrowseObjectsEntries.append( anEntry ); + } else { + module()->getOCCDisplayer()->SetToUpdateColorScale(); } - theUpdateFlags |= UF_ObjBrowser; + theUpdateFlags |= UF_ObjBrowser | UF_OCCViewer; return true; }