Salome HOME
*** empty log message ***
[modules/multipr.git] / src / MULTIPRGUI / MULTIPR_GUI_Dlg.cxx
index 0a3ee2d65068ef06e74a6d4bbb68963435bae3f8..d17ccac339f3bea4d1d75fd67d7b458bc1a0a840 100644 (file)
 
 #include "MULTIPR_GUI_Dlg.h"
 #include "MULTIPR_GUI.h"
-#include "MULTIPR_Mesh.hxx"
-#include "MULTIPR_DecimationFilter.hxx"
 
 // Salome Includes
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SalomeApp_Application.h>
-#include <SalomeApp_DataModel.h>
-#include <SalomeApp_Study.h>
 #include <SalomeApp_CheckFileDlg.h>
-#include <LightApp_Study.h>
-#include <LightApp_DataModel.h>
-#include <LightApp_DataOwner.h>
 #include <LightApp_SelectionMgr.h>
-#include <CAM_DataModel.h>
-#include <CAM_Module.h>
 
 #include <SALOME_LifeCycleCORBA.hxx>
 
-#include <QtxPopupMgr.h>
-
 // QT Includes
 #include <qapplication.h>
 #include <qinputdialog.h>
@@ -62,19 +51,23 @@ using namespace std;
 
 
 MULTIPR_GUI_Partition1Dlg::MULTIPR_GUI_Partition1Dlg(MULTIPR_GUI* theModule) : 
-       QDialog( theModule->application()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+       QDialog(
+               theModule->application()->desktop(), 
+               0, 
+               false, 
+               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
        mModule = theModule;
        
     buttonGroupProcess = new QButtonGroup( this, "buttonGroupProcess" );
     buttonGroupProcess->setGeometry( QRect( 10, 110, 450, 60 ) );
 
+       pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
+    pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
+       
     pushButtonCancel = new QPushButton( buttonGroupProcess, "pushButtonCancel" );
     pushButtonCancel->setGeometry( QRect( 321, 10, 110, 41 ) );
 
-    pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
-    pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
-
     buttonGroupSelectMesh = new QButtonGroup( this, "buttonGroupSelectMesh" );
     buttonGroupSelectMesh->setGeometry( QRect( 10, 10, 450, 91 ) );
 
@@ -148,7 +141,11 @@ void MULTIPR_GUI_Partition1Dlg::reject()
 
 
 MULTIPR_GUI_Partition2Dlg::MULTIPR_GUI_Partition2Dlg(MULTIPR_GUI* theModule) : 
-       QDialog( theModule->application()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+       QDialog(
+               theModule->application()->desktop(), 
+               0, 
+               false, 
+               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
        mModule = theModule;
        
@@ -197,6 +194,7 @@ MULTIPR_GUI_Partition2Dlg::MULTIPR_GUI_Partition2Dlg(MULTIPR_GUI* theModule) :
        connect(pushButtonCancel, SIGNAL(clicked()), this, SLOT(reject()));
 }
 
+
 /*
  *  Destroys the object and frees any allocated resources
  */
@@ -228,7 +226,7 @@ void MULTIPR_GUI_Partition2Dlg::accept()
                for (QStringList::const_iterator it = partsList.begin(), last = partsList.end(); it != last; it++)
                {
                        const QString& partName = (*it);
-                       cout << "Split " << partName.latin1() << " #parts=" << nbParts << " splitter=" << strSplitter << endl;
+                       //cout << "Split " << partName.latin1() << " #parts=" << nbParts << " splitter=" << strSplitter << endl;
                        mModule->getMULTIPRObj()->partitionneGrain(partName.latin1(), nbParts, partitionner);
                }
                
@@ -254,7 +252,11 @@ void MULTIPR_GUI_Partition2Dlg::reject()
 
 
 MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
-       QDialog( theModule->application()->desktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+       QDialog(
+               theModule->application()->desktop(), 
+               0, 
+               false, 
+               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
        mModule = theModule;
        
@@ -335,29 +337,29 @@ MULTIPR_GUI_DecimateDlg::MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule) :
     spinBoxBoxing->setMaxValue( 200 );
     spinBoxBoxing->setMinValue( 2 );
     spinBoxBoxing->setValue( 100 );
+       QToolTip::add( spinBoxBoxing, tr( "grid: number of cells along each axis" ) );
 
     buttonGroupProcess = new QButtonGroup( this, "buttonGroupProcess" );
     buttonGroupProcess->setGeometry( QRect( 10, 480, 450, 60 ) );
 
+       pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
+    pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
+       
     pushButtonCancel = new QPushButton( buttonGroupProcess, "pushButtonCancel" );
     pushButtonCancel->setGeometry( QRect( 321, 10, 110, 41 ) );
        pushButtonCancel->setAccel( QKeySequence( tr( "Esc" ) ) );
-       
-    pushButtonOK = new QPushButton( buttonGroupProcess, "pushButtonOK" );
-    pushButtonOK->setGeometry( QRect( 10, 10, 110, 41 ) );
-       pushButtonOK->setAccel( QKeySequence( tr( "Return" ) ) );
     
        setCaption( tr( "Decimation" ) );
     buttonGroupSelectField->setTitle( tr( "Select field" ) );
     textLabelSelectFieldName->setText( tr( "Field name" ) );
-    textLabelSelectFieldIteration->setText( tr( "Iteration" ) );
+    textLabelSelectFieldIteration->setText( tr( "Field iteration" ) );
     buttonGroupSelectFilter->setTitle( tr( "Select filter" ) );
     textLabelSelectFilter->setText( tr( "Filter name" ) );
     buttonGroupParameters->setTitle( tr( "Set parameters" ) );
     textLabelTMed->setText( tr( "Threshold for medium resolution" ) );
     textLabelTLow->setText( tr( "Threshold for low resolution" ) );
     textLabelRadius->setText( tr( "Radius (neighborhood)" ) );
-    textLabelBoxing->setText( tr( "Boxing parameter" ) );
+    textLabelBoxing->setText( tr( "Acceleration structure (boxing)" ) );
     lineEditTMed->setText( tr( "0.1" ) );
     lineEditTLow->setText( tr( "0.2" ) );
 
@@ -520,6 +522,11 @@ void MULTIPR_GUI_DecimateDlg::OnRadiusAuto()
                lPartName,
                lPath,
                lMEDFileName);
+               
+       if (ret != 5)
+       {
+               return;
+       }
        
        QApplication::setOverrideCursor(Qt::waitCursor);
        float defaultRadius = 0.5f;
@@ -611,10 +618,15 @@ void MULTIPR_GUI_DecimateDlg::OnThresholdAuto()
 
 //*****************************************************************************
 // MULTIPR_GUI_ProgressCallbackDlg
+// QT dialog box used to display progress in time consuming task (e.g. save)
 //*****************************************************************************
 
 MULTIPR_GUI_ProgressCallbackDlg::MULTIPR_GUI_ProgressCallbackDlg(QWidget* parent) :
-       QProgressDialog(parent, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+       QProgressDialog(
+               parent, 
+               0, 
+               false, 
+               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
        setLabel(new QLabel(this, "Please wait"));
        setLabelText("Please wait");
@@ -624,6 +636,7 @@ MULTIPR_GUI_ProgressCallbackDlg::MULTIPR_GUI_ProgressCallbackDlg(QWidget* parent
 
 MULTIPR_GUI_ProgressCallbackDlg::~MULTIPR_GUI_ProgressCallbackDlg()
 {
+       // do nothing
 }