From: secher Date: Mon, 22 Jan 2007 16:54:23 +0000 (+0000) Subject: new version of select parameters IHM X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5b1ffddd812b53eff74215a03718f277516a9b12;p=modules%2Ffilter.git new version of select parameters IHM --- diff --git a/src/FILTERGUI/FILTER_msg_en.po b/src/FILTERGUI/FILTER_msg_en.po index f2d7f2b..53ebdc0 100644 --- a/src/FILTERGUI/FILTER_msg_en.po +++ b/src/FILTERGUI/FILTER_msg_en.po @@ -7,7 +7,7 @@ # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License. -# +# # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -32,124 +32,164 @@ msgstr "" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" - #: FilterGUI.cxx:271 msgid "FilterGUI::FILTER_MEN_ALL_FILES" msgstr "All Files ( * )" #: FilterGUI.cxx:300 -#, fuzzy -msgid "FilterGUI::MEN_OPEN" +msgid "FilterGUI::FILTER_MEN_IMPORT" msgstr "Open a MED file" -msgid "FilterGUI::FILTER_MEN_IMPORT" +#: FilterGUI.cxx:143 +msgid "FilterGUI::MEN_OPEN" msgstr "Open a MED file" #: FilterGUI.cxx:270 msgid "FilterGUI::FILTER_MEN_IMPORT_MED" msgstr "MED Files ( *.med )" -#: FilterGUI.cxx:296 -msgid "FILTER_WRN_WARNING" -msgstr "Warning" +#: SelectParams.cxx:123 +msgid "FILTER_PARAMS" +msgstr "Filtering parameters" -#: FilterGUI.cxx:280 -msgid "FILTER_INF_NOTIMPL" -msgstr "Not Implemented for this Object" +#: SelectParams.cxx:136 +msgid "FILTER_INPUT_FILE" +msgstr "Input Mesh : " -#: FilterGUI.cxx:298 -msgid "FILTER_BUT_OK" -msgstr "OK" +#: SelectParams.cxx:141 +msgid "FILTER_INPUT_MESH" +msgstr "Input File : " -#: FilterGUI.cxx:297 -msgid "FILTER_INF_NOIOR" -msgstr "Object has no IOR" +#: SelectParams.cxx:146 +msgid "FILTER_INPUT_FIELD" +msgstr "Input Field : " -#: FilterGUI.cxx:297 -msgid "FILTER_INF_MESHNAME" -msgstr "Please enter the name of the mesh you want to read" +#: SelectParams.cxx:151 +msgid "FILTER_INPUT_TS" +msgstr "Input Time Step : " -#: FilterGUI.cxx:297 -msgid "FILTER_INF_FIELDNAME" -msgstr "Please enter the name of the field you want to read" +#: SelectParams.cxx:159 +msgid "FILTER_SELECT_FUNC" +msgstr "Select function on field" +#: SelectParams.cxx:163 +msgid "FILTER_FIELD" +msgstr "Field" -# Menu items +#: SelectParams.cxx:168 +msgid "FILTER_GRADIENT" +msgstr "Gradient" -msgid "TOP_MESHSEL" -msgstr "Mesh selection" +#: SelectParams.cxx:174 +msgid "FILTER_DISPLAY_HISTO" +msgstr "Display Histogram" -msgid "MEN_FILTERING" -msgstr "Filtering" +#: SelectParams.cxx:181 +msgid "FILTER_TYPE_DISPLAY" +msgstr "Type of display" + +#: SelectParams.cxx:185 +msgid "FILTER_LINEAR" +msgstr "Linear" + +#: SelectParams.cxx:187 +msgid "FILTER_LOG" +msgstr "Logarithm" -msgid "STB_MESHSEL" -msgstr "Read a mesh" +#: SelectParams.cxx:197 +msgid "FILTER_SEL_THRESH" +msgstr "Select number of thresholds" -msgid "TOP_FIELDSEL" -msgstr "Field selection" +#: SelectParams.cxx:201 +msgid "FILTER_ONE_THRESH" +msgstr "One threshold" -msgid "MEN_FIELDSEL" -msgstr "Field selection" +#: SelectParams.cxx:203 +msgid "FILTER_TWO_THRESH" +msgstr "Two thresholds" -msgid "STB_FIELDSEL" -msgstr "Read a field" +#: SelectParams.cxx:210 +msgid "FILTER_REF_AREA" +msgstr "Select reference area" -msgid "TOP_EXPLORE" -msgstr "Explore Med File" +#: SelectParams.cxx:214 and 321 +msgid "FILTER_BOTTOM" +msgstr "Bottom" -msgid "MEN_EXPLORE" -msgstr "Explore Med File" +#: SelectParams.cxx:215 and 322 +msgid "FILTER_UP" +msgstr "Up" -msgid "STB_EXPLORE" -msgstr "Explore Med File" +#: SelectParams.cxx:330 +msgid "FILTER_INT" +msgstr "Interior" -msgid "TOP_DUMPMESH" -msgstr "Dump Mesh" +#: SelectParams.cxx:331 +msgid "FILTER_EXT" +msgstr "Exterior" -msgid "MEN_DUMPMESH" -msgstr "Dump Mesh" +#: SelectParams.cxx:223 +msgid "FILTER_TRESH_VAL" +msgstr "Threshold values" -msgid "STB_DUMPMESH" -msgstr "dump Mesh" +#: SelectParams.cxx:227 and 323 +msgid "FILTER_VAL_TRESH" +msgstr "threshold value " -msgid "TOP_DUMPSUBMESH" -msgstr "Dump SubMesh" +#: SelectParams.cxx:332 +msgid "FILTER_VAL_1_TRESH" +msgstr "1st threshold value" -msgid "MEN_DUMPSUBMESH" -msgstr "Dump SubMesh" +#: SelectParams.cxx:229 +msgid "FILTER_VAL_2_TRESH" +msgstr "2d threshold value" -msgid "STB_DUMPSUBMESH" -msgstr "dump Mesh" +#: SelectParams.cxx:239 +msgid "FILTER_OUT_FILE" +msgstr "Output file name" -msgid "TOP_POPUPTEST" -msgstr "Popup test" +#: SelectParams.cxx:244 +msgid "FILTER_BROWSE" +msgstr "Browse" -msgid "MEN_POPUPTEST" -msgstr "Popup test" +#: SelectParams.cxx:257 +msgid "FILTER_PROCESS" +msgstr "Process" -msgid "STB_POPUPTEST" -msgstr "Popup test" +#: SelectParams.cxx:266 +msgid "FILTER_HISTO" +msgstr "Histogram" -msgid "TOP_ERASE" -msgstr "Erase" +#: SelectParams.cxx:281 and 534 +msgid "FILTER_RED_RATE" +msgstr "Reduction rate" -msgid "MEN_ERASE" -msgstr "Erase" +#: SelectField.cxx:67 +msgid "FILTER_FILE" +msgstr "File : " -msgid "STB_ERASE" -msgstr "Erase" +#: SelectField.cxx:87 +msgid "FILTER_NAME" +msgstr "Name" -msgid "TOP_DISPLAY" -msgstr "Display" +#: SelectField.cxx:88 +msgid "FILTER_TYPE" +msgstr "Type" -msgid "MEN_DISPLAY" -msgstr "Display" +#: SelectField.cxx:91 +msgid "FILTER_MESH" +msgstr "Mesh" -msgid "STB_DISPLAY" -msgstr "Display" +#: SelectField.cxx:99 +msgid "FILTER_FIELD" +msgstr "Field" +#: SelectField.cxx:108 +msgid "FILTER_SEL_TS" +msgstr "Select a time step:" +# Menu items +msgid "MEN_FILTERING" +msgstr "Filtering" -msgid "TB_MED" -msgstr "Med Toolbar" diff --git a/src/FILTERGUI/SelectField.cxx b/src/FILTERGUI/SelectField.cxx index 164e7a6..450df1c 100644 --- a/src/FILTERGUI/SelectField.cxx +++ b/src/FILTERGUI/SelectField.cxx @@ -64,7 +64,7 @@ QFrame* SelectField::buildFrame() _lay->addWidget( _GroupC1,0,0 ); MESSAGE(basename(_file)); - QString qs("File : "); + QString qs(tr("FILTER_FILE")); qs.append(basename(_file)); _GroupC1->setTitle(qs); _GroupC1->setColumnLayout(0, Qt::Vertical ); @@ -84,11 +84,11 @@ QFrame* SelectField::buildFrame() _myList->setMinimumSize( 400, 400 ); _myList->setMaximumSize( 400, 400 ); _myList->setRootIsDecorated(true); - _myList->addColumn("Name"); - _myList->addColumn("Type"); + _myList->addColumn(tr("FILTER_NAME")); + _myList->addColumn(tr("FILTER_TYPE")); for(int i=0;isetExpandable(true); _myList->setOpen(element,true); @@ -96,7 +96,7 @@ QFrame* SelectField::buildFrame() deque myIteration = _med->getFieldIteration (fieldsNames[j]); string meshName = _med->getField(fieldsNames[j],myIteration[0].dt,myIteration[0].it)->getSupport()->getMesh()->getName(); if( strcmp(meshName.c_str(),meshesNames[i].c_str()) == 0) - new QListViewItem( element, fieldsNames[j], "Field" ); + new QListViewItem( element, fieldsNames[j], tr("FILTER_FIELD") ); } element->setSelectable(false); @@ -105,7 +105,7 @@ QFrame* SelectField::buildFrame() row++; // 1) label for time steps - _myLab = new QLabel("Select a time step:",_GroupC1); + _myLab = new QLabel(tr("FILTER_SEL_TS"),_GroupC1); _myLab->hide(); _myGroupLayout->addWidget( _myLab, row, 0 ); row++; diff --git a/src/FILTERGUI/SelectParams.cxx b/src/FILTERGUI/SelectParams.cxx index d38acc2..e1bffbf 100644 --- a/src/FILTERGUI/SelectParams.cxx +++ b/src/FILTERGUI/SelectParams.cxx @@ -120,7 +120,7 @@ QFrame* SelectParams::buildFrame() QGroupBox* _GroupC1 = new QGroupBox( _fr, "GroupC1" ); _lay->addWidget( _GroupC1,0,0 ); - _GroupC1->setTitle( tr( "Filtering parameters" ) ); + _GroupC1->setTitle( tr( "FILTER_PARAMS" ) ); _GroupC1->setColumnLayout(0, Qt::Vertical ); _GroupC1->layout()->setSpacing( 0 ); _GroupC1->layout()->setMargin( 0 ); @@ -133,57 +133,58 @@ QFrame* SelectParams::buildFrame() int row = 0; - QString qs1("Input File : "); + QString qs1(tr("FILTER_INPUT_FILE")); qs1.append(basename(_inputFile)); _myGroupLayout->addWidget( new QLabel( qs1, _GroupC1 ), row, 0 ); row++; - QString qs2("Input Mesh : "); + QString qs2(tr("FILTER_INPUT_MESH")); qs2.append(_inputMesh); _myGroupLayout->addWidget( new QLabel( qs2, _GroupC1 ), row, 0 ); row++; - QString qs3("Input Field : "); + QString qs3(tr("FILTER_INPUT_FIELD")); qs3.append(_inputField); _myGroupLayout->addWidget( new QLabel( qs3, _GroupC1 ), row, 0 ); row++; + QString qs4(tr("FILTER_INPUT_TS")); char strTS[128]; - sprintf(strTS,"Input Time Step : %d\0",_inputTS); - QString qs4(strTS); + sprintf(strTS,"%d\0",_inputTS); + qs4.append(strTS); _myGroupLayout->addWidget( new QLabel( qs4, _GroupC1 ), row, 0 ); row++; // 0) field function to calculate histogram (radiogroup) - _myFunc = new QButtonGroup( "Select function on field", _GroupC1 ); + _myFunc = new QButtonGroup( tr("FILTER_SELECT_FUNC"), _GroupC1 ); _myFunc->setExclusive( true ); _myFunc->setColumnLayout( 0, Qt::Horizontal ); - _myFieldB = new QRadioButton( "Field", _myFunc ); + _myFieldB = new QRadioButton( tr("FILTER_FIELD"), _myFunc ); _myFieldB->setChecked(true); QGridLayout* convLay = new QGridLayout( _myFunc->layout() ); convLay->addWidget( _myFieldB, 0, 0 ); - convLay->addWidget( _myCutNeg = new QRadioButton( "Gradient", _myFunc ), 0, 1 ); + convLay->addWidget( _myCutNeg = new QRadioButton( tr("FILTER_GRADIENT"), _myFunc ), 0, 1 ); _myGroupLayout->addWidget( _myFunc, row, 0 ); row++; // 1) display histogram button (pushbutton) - _myHisto = new QPushButton( "Display Histogram", _GroupC1 ); - _myHisto->setText("Display Histogram"); + _myHisto = new QPushButton( "", _GroupC1 ); + _myHisto->setText(tr("FILTER_DISPLAY_HISTO")); _myHisto->setAutoDefault(TRUE); _myHisto->setDefault(TRUE); _myGroupLayout->addWidget( _myHisto, row, 0 ); row++; // 2) scale of histogram (radiogroup) - _myFScale = new QButtonGroup( "Type of display", _GroupC1 ); + _myFScale = new QButtonGroup( tr("FILTER_TYPE_DISPLAY"), _GroupC1 ); _myFScale->setExclusive( true ); _myFScale->setColumnLayout( 0, Qt::Horizontal ); - _myLinear = new QRadioButton( "Linear", _myFScale ); + _myLinear = new QRadioButton( tr("FILTER_LINEAR"), _myFScale ); _myLinear->setChecked(true); - _myLog = new QRadioButton( "Logarithm", _myFScale ); + _myLog = new QRadioButton( tr("FILTER_LOG"), _myFScale ); _myFScale->setDisabled(true); QGridLayout* scaleLay = new QGridLayout( _myFScale->layout() ); @@ -193,12 +194,12 @@ QFrame* SelectParams::buildFrame() row++; // 3) number of thresholds (radiogroup) - _myNbThresh = new QButtonGroup( "Select number of thresholds", _GroupC1 ); + _myNbThresh = new QButtonGroup( tr("FILTER_SEL_THRESH"), _GroupC1 ); _myNbThresh->setExclusive( true ); _myNbThresh->setColumnLayout( 0, Qt::Horizontal ); QGridLayout* nbtLay = new QGridLayout( _myNbThresh->layout() ); - nbtLay->addWidget( _myOneThresh = new QRadioButton( "One threshold", _myNbThresh ), 0, 0 ); - nbtLay->addWidget( _myTwoThresh = new QRadioButton( "Two thresholds", _myNbThresh ), 0, 1 ); + nbtLay->addWidget( _myOneThresh = new QRadioButton( tr("FILTER_ONE_THRESH"), _myNbThresh ), 0, 0 ); + nbtLay->addWidget( _myTwoThresh = new QRadioButton( tr("FILTER_TWO_THRESH"), _myNbThresh ), 0, 1 ); _myGroupLayout->addWidget( _myNbThresh, row, 0 ); _myOneThresh->setChecked(true); @@ -206,12 +207,12 @@ QFrame* SelectParams::buildFrame() row++; // 4) reference area on thresholds (radiogroup) - _myArea = new QButtonGroup( "Select reference area", _GroupC1 ); + _myArea = new QButtonGroup( tr("FILTER_REF_AREA"), _GroupC1 ); _myArea->setExclusive( true ); _myArea->setColumnLayout( 0, Qt::Horizontal ); QGridLayout* areaLay = new QGridLayout( _myArea->layout() ); - areaLay->addWidget( _myInt = new QRadioButton( "Interior", _myArea ), 0, 0 ); - areaLay->addWidget( _myExt = new QRadioButton( "Exterior", _myArea ), 0, 1 ); + areaLay->addWidget( _myInt = new QRadioButton( tr("FILTER_BOTTOM"), _myArea ), 0, 0 ); + areaLay->addWidget( _myExt = new QRadioButton( tr("FILTER_UP"), _myArea ), 0, 1 ); _myGroupLayout->addWidget( _myArea, row, 0 ); _myExt->setChecked(true); @@ -219,13 +220,13 @@ QFrame* SelectParams::buildFrame() row++; // 5) threshold values (line edit) - _myVThresh = new QButtonGroup( "Threshold values", _GroupC1 ); + _myVThresh = new QButtonGroup( tr("FILTER_TRESH_VAL"), _GroupC1 ); _myVThresh->setExclusive( true ); _myVThresh->setColumnLayout( 0, Qt::Horizontal ); QGridLayout* ftLay = new QGridLayout( _myVThresh->layout() ); - ftLay->addWidget( _myLFT = new QLabel( "threshold value " , _myVThresh ), 0, 0 ); + ftLay->addWidget( _myLFT = new QLabel( tr("FILTER_VAL_TRESH") , _myVThresh ), 0, 0 ); ftLay->addWidget( _myLEFT = new QLineEdit( "", _myVThresh ), 0, 1 ); - ftLay->addWidget( _myLST = new QLabel( "2d threshold value" , _myVThresh ), 1, 0 ); + ftLay->addWidget( _myLST = new QLabel( tr("FILTER_VAL_2_TRESH") , _myVThresh ), 1, 0 ); ftLay->addWidget( _myLEST = new QLineEdit( "", _myVThresh ), 1, 1 ); _myGroupLayout->addWidget( _myVThresh, row, 0 ); @@ -235,12 +236,12 @@ QFrame* SelectParams::buildFrame() row++; // 6) output file name (line edit) - _myOutFile = new QButtonGroup( "Output file name", _GroupC1 ); + _myOutFile = new QButtonGroup( tr("FILTER_OUT_FILE"), _GroupC1 ); _myOutFile->setExclusive( true ); _myOutFile->setColumnLayout( 0, Qt::Horizontal ); - _myOFB = new QPushButton( "Browse", _myOutFile ); - _myOFB->setText("Browse"); + _myOFB = new QPushButton( "", _myOutFile ); + _myOFB->setText(tr("FILTER_BROWSE")); _myOFB->setAutoDefault(TRUE); QGridLayout* outLay = new QGridLayout( _myOutFile->layout() ); @@ -252,8 +253,8 @@ QFrame* SelectParams::buildFrame() row++; // 8) process button (pushbutton) - _myProc = new QPushButton( "Process", _GroupC1 ); - _myProc->setText("Process"); + _myProc = new QPushButton( "", _GroupC1 ); + _myProc->setText(tr("FILTER_PROCESS")); _myProc->setAutoDefault(TRUE); _myGroupLayout->addWidget( _myProc, row, 0 ); _myProc->setDisabled(true); @@ -262,12 +263,13 @@ QFrame* SelectParams::buildFrame() _GroupC2 = new QGroupBox( _fr, "GroupC2" ); _lay->addWidget( _GroupC2,0,1 ); - _GroupC2->setTitle( tr( "Histogram" ) ); + _GroupC2->setTitle( tr( "FILTER_HISTO" ) ); _GroupC2->setColumnLayout(0, Qt::Vertical ); _GroupC2->layout()->setSpacing( 0 ); _GroupC2->layout()->setMargin( 0 ); _myGroupLayout2 = new QGridLayout( _GroupC2->layout() ); + // 9) histogram curve _myPlot = new QwtPlot(_GroupC2); _myHistoCurve = _myPlot->insertCurve( QString() ); _myPlot->setCurvePen( _myHistoCurve, QPen( Qt::red, 1 ) ); @@ -275,8 +277,11 @@ QFrame* SelectParams::buildFrame() _myGroupLayout2->addWidget( _myPlot, 0, 0 ); - // 9) reduction rate (label) - _myGroupLayout2->addWidget( _myLRR = new QLabel( "reduction rate = 0.5", _GroupC2 ), 1, 0 ); + // 10) reduction rate (label) + QString qs5(tr("FILTER_RED_RATE")); + qs5.append(" = 0.5"); + _myLRR = new QLabel( qs5, _GroupC2 ); + _myGroupLayout2->addWidget( _myLRR, 1, 0 ); _GroupC2->hide(); @@ -292,8 +297,8 @@ QFrame* SelectParams::buildFrame() connect( _myTwoThresh, SIGNAL(clicked()), this, SLOT(nbThreshSelected())); connect( _myInt, SIGNAL(clicked()), this, SLOT(areaSelected())); connect( _myExt, SIGNAL(clicked()), this, SLOT(areaSelected())); - connect( _myLEFT, SIGNAL(returnPressed()), this, SLOT(displayFThresh())); - connect( _myLEST, SIGNAL(returnPressed()), this, SLOT(displaySThresh())); + connect( _myLEFT, SIGNAL(returnPressed()), this, SLOT(enterFThresh())); + connect( _myLEST, SIGNAL(returnPressed()), this, SLOT(enterSThresh())); connect( _myPlot, SIGNAL(plotMouseMoved(const QMouseEvent &)), this, SLOT(moveThresh(const QMouseEvent &))); connect( _myOFB, SIGNAL(clicked()), this, SLOT(getOutFileName())); connect( _myProc, SIGNAL(clicked()), this, SLOT(process())); @@ -313,18 +318,18 @@ void SelectParams::scaleSelected() void SelectParams::nbThreshSelected() { if( _myOneThresh->isChecked() ){ - _myInt->setText("bottom"); - _myExt->setText("up"); - _myLFT->setText("threshold value "); + _myInt->setText(tr("FILTER_BOTTOM")); + _myExt->setText(tr("FILTER_UP")); + _myLFT->setText(tr("FILTER_VAL_TRESH")); _myLST->hide(); _myLEST->hide(); displayFThresh(); clearSThresh(); } else{ - _myInt->setText("interior"); - _myExt->setText("exterior"); - _myLFT->setText("1st threshold value"); + _myInt->setText(tr("FILTER_INT")); + _myExt->setText(tr("FILTER_EXT")); + _myLFT->setText(tr("FILTER_VAL_1_TRESH")); if(_myLST->isHidden()) _myLST->show(); if(_myLEST->isHidden()) @@ -340,19 +345,31 @@ void SelectParams::areaSelected() calcRateRed(); } +void SelectParams::enterFThresh() +{ + displayFThresh(); + calcRateRed(); +} + +void SelectParams::enterSThresh() +{ + displaySThresh(); + calcRateRed(); +} + void SelectParams::calcHisto() { char strth[128]; _xmin = -50.0; _xmax = 50.0; - _ymax = 100.0; - _ymin = _ymax; + _ymin = 1.0; + _ymax = 0.0; for(int i=0;i<_size;i++){ _x[i]=_xmin+(i*(_xmax-_xmin))/_size; _y[i]=80.*exp(-_x[i]*_x[i]/400.); - if( (_y[i] < _ymin) && (_y[i] != 0.0) ) - _ymin = _y[i]; + if( _y[i] > _ymax ) + _ymax = _y[i]; } _fthresh = (_xmin + _xmax)/2.0; _sthresh = (_xmin + 3.*_xmax)/4.0; @@ -525,9 +542,12 @@ void SelectParams::calcRateRed() asel = atot - asel; } rateRed = (double)asel / (double) atot; - sprintf(strth,"reduction rate = %4.2g",rateRed); - _myLRR->setText( strth ); + QString qs(tr("FILTER_RED_RATE")); + char str[128]; + sprintf(str," = %4.2g",rateRed); + qs.append(str); + _myLRR->setText( qs ); } diff --git a/src/FILTERGUI/SelectParams.h b/src/FILTERGUI/SelectParams.h index 25a75bd..bdb15ad 100644 --- a/src/FILTERGUI/SelectParams.h +++ b/src/FILTERGUI/SelectParams.h @@ -54,14 +54,16 @@ protected: virtual void displayHisto(); virtual void calcRateRed(); virtual void clearSThresh(); + virtual void displayFThresh(); + virtual void displaySThresh(); protected slots: virtual void updateHisto(); virtual void scaleSelected(); virtual void nbThreshSelected(); virtual void areaSelected(); - virtual void displayFThresh(); - virtual void displaySThresh(); + virtual void enterFThresh(); + virtual void enterSThresh(); virtual void moveThresh(const QMouseEvent &e); virtual void getOutFileName(); virtual void process();