#include <qlistview.h>
#include <qslider.h>
#include <qlabel.h>
+#include <qpushbutton.h>
SelectField::SelectField(FilterGUI* theModule,const QString& file,
const char* name,
_file(file),
_mesh(0),
_field(0),
- _ts(0),
- _myList( 0 ),
- _myLab( 0 ),
- _mySlider( 0 ),
- _fr( 0 )
+ _ts(0)
{
QListViewItem *element;
- cout << "File: " << _file << endl;
SCRUTE(_file);
_med = new ::MED(MED_DRIVER,_file);
deque<string> meshesNames = _med->getMeshNames();
}
element->setSelectable(false);
- _myGroupLayout->addWidget( _myList, row, 0 );
}
+ _myGroupLayout->addWidget( _myList, row, 0 );
row++;
// 1) label for time steps
_mySlider->hide();
row++;
+ // 3) buttons Close and Help
+ _GroupButtons = new QGroupBox(_GroupC1, "GroupButtons");
+ _GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, _GroupButtons->sizePolicy().hasHeightForWidth()));
+// _GroupButtons->setGeometry(QRect(10, 10, 281, 48));
+ _GroupButtons->setTitle(tr("" ));
+ _GroupButtons->setColumnLayout(0, Qt::Vertical);
+ _GroupButtons->layout()->setSpacing(0);
+ _GroupButtons->layout()->setMargin(0);
+ _GroupButtonsLayout = new QGridLayout(_GroupButtons->layout());
+ _GroupButtonsLayout->setAlignment(Qt::AlignTop);
+ _GroupButtonsLayout->setSpacing(6);
+ _GroupButtonsLayout->setMargin(11);
+ _buttonHelp = new QPushButton(_GroupButtons, "buttonHelp");
+ _buttonHelp->setText(tr("FILTER_BUT_HELP" ));
+ _buttonHelp->setAutoDefault(TRUE);
+ _GroupButtonsLayout->addWidget(_buttonHelp, 0, 1);
+ _buttonClose = new QPushButton(_GroupButtons, "buttonClose");
+ _buttonClose->setText(tr("FILTER_BUT_CLOSE" ));
+ _buttonClose->setAutoDefault(TRUE);
+ _GroupButtonsLayout->addWidget(_buttonClose, 0, 0);
+ _myGroupLayout->addWidget( _GroupButtons, row, 0 );
+ row++;
+
connect( _myList, SIGNAL(clicked(QListViewItem *)), this, SLOT(fieldSelected(QListViewItem *)));
connect( _mySlider, SIGNAL(sliderReleased()), this, SLOT(tsSelected()));
+ connect(_buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnClose()));
+ connect(_buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
this->show(); /* displays Dialog */
}
MESSAGE("Field " << _field );
MESSAGE("Time step " << _ts );
}
+
+void SelectField::ClickOnClose()
+{
+ MESSAGE("click on Cancel");
+ reject();
+}
+
+void SelectField::ClickOnHelp()
+{
+ MESSAGE("click on Help");
+}
SelectParams::SelectParams(FilterGUI* theModule,SelectField *sel,
const char* name,
bool modal, WFlags fl)
- : QDialog(FILTER::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), _size(128),
- _myExpr( 0 ),
- _myFunc( 0 ),
- _myFieldB( 0 ),
- _myLinear( 0 ),
- _myLog( 0 ),
- _myHisto( 0 ),
- _myNbThresh( 0 ),
- _myCutNeg( 0 ),
- _myOneThresh( 0 ),
- _myTwoThresh( 0 ),
- _myArea( 0 ),
- _myVThresh( 0 ),
- _myOutFile( 0 ),
- _myOFB( 0 ),
- _myProc( 0 ),
- _myFScale( 0 ),
- _myGroupLayout( 0 ),
- _myGroupLayout2( 0 ),
- _myPlot( 0 ),
- _GroupC1( 0 ),
- _GroupC2( 0 ),
- _lay( 0 ),
- _fr( 0 )
+ : QDialog(FILTER::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose), _size(128)
{
// Allocate histogram arrays
_x = new double[_size];
cout << "SelectParams: destructor called" << endl;
delete _x;
delete _y;
- if(_myIField) delete _myIField;
- if(_myDField) delete _myDField;
+ if(_myIField){
+ delete _myIField->getSupport();
+ delete _myIField;
+ }
+ if(_myDField){
+ delete _myDField->getSupport();
+ delete _myDField;
+ }
}
void SelectParams::buildFrame()
_myOutFile->setDisabled(true);
row++;
- // 8) process button (pushbutton)
- _myProc = new QPushButton( "", _GroupC1 );
+ // 8) buttons Process, Close and Help
+ _GroupButtons = new QGroupBox(_GroupC1, "GroupButtons");
+ _GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, _GroupButtons->sizePolicy().hasHeightForWidth()));
+ _GroupButtons->setTitle(tr("" ));
+ _GroupButtons->setColumnLayout(0, Qt::Vertical);
+ _GroupButtons->layout()->setSpacing(0);
+ _GroupButtons->layout()->setMargin(0);
+ _GroupButtonsLayout = new QGridLayout(_GroupButtons->layout());
+ _GroupButtonsLayout->setAlignment(Qt::AlignTop);
+ _GroupButtonsLayout->setSpacing(6);
+ _GroupButtonsLayout->setMargin(11);
+ _myProc = new QPushButton(_GroupButtons, "buttonProcess");
_myProc->setText(tr("FILTER_PROCESS"));
_myProc->setAutoDefault(TRUE);
- _myGroupLayout->addWidget( _myProc, row, 0 );
- _myProc->setDisabled(true);
+ _GroupButtonsLayout->addWidget(_myProc, 0, 0);
+ _buttonHelp = new QPushButton(_GroupButtons, "buttonHelp");
+ _buttonHelp->setText(tr("FILTER_BUT_HELP" ));
+ _buttonHelp->setAutoDefault(TRUE);
+ _GroupButtonsLayout->addWidget(_buttonHelp, 0, 2);
+ _buttonClose = new QPushButton(_GroupButtons, "buttonClose");
+ _buttonClose->setText(tr("FILTER_BUT_CLOSE" ));
+ _buttonClose->setAutoDefault(TRUE);
+ _GroupButtonsLayout->addWidget(_buttonClose, 0, 1);
+ _myGroupLayout->addWidget( _GroupButtons, row, 0 );
+ _GroupButtons->setDisabled(true);
row++;
_GroupC2 = new QGroupBox( this, "GroupC2" );
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()));
+ connect(_buttonClose, SIGNAL(clicked()), this, SLOT(ClickOnClose()));
+ connect(_buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ _GroupC2->setMinimumSize( 500, 500 );
+ _GroupC2->setMaximumSize( 500, 500 );
+ setMinimumSize( 750, 500 );
+ setMaximumSize( 750, 500 );
this->show(); /* displays Dialog */
}
_myPlot->setAxisOptions(_myPlot->curveYAxis( _myHistoCurve ), QwtAutoScale::None );
}
else{
- _ymin = 1.0;
+ // set min to 0.1 for log scale
+ _ymin = 0.1;
_myPlot->setAxisOptions(_myPlot->curveYAxis( _myHistoCurve ), QwtAutoScale::Logarithmic );
}
_myPlot->setAxisScale( _myPlot->curveYAxis( _myHistoCurve ), _ymin, _ymax );
_xmax = (double)xmax;
myh = _myIField->getHistogram(_size);
}
- _ymin = 0.0;
+ if( _myLinear->isChecked() )
+ _ymin = 0.0;
+ else
+ _ymin = 0.1;
_ymax = 0.0;
for(int i=0;i<_size;i++){
// calculate absisses for histogram values
_x[i]=_xmin+(i*(_xmax-_xmin))/_size;
- _y[i]=(double)myh[i];
+ // set zero to 0.01 because pb of zeros in log display with qwt
+ if(myh[i])
+ _y[i]=(double)myh[i];
+ else
+ _y[i]=0.01;
if( _y[i] > _ymax )
_ymax = _y[i];
}
_myArea->setEnabled(true);
_myVThresh->setEnabled(true);
_myOutFile->setEnabled(true);
- _myProc->setEnabled(true);
+ _GroupButtons->setEnabled(true);
_GroupC2->show();
}
}
{
string command;
- // send filtoo command
+ // have to call ensight driver MED to generate input for filtoo
+
MESSAGE("Input MED File : "<<_inputFile);
MESSAGE("Input Mesh : "<<_inputMesh);
MESSAGE("Input Field : "<<_inputField);
MESSAGE("Input Time Step : "<<_inputTS);
MESSAGE("Output file name: " << _myOFN->text() );
+
+ // send filtoo command
command = "cd /export/home/secher/filtoo/example;filtoo -f s -o sf > /tmp/filter.log";
MESSAGE(command);
system(command.c_str());
-// delete this;
+
+ // have to call ensight driver MED to generate output MED file from filtoo output
+
}
void SelectParams::calcRateRed()
}
+void SelectParams::ClickOnClose()
+{
+ MESSAGE("click on Cancel");
+ reject();
+}
+
+void SelectParams::ClickOnHelp()
+{
+ MESSAGE("click on Help");
+}
virtual void moveThresh(const QMouseEvent &e);
virtual void getOutFileName();
virtual void process();
+ virtual void ClickOnClose();
+ virtual void ClickOnHelp();
private:
QLineEdit *_myFThresh, *_myExpr, *_myLEST, *_myLEFT, *_myOFN;
QButtonGroup *_myFunc, *_myFScale, *_myNbThresh, *_myArea, *_myVThresh, *_myOutFile;
- QGridLayout *_myGroupLayout, *_myGroupLayout2, *_lay;
+ QGridLayout *_myGroupLayout, *_myGroupLayout2, *_lay, *_GroupButtonsLayout;
QRadioButton *_myCutNeg, *_myInt, *_myExt, *_myOneThresh, *_myTwoThresh, *_myFieldB, *_myLinear, *_myLog;
- QPushButton *_myHisto, *_myOFB, *_myProc;
- QGroupBox* _GroupC1, *_GroupC2;
+ QPushButton *_myHisto, *_myOFB, *_myProc, * _buttonClose, * _buttonHelp;
+ QGroupBox* _GroupC1, *_GroupC2, *_GroupButtons;
QwtPlot *_myPlot;
QLabel *_myLFT, *_myLST, *_myLRR;
QwtDiMap _qmap;