Salome HOME
First compilable version
authorouv <ouv@opencascade.com>
Wed, 9 Dec 2009 10:02:02 +0000 (10:02 +0000)
committerouv <ouv@opencascade.com>
Wed, 9 Dec 2009 10:02:02 +0000 (10:02 +0000)
39 files changed:
src/SMESHGUI/Makefile.am
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx
src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h
src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx
src/SMESHGUI/SMESHGUI_ExtrusionDlg.h
src/SMESHGUI/SMESHGUI_Helper.cxx [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_Helper.h [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_Hypotheses.h
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx
src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.h
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
src/SMESHGUI/SMESHGUI_MeshPatternDlg.h
src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx
src/SMESHGUI/SMESHGUI_MoveNodesDlg.h
src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx
src/SMESHGUI/SMESHGUI_MultiEditDlg.h
src/SMESHGUI/SMESHGUI_NodesDlg.cxx
src/SMESHGUI/SMESHGUI_NodesDlg.h
src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx
src/SMESHGUI/SMESHGUI_RevolutionDlg.h
src/SMESHGUI/SMESHGUI_RotationDlg.cxx
src/SMESHGUI/SMESHGUI_RotationDlg.h
src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx
src/SMESHGUI/SMESHGUI_SmoothingDlg.h
src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx
src/SMESHGUI/SMESHGUI_SymmetryDlg.h
src/SMESHGUI/SMESHGUI_TranslationDlg.cxx
src/SMESHGUI/SMESHGUI_TranslationDlg.h
src/SMESH_I/SMESH_Gen_i_1.cxx
src/SMESH_I/SMESH_Hypothesis_i.cxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_I/SMESH_NoteBook.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h

index 1b278b946e70a226869b4b8072c4ce196139c810..a4edc0785b8723391e92d2904720581c61067945 100644 (file)
@@ -41,6 +41,7 @@ salomeinclude_HEADERS = \
        SMESHGUI_PatternUtils.h \
        SMESHGUI_GroupUtils.h \
        SMESHGUI_PatternWidget.h \
+       SMESHGUI_Helper.h \
        SMESHGUI_CreatePatternDlg.h \
        SMESHGUI_MeshPatternDlg.h \
        SMESHGUI_NodesDlg.h \
@@ -99,6 +100,7 @@ lib_LTLIBRARIES = libSMESH.la
 dist_libSMESH_la_SOURCES = \
        SMESHGUI.cxx \
        SMESHGUI_PatternWidget.cxx \
+       SMESHGUI_Helper.cxx \
        SMESHGUI_CreatePatternDlg.cxx \
        SMESHGUI_MeshPatternDlg.cxx \
        SMESHGUI_SpinBox.cxx \
index 1e58867d020b787d620e2ecf65bac563ffbd279d..3e819cd53ead6b3963e09ea58f062a202278b206 100644 (file)
@@ -72,6 +72,7 @@
 //=================================================================================
 SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
   : QDialog(SMESH::GetDesktop(theModule)),
+    SMESHGUI_Helper(theModule),
     mySMESHGUI(theModule),
     mySelectionMgr(SMESH::GetSelectionMgr(theModule))
 {
@@ -513,17 +514,7 @@ void SMESHGUI_BuildCompoundDlg::onSelectMerge(bool toMerge)
 //=================================================================================
 bool SMESHGUI_BuildCompoundDlg::isValid()
 {
-  QString msg;
-  bool ok=true;
-  if(CheckBoxMerge->isChecked())
-    ok = SpinBoxTol->isValid( msg, true );
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
+  if( CheckBoxMerge->isChecked() )
+    return checkParameters( true, 1, SpinBoxTol );
   return true;
 }
index c1085739d8d5d6ff9cfa444e341714efd464ab7d..9629b1b00d72afb0bc578dc94b8bdbfd31d16e30 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -53,7 +54,7 @@ class SUIT_SelectionFilter;
 // class    : SMESHGUI_BuildCompoundDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog, public SMESHGUI_Helper
 {
   Q_OBJECT;
 
index 2131b25e6c403ce886222b302a82541b1ecc1090..cb5656231ee5278b8d93af5f186156fa4dd61853 100644 (file)
@@ -109,6 +109,7 @@ private:
 //=================================================================================
 SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg( 0 )
@@ -1132,14 +1133,9 @@ int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
 //=======================================================================
 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
 {
-  QString msg;
-  if( !AngleSpin->isValid( msg, true ) ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+  if( !checkParameters( true, 1, AngleSpin ) )
     return;
-  }
+
   AnglesList->addItem(AngleSpin->text());
   myAnglesList.append(AngleSpin->GetValue());
 
@@ -1242,20 +1238,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_ExtrusionAlongPathDlg::isValid()
 {
-  QString msg;
-  bool ok = true;
-  ok = XSpin->isValid( msg, true ) && ok;
-  ok = YSpin->isValid( msg, true ) && ok;
-  ok = ZSpin->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  return checkParameters( true, 3, XSpin, YSpin, ZSpin );
 }
 
 //=================================================================================
index e93985ae1e92f584d129383d28fdec122ed73ef9..b132cb8db9551c3eea296920af48395cfa650fe4 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -59,7 +60,7 @@ class SUIT_SelectionFilter;
 // class    : SMESHGUI_ExtrusionAlongPathDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog, public SMESHGUI_Helper
 {
   Q_OBJECT
 
index 7c32fc1e24b9b94fd64d8344609f63923d715dd4..31e76131e7bbb3c5e916614c1ea4af9869bd160c 100644 (file)
@@ -88,6 +88,7 @@
 //=================================================================================
 SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg( 0 ),
@@ -1009,26 +1010,11 @@ void SMESHGUI_ExtrusionDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_ExtrusionDlg::isValid()
 {
-  QString msg;
-  bool ok = true;
-  if ( RadioButton3->isChecked() ) {
-    ok = SpinBox_Dx->isValid( msg, true ) && ok;
-    ok = SpinBox_Dy->isValid( msg, true ) && ok;
-    ok = SpinBox_Dz->isValid( msg, true ) && ok;
-  } else if ( RadioButton4->isChecked() ) {
-    ok = SpinBox_Vx->isValid( msg, true ) && ok;
-    ok = SpinBox_Vy->isValid( msg, true ) && ok;
-    ok = SpinBox_Vz->isValid( msg, true ) && ok;
-    ok = SpinBox_VDist->isValid( msg, true ) && ok;
-  }
-  ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  QList<QAbstractSpinBox*> aSpinBoxList;
+  if ( RadioButton3->isChecked() )
+    aSpinBoxList << SpinBox_Dx << SpinBox_Dy << SpinBox_Dz;
+  else if ( RadioButton4->isChecked() )
+    aSpinBoxList << SpinBox_Vx << SpinBox_Vy << SpinBox_Vz;
+  aSpinBoxList << SpinBox_NbSteps;
+  return checkParameters( true, aSpinBoxList );
 }
index 4425d29f78bdc5531d8430317c78df22620b3d29..c9ce09248b650e311883a3ba5d7e4cd25eb157f0 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // SALOME GUI includes
 #include <SALOME_InteractiveObject.hxx>
@@ -61,7 +62,7 @@ class SalomeApp_IntSpinBox;
 // class    : SMESHGUI_ExtrusionDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public QDialog, public SMESHGUI_Helper
 {
   Q_OBJECT
 
diff --git a/src/SMESHGUI/SMESHGUI_Helper.cxx b/src/SMESHGUI/SMESHGUI_Helper.cxx
new file mode 100644 (file)
index 0000000..493ca23
--- /dev/null
@@ -0,0 +1,137 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  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
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// SMESH SMESHGUI : GUI for SMESH component
+// File   : SMESHGUI_Helper.cxx
+// Author : Oleg UVAROV
+// SMESH includes
+//
+#include "SMESHGUI_Helper.h"
+#include "SMESHGUI.h"
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_Notebook.h>
+
+// IDL includes
+//#include <SALOMEconfig.h>
+//#include CORBA_SERVER_HEADER(SMESH_Mesh)
+//#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+
+//=================================================================================
+// name    : SMESHGUI_Helper::SMESHGUI_Helper
+// Purpose :
+//=================================================================================
+SMESHGUI_Helper::SMESHGUI_Helper( SMESHGUI* theModule ) :
+  mySMESHGUI( theModule ),
+  myNotebook( 0 )
+{
+}
+
+//=======================================================================
+// name    : SMESHGUI_Helper::~SMESHGUI_Helper
+// Purpose :
+//=======================================================================
+SMESHGUI_Helper::~SMESHGUI_Helper()
+{
+  if( myNotebook )
+  {
+    delete myNotebook;
+    myNotebook = 0;
+  }
+}
+
+//================================================================
+// Function : checkParameters
+// Purpose  :
+//================================================================
+bool SMESHGUI_Helper::checkParameters( bool theMess, int theCount, QAbstractSpinBox* theFirstSpinBox, ... )
+{
+  va_list aSpins;
+  va_start( aSpins, theFirstSpinBox );
+
+  int aCounter = 0;
+  QList<QAbstractSpinBox*> aSpinBoxList;
+  QAbstractSpinBox* aSpinBox = theFirstSpinBox;
+  while( aSpinBox && aCounter < theCount )
+  {
+    aSpinBoxList.append( aSpinBox );
+    aSpinBox = va_arg( aSpins, QAbstractSpinBox* );
+    aCounter++;
+  }
+  return checkParameters( theMess, aSpinBoxList );
+}
+
+//================================================================
+// Function : checkParameters
+// Purpose  :
+//================================================================
+bool SMESHGUI_Helper::checkParameters( bool theMess, const QList<QAbstractSpinBox*>& theSpinBoxList )
+{
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if ( !app )
+    return false;
+
+  QString msg;
+  QStringList absentParams;
+
+  bool ok = true;
+  QListIterator<QAbstractSpinBox*> anIter( theSpinBoxList );
+  while( anIter.hasNext() )
+  {
+    QAbstractSpinBox* aSpinBox = anIter.next();
+    if( SalomeApp_DoubleSpinBox* aDoubleSpinBox = dynamic_cast<SalomeApp_DoubleSpinBox*>( aSpinBox ) )
+      ok = aDoubleSpinBox->isValid( msg, absentParams, theMess ) && ok;
+    else if( SalomeApp_IntSpinBox* anIntSpinBox = dynamic_cast<SalomeApp_IntSpinBox*>( aSpinBox ) )
+      ok = anIntSpinBox->isValid( msg, absentParams, theMess ) && ok;
+  }
+
+  if( !ok && theMess )
+  {
+    if( !absentParams.isEmpty() )
+      app->defineAbsentParameters( absentParams );
+    else
+    {
+      QString str( QObject::tr( "SMESH_INCORRECT_INPUT" ) );
+      if( !msg.isEmpty() )
+        str += "\n" + msg;
+      SUIT_MessageBox::critical( mySMESHGUI->desktop(), QObject::tr( "SMESH_ERROR" ), str );
+    }
+  }
+  return ok;
+}
+
+//================================================================
+// Function : getNotebook
+// Purpose  :
+//================================================================
+SalomeApp_Notebook* SMESHGUI_Helper::getNotebook()
+{
+  if ( !myNotebook )
+    myNotebook = new SalomeApp_Notebook( mySMESHGUI->activeStudy() );
+  return myNotebook;
+}
diff --git a/src/SMESHGUI/SMESHGUI_Helper.h b/src/SMESHGUI/SMESHGUI_Helper.h
new file mode 100644 (file)
index 0000000..b94ef82
--- /dev/null
@@ -0,0 +1,62 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  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
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// SMESH SMESHGUI : GUI for SMESH component
+// File   : SMESHGUI_Helper.h
+// Author : Oleg UVAROV
+//
+#ifndef SMESHGUI_HELPER_H
+#define SMESHGUI_HELPER_H
+
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
+// Qt includes
+#include <QList>
+
+class SMESHGUI;
+class SalomeApp_Notebook;
+class QAbstractSpinBox;
+
+//=================================================================================
+// class    : SMESHGUI_Helper
+// purpose  : Helper class for dialog box development, can be used as the second
+//            base class for dialog box (or for corresponding operation, if exists).
+//            Contains methods performing operations with SALOME Notebook parameters.
+//=================================================================================
+class SMESHGUI_EXPORT SMESHGUI_Helper
+{ 
+public:
+  SMESHGUI_Helper( SMESHGUI* );
+  virtual ~SMESHGUI_Helper();
+
+protected:
+  bool                checkParameters( bool, int, QAbstractSpinBox*, ... );
+  bool                checkParameters( bool, const QList<QAbstractSpinBox*>& );
+
+  SalomeApp_Notebook* getNotebook();
+
+private:
+  SMESHGUI*           mySMESHGUI;
+  SalomeApp_Notebook* myNotebook;
+};
+
+#endif // SMESHGUI_HELPER_H
index b0ced7bb6d5cae5f867e53b072ccaf0820bf061b..793cc17518e2b183a1fc31e78f1db8cadc332d14 100644 (file)
@@ -40,6 +40,7 @@
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <LightApp_Application.h>
+#include <SalomeApp_Application.h>
 #include <SalomeApp_IntSpinBox.h>
 
 // Qt includes
@@ -192,6 +193,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
         break;
       case QVariant::String:
         {
+          /* ouv: temporarily disabled
           if((*anIt).isVariable) {
             _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
             QString aVar = (*anIt).myValue.toString();
@@ -213,13 +215,14 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
             }
           }
           else {
+          */
             QLineEdit* le = new QLineEdit( GroupC1 );
             le->setObjectName( (*anIt).myName );
             attuneStdWidget( le, i );
             le->setText( (*anIt).myValue.toString() );
             connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
             w = le;
-          }
+          //}
         }
         break;
       }
@@ -476,7 +479,7 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWi
   return false;
 }
 
-bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const
+bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg, QStringList& absentParams ) const
 {
   bool ok = true;
   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
@@ -485,12 +488,12 @@ bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const
     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
     {
       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
-      ok = sb->isValid( msg, true ) && ok;
+      ok = sb->isValid( msg, absentParams, true ) && ok;
     }
     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
     {
       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
-      ok = sb->isValid( msg, true ) && ok;
+      ok = sb->isValid( msg, absentParams, true ) && ok;
     }
   }
   return ok;
@@ -599,8 +602,17 @@ void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
 void SMESHGUI_HypothesisDlg::accept()
 {
   QString msg;
-  if ( myCreator && !myCreator->checkParams( msg ) )
+  QStringList absentParams;
+  if ( myCreator && !myCreator->checkParams( msg, absentParams ) )
   {
+    if( !absentParams.isEmpty() )
+    {
+      SalomeApp_Application* app =
+        dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+      if( app )
+        app->defineAbsentParameters( absentParams );
+      return;
+    }
     QString str( tr( "SMESH_INCORRECT_INPUT" ) );
     if ( !msg.isEmpty() )
       str += "\n" + msg;
index 0891def1bc6a8f898d6b891f5970da7edf01419e..70da0b4d3506f9c4963b19fd670538f0ca3eb02b 100644 (file)
@@ -57,7 +57,7 @@ public:
   void                         edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
   void                         setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
 
-  virtual bool                 checkParams( QString& ) const;
+  virtual bool                 checkParams( QString&, QStringList& ) const;
   virtual void                 onReject();
   virtual QString              helpPage() const;
 
index ae769c301a1f3751f07da2e509974af69008eaa7..e7de2f0417579739531b3a18771a32f06764ab09 100644 (file)
@@ -267,6 +267,7 @@ void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled (bool on)
 //================================================================================
 
 SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
+  : SMESHGUI_Helper( getSMESHGUI() )
 {
   mySimulation = 0;
   myDlg = new SMESHGUI_MakeNodeAtPointDlg;
@@ -375,8 +376,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
   QString msg;
   if ( !isValid( msg ) ) { // node id is invalid
     if( !msg.isEmpty() )
-      SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
-                                tr("INVALID_ID") );
+      SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ), msg );
     dlg()->show();
     return false;
   }
@@ -442,6 +442,9 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
 
 bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
 {
+  if( !checkParameters( !myNoPreview, 3, myDlg->myX, myDlg->myY, myDlg->myZ ) )
+    return false;
+
   bool ok = true;
   if ( myMeshActor &&
        myDlg->myMoveRBtn->isChecked() &&
@@ -455,11 +458,6 @@ bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
     if( !ok )
       msg += tr("INVALID_ID") + "\n";
   }
-
-  ok = myDlg->myX->isValid( msg, !myNoPreview ) && ok;
-  ok = myDlg->myY->isValid( msg, !myNoPreview ) && ok;
-  ok = myDlg->myZ->isValid( msg, !myNoPreview ) && ok;
-
   return ok;
 }
 
index 6df8ba72239fa2b034386f192c8ca0f41c6e47ff..b32d550e8aa1bc1ea6f8cf4935aaccaea544ae98 100644 (file)
@@ -27,6 +27,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 #include "SMESHGUI_Dialog.h"
 #include "SMESHGUI_SelectionOp.h"
@@ -43,7 +44,7 @@ class SMESHGUI_MakeNodeAtPointDlg;
 /*!
  * \brief Operation to make a mesh pass through a point
  */
-class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointOp: public SMESHGUI_SelectionOp
+class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointOp: public SMESHGUI_SelectionOp, public SMESHGUI_Helper
 {
   Q_OBJECT
 
index d80523066d8100e775a643ed78675e88baefd75c..b7c9bcca4ff923b31abe112cdc945e15e4bfd4ce 100755 (executable)
 //=======================================================================
 SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myBusy( false ),
@@ -413,20 +414,12 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
 {
   if (isRefine())
   {
-    QString msg;
-    bool ok = true;
-    ok = myNode1->isValid( msg, theMess ) && ok;
-    if (myType == Type_3d)
-      ok = myNode2->isValid( msg, theMess ) && ok;
-    if( !ok ) {
-      if( theMess ) {
-        QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-        if ( !msg.isEmpty() )
-          str += "\n" + msg;
-        SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-      }
+    QList<QAbstractSpinBox*> aSpinBoxList;
+    aSpinBoxList << myNode1;
+    if( myType == Type_3d )
+      aSpinBoxList << myNode2;
+    if( !checkParameters( theMess, aSpinBoxList ) )
       return false;
-    }
   }
 
   QList<int> ids;
index e3e2d6870b910b1b30b68e3d8391d93d3f2b83a2..4ca20af4215035169e939a33001370eeab9ddf95 100755 (executable)
@@ -27,6 +27,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -58,7 +59,7 @@ class SMESHGUI_PatternWidget;
   Description : Dialog to specify filters for VTK viewer
 */
 
-class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog, public SMESHGUI_Helper
 {
   Q_OBJECT
 
index 6243255afc44a7b7a51c87d35e5b30785cae6869..abeffde07030e7a58c2fe421215fd66b9e942343 100644 (file)
@@ -86,6 +86,7 @@
 //=================================================================================
 SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg(SMESHGUI* theModule):
   QDialog(SMESH::GetDesktop(theModule)),
+  SMESHGUI_Helper(theModule),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
   mySMESHGUI(theModule)
 {
@@ -281,23 +282,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
                                    tr("NODE_ID_IS_NOT_DEFINED"));
     return false;
   }
-
-  QString msg;
-  bool ok = true;
-  ok = myX->isValid( msg, theMess ) && ok;
-  ok = myY->isValid( msg, theMess ) && ok;
-  ok = myZ->isValid( msg, theMess ) && ok;
-  if( !ok ) {
-    if( theMess ) {
-      QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-      if ( !msg.isEmpty() )
-        str += "\n" + msg;
-      SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    }
-    return false;
-  }
-
-  return true;
+  return checkParameters( theMess, 3, myX, myY, myZ );
 }
 
 //=======================================================================
index cfd43786fe5cf30f62b6bc9c2cec3e5b2c2f10a4..f3cf3777e61c451e167e3f6fa8ce2bbb1e5a7abf 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -46,7 +47,7 @@ class LightApp_SelectionMgr;
 // class    : SMESHGUI_MoveNodesDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_MoveNodesDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_MoveNodesDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index 907f8a65b86b43439488e7d909061f8a03a20c72..4879a202627da46c023ac0d5af9819bab7a20756 100755 (executable)
@@ -103,6 +103,7 @@ SMESHGUI_MultiEditDlg
                         const int theMode,
                         const bool the3d2d):
   QDialog(SMESH::GetDesktop(theModule)),
+  SMESHGUI_Helper(theModule),
   mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
   mySMESHGUI(theModule)
@@ -1173,20 +1174,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
   bool ok = SMESHGUI_MultiEditDlg::isValid( theMess );
   if( !ok )
     return false;
-
-  QString msg;
-  ok = myMaxAngleSpin->isValid( msg, theMess );
-  if( !ok ) {
-    if( theMess ) {
-      QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-      if ( !msg.isEmpty() )
-        str += "\n" + msg;
-      SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    }
-    return false;
-  }
-
-  return ok;
+  return checkParameters( theMess, 1, myMaxAngleSpin );
 }
 
 bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
index f1499681442c854118c3833abfdd9caabe86c506..1f98f85cdff9c3cb922ac93c5d467b632ca50ab3 100755 (executable)
@@ -27,6 +27,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes 
 #include <QDialog>
@@ -63,7 +64,7 @@ class QButtonGroup;
  *               union of two neighboring triangles
  */
 
-class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public QDialog, public SMESHGUI_Helper
 {
   Q_OBJECT
 
index 76b75dbb9139c5a924b33baa70166ffe2724a853..04f5d717c173be1573712dd9f34eeab17dfc3bf8 100644 (file)
@@ -223,6 +223,7 @@ namespace SMESH
 //=================================================================================
 SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): 
   QDialog( SMESH::GetDesktop( theModule ) ),
+  SMESHGUI_Helper( theModule ),
   mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
   mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
   mySMESHGUI( theModule )
@@ -610,18 +611,5 @@ void SMESHGUI_NodesDlg::keyPressEvent( QKeyEvent* e )
 //=================================================================================
 bool SMESHGUI_NodesDlg::isValid()
 {
-  QString msg;
-  bool ok = true;
-  ok = SpinBox_X->isValid( msg, true ) && ok;
-  ok = SpinBox_Y->isValid( msg, true ) && ok;
-  ok = SpinBox_Z->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  return checkParameters( true, 3, SpinBox_X, SpinBox_Y, SpinBox_Z );
 }
index 8fc28eacca9349099a15787cd6a460b3d6d09174..1cc52b75865d9415676e61337a70eb0777f1c267 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -55,7 +56,7 @@ namespace SMESH
 // class    : SMESHGUI_NodesDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_NodesDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_NodesDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index 484989dfd1e4e8c321906ebe5d04139281b39340..811ed074880b4f22afd5ae73de99da0baa73cd40 100644 (file)
@@ -89,6 +89,7 @@
 //=================================================================================
 SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myVectorDefinition(NONE_SELECT),
@@ -1181,24 +1182,8 @@ void SMESHGUI_RevolutionDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_RevolutionDlg::isValid()
 {
-  QString msg;
-  bool ok = true;
-  ok = SpinBox_X->isValid( msg, true ) && ok;
-  ok = SpinBox_Y->isValid( msg, true ) && ok;
-  ok = SpinBox_Z->isValid( msg, true ) && ok;
-  ok = SpinBox_DX->isValid( msg, true ) && ok;
-  ok = SpinBox_DY->isValid( msg, true ) && ok;
-  ok = SpinBox_DZ->isValid( msg, true ) && ok;
-  ok = SpinBox_Angle->isValid( msg, true ) && ok;
-  ok = SpinBox_NbSteps->isValid( msg, true ) && ok;
-  ok = SpinBox_Tolerance->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  return checkParameters( true, 9,
+                          SpinBox_X, SpinBox_Y, SpinBox_Z,
+                          SpinBox_DX, SpinBox_DY, SpinBox_DZ,
+                          SpinBox_Angle, SpinBox_NbSteps, SpinBox_Tolerance );
 }
index 4d0c5169304e9b3b2bda2df6e85f9c063a219310..918f4c31ab4b1266f098cb345cf9aef63451f3b2 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // SALOME GUI includes
 #include <SALOME_InteractiveObject.hxx>
@@ -65,7 +66,7 @@ class QAction;
 // class    : SMESHGUI_RevolutionDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index d9352dbc87e1403b4c868bcf5b827023aa70526d..731a84208bdae68b9f181de5d67121415380f205 100644 (file)
@@ -89,6 +89,7 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action
 //=================================================================================
 SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg(0),
@@ -997,23 +998,8 @@ void SMESHGUI_RotationDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_RotationDlg::isValid()
 {
-  bool ok = true;
-  QString msg;
-
-  ok = SpinBox_X->isValid( msg, true ) && ok;
-  ok = SpinBox_Y->isValid( msg, true ) && ok;
-  ok = SpinBox_Z->isValid( msg, true ) && ok;
-  ok = SpinBox_DX->isValid( msg, true ) && ok;
-  ok = SpinBox_DY->isValid( msg, true ) && ok;
-  ok = SpinBox_DZ->isValid( msg, true ) && ok;
-  ok = SpinBox_Angle->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  return checkParameters( true, 7,
+                          SpinBox_X, SpinBox_Y, SpinBox_Z,
+                          SpinBox_DX, SpinBox_DY, SpinBox_DZ,
+                          SpinBox_Angle );
 }
index bb743746f08a07ef485a5b9d5c9db1976bff2afa..19153b2543874475b05f4bafea242e1cc058c8e4 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -56,7 +57,7 @@ class SMESH_LogicalFilter;
 // class    : SMESHGUI_RotationDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_RotationDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_RotationDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index 1cab8d3f47eadf428db66ab14cf8efdbdde1370f..b5f14b00caa0e74084fab6b9cc0fcd97a1ad4129 100644 (file)
@@ -90,6 +90,7 @@
 //=================================================================================
 SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg(0),
@@ -826,17 +827,5 @@ void SMESHGUI_SmoothingDlg::setNodeFilters()
 //=================================================================================
 bool SMESHGUI_SmoothingDlg::isValid()
 {
-  QString msg;
-  bool ok = true;
-  ok = SpinBox_IterationLimit->isValid( msg, true ) && ok;
-  ok = SpinBox_AspectRatio->isValid( msg, true ) && ok;
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  return checkParameters( true, 2, SpinBox_IterationLimit, SpinBox_AspectRatio );
 }
index 6def01cae4af13137686135c2318087d51355085..08bfd784296316358f002704ed1f8df17b9e61a4 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -57,7 +58,7 @@ class SMESH_LogicalFilter;
 // class    : SMESHGUI_SmoothingDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index 5da44a6ae52bda7c6aa7df29ebe04302d4e5f454..6d73d7d028febb69c1788cacd3d124592ae457c0 100644 (file)
@@ -90,6 +90,7 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action
 
 SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg(0),
@@ -1096,24 +1097,9 @@ void SMESHGUI_SymmetryDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_SymmetryDlg::isValid()
 {
-  bool ok = true;
-  QString msg;
-
-  ok = SpinBox_X->isValid( msg, true ) && ok;
-  ok = SpinBox_Y->isValid( msg, true ) && ok;
-  ok = SpinBox_Z->isValid( msg, true ) && ok;
-  if (GetConstructorId() != 0) {
-    ok = SpinBox_DX->isValid( msg, true ) && ok;
-    ok = SpinBox_DY->isValid( msg, true ) && ok;
-    ok = SpinBox_DZ->isValid( msg, true ) && ok;
-  }
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  QList<QAbstractSpinBox*> aSpinBoxList;
+  aSpinBoxList << SpinBox_X << SpinBox_Y << SpinBox_Z;
+  if( GetConstructorId() != 0 )
+    aSpinBoxList << SpinBox_DX << SpinBox_DY << SpinBox_DZ;
+  return checkParameters( true, aSpinBoxList );
 }
index 1d763eb2e9fd0428df3086d0872f7615addab0ae..0e6ea24f1cb798437970edce9e06f69db8d08a0e 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -56,7 +57,7 @@ class SMESH_LogicalFilter;
 // class    : SMESHGUI_SymmetryDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_SymmetryDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_SymmetryDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index 97d5ca5822b6108b98d2499b17880c2269a636cb..993fab16fec28fff5408421e95ea2814527df471 100644 (file)
@@ -107,6 +107,7 @@ private:
 //=================================================================================
 SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule )
   : QDialog( SMESH::GetDesktop( theModule ) ),
+    SMESHGUI_Helper( theModule ),
     mySMESHGUI( theModule ),
     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
     myFilterDlg(0),
@@ -1044,24 +1045,9 @@ void SMESHGUI_TranslationDlg::setFilters()
 //=================================================================================
 bool SMESHGUI_TranslationDlg::isValid()
 {
-  bool ok = true;
-  QString msg;
-
-  ok = SpinBox1_1->isValid( msg, true ) && ok;
-  ok = SpinBox1_2->isValid( msg, true ) && ok;
-  ok = SpinBox1_3->isValid( msg, true ) && ok;
-  if (GetConstructorId() == 0) {
-    ok = SpinBox2_1->isValid( msg, true ) && ok;
-    ok = SpinBox2_2->isValid( msg, true ) && ok;
-    ok = SpinBox2_3->isValid( msg, true ) && ok;
-  }
-
-  if( !ok ) {
-    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
-    if ( !msg.isEmpty() )
-      str += "\n" + msg;
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
-    return false;
-  }
-  return true;
+  QList<QAbstractSpinBox*> aSpinBoxList;
+  aSpinBoxList << SpinBox1_1 << SpinBox1_2 << SpinBox1_3;
+  if( GetConstructorId() == 0 )
+    aSpinBoxList << SpinBox2_1 << SpinBox2_2 << SpinBox2_3;
+  return checkParameters( true, aSpinBoxList );
 }
index cfd77378ad51e54886f4e1e98d4898dd1237f213..81dc6cfa3e4240f3683e0450f9e422f2bdceaed3 100644 (file)
@@ -28,6 +28,7 @@
 
 // SMESH includes
 #include "SMESH_SMESHGUI.hxx"
+#include "SMESHGUI_Helper.h"
 
 // Qt includes
 #include <QDialog>
@@ -56,7 +57,7 @@ class SMESH_LogicalFilter;
 // class    : SMESHGUI_TranslationDlg
 // purpose  :
 //=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_TranslationDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_TranslationDlg : public QDialog, public SMESHGUI_Helper
 { 
   Q_OBJECT
 
index 2b216fe268d77330f4480a45880151cf4f2ecf69..7fed0cced7f8c0f2f019f9371ded93bf34a4ffe6 100644 (file)
@@ -940,6 +940,7 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
 //=======================================================================
 char* SMESH_Gen_i::ParseParameters(const char* theParameters)
 {
+  /* ouv: temporarily disabled
   //const char* aParameters = theParameters;
 //   const char* aParameters = CORBA::string_dup(theParameters);
   TCollection_AsciiString anInputParams;
@@ -982,6 +983,8 @@ char* SMESH_Gen_i::ParseParameters(const char* theParameters)
     }
   }
   return CORBA::string_dup(anInputParams.ToCString());
+  */
+  return NULL;
 }
 
 //=======================================================================
index b677e647b13c6dca7222d71f0206c2be16008342..cacae2503e0b2bb8f947f8f38241fe3fb4eca2ff 100644 (file)
@@ -188,6 +188,7 @@ char* SMESH_Hypothesis_i::GetParameters()
 SMESH::ListOfParameters* SMESH_Hypothesis_i::GetLastParameters()
 {
   SMESH::ListOfParameters_var aResult = new SMESH::ListOfParameters();
+  /* ouv: temporarily disabled
   SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
   if(gen) {
     char *aParameters;
@@ -207,6 +208,7 @@ SMESH::ListOfParameters* SMESH_Hypothesis_i::GetLastParameters()
       }
     }
   }
+  */
   return aResult._retn();
 }
 
index bc0369dcc668da6a92fd4cf60936f6675e289dd8..4236db2696a4f47e2b8e5740fe741f9981af65e8 100644 (file)
@@ -3408,6 +3408,7 @@ char* SMESH_Mesh_i::GetParameters()
 SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
 {
   SMESH::string_array_var aResult = new SMESH::string_array();
+  /* ouv: temporarily disabled
   SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
   if(gen) {
     char *aParameters = GetParameters();
@@ -3422,6 +3423,7 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
       }
     }
   }
+  */
   return aResult._retn();
 }
 
index 2345a4279fb460853ceb569feb942d8c834bb4fb..09083c3b956a201cd057e3bdd1faca74a2c553fb 100644 (file)
@@ -639,6 +639,7 @@ void SMESH_NoteBook::ReplaceVariables()
 //================================================================================
 void SMESH_NoteBook::InitObjectMap()
 {
+  /* ouv: temporarily disabled
   SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
   if(!aGen)
     return;
@@ -700,6 +701,7 @@ void SMESH_NoteBook::InitObjectMap()
       _objectMap.insert(pair<TCollection_AsciiString,ObjectStates*>(TCollection_AsciiString(aSObject->GetID()),aState));
     }
   }
+  */
 }
 
 //================================================================================
@@ -825,6 +827,7 @@ bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double&
 {
   bool ok = false;
 
+  /* ouv: temporarily disabled
   SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
   if(!aGen)
     return ok;
@@ -844,7 +847,7 @@ bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double&
     theValue = aStudy->GetReal(aVarName.ToCString());
     ok = true;
   }
-
+  */
   return ok;
 }
 
index 2ee5473af34992aee5ac4cc34109832b0a7490d9..4283d4760f7cc6941092174c8cd251c38a4ef688 100644 (file)
@@ -80,17 +80,17 @@ StdMeshersGUI_NbSegmentsCreator::~StdMeshersGUI_NbSegmentsCreator()
 {
 }
 
-bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg ) const
+bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg, QStringList& absentParams ) const
 {
-  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
+  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg, absentParams ) )
     return false;
   NbSegmentsHypothesisData data_old, data_new;
   readParamsFromHypo( data_old );
   readParamsFromWidgets( data_new );
   bool res = storeParamsToHypo( data_new );
   storeParamsToHypo( data_old );
-  res = myNbSeg->isValid( msg, true ) && res;
-  res = myScale->isValid( msg, true ) && res;
+  res = myNbSeg->isValid( msg, absentParams, true ) && res;
+  res = myScale->isValid( msg, absentParams, true ) && res;
   return res;
 }
 
index 6053e8d3432c19994cf7990bb9881b4f355e6d0d..34682a25f9f8de0622bc74beeb9b4f81d4bf0c69 100644 (file)
@@ -64,7 +64,7 @@ public:
   StdMeshersGUI_NbSegmentsCreator();
   virtual ~StdMeshersGUI_NbSegmentsCreator();
 
-  virtual bool checkParams( QString& ) const;
+  virtual bool checkParams( QString&, QStringList& ) const;
 
 protected:
   virtual QFrame*  buildFrame();
index 0d72900dcb875cbf6ecfc46cd1fd23039d8a8d01..b5b2d12086c21786e341ac6f07b3698ab25d0798 100644 (file)
@@ -343,9 +343,9 @@ namespace {
  */
 //================================================================================
 
-bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
+bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg, QStringList& absentParams ) const
 {
-  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
+  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg, absentParams ) )
     return false;
 
   // check if object reference parameter is set, as it has no default value
index 0973c5c03325e349cf6036f3f56acb353ca21d9b..011ff8945b5a4caebe3c6b210e71b97f4de2ad59 100644 (file)
@@ -41,7 +41,7 @@ public:
   StdMeshersGUI_StdHypothesisCreator( const QString& );
   virtual ~StdMeshersGUI_StdHypothesisCreator();
 
-  virtual bool checkParams( QString& ) const;
+  virtual bool checkParams( QString&, QStringList& ) const;
 
 protected:
   virtual QFrame*  buildFrame    ();