First compilable version

This commit is contained in:
ouv 2009-12-09 10:02:02 +00:00
parent 6d66c9caa8
commit 44a2277a1a
39 changed files with 320 additions and 240 deletions

View File

@ -41,6 +41,7 @@ salomeinclude_HEADERS = \
SMESHGUI_PatternUtils.h \ SMESHGUI_PatternUtils.h \
SMESHGUI_GroupUtils.h \ SMESHGUI_GroupUtils.h \
SMESHGUI_PatternWidget.h \ SMESHGUI_PatternWidget.h \
SMESHGUI_Helper.h \
SMESHGUI_CreatePatternDlg.h \ SMESHGUI_CreatePatternDlg.h \
SMESHGUI_MeshPatternDlg.h \ SMESHGUI_MeshPatternDlg.h \
SMESHGUI_NodesDlg.h \ SMESHGUI_NodesDlg.h \
@ -99,6 +100,7 @@ lib_LTLIBRARIES = libSMESH.la
dist_libSMESH_la_SOURCES = \ dist_libSMESH_la_SOURCES = \
SMESHGUI.cxx \ SMESHGUI.cxx \
SMESHGUI_PatternWidget.cxx \ SMESHGUI_PatternWidget.cxx \
SMESHGUI_Helper.cxx \
SMESHGUI_CreatePatternDlg.cxx \ SMESHGUI_CreatePatternDlg.cxx \
SMESHGUI_MeshPatternDlg.cxx \ SMESHGUI_MeshPatternDlg.cxx \
SMESHGUI_SpinBox.cxx \ SMESHGUI_SpinBox.cxx \

View File

@ -72,6 +72,7 @@
//================================================================================= //=================================================================================
SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule ) SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
: QDialog(SMESH::GetDesktop(theModule)), : QDialog(SMESH::GetDesktop(theModule)),
SMESHGUI_Helper(theModule),
mySMESHGUI(theModule), mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)) mySelectionMgr(SMESH::GetSelectionMgr(theModule))
{ {
@ -513,17 +514,7 @@ void SMESHGUI_BuildCompoundDlg::onSelectMerge(bool toMerge)
//================================================================================= //=================================================================================
bool SMESHGUI_BuildCompoundDlg::isValid() bool SMESHGUI_BuildCompoundDlg::isValid()
{ {
QString msg; if( CheckBoxMerge->isChecked() )
bool ok=true; return checkParameters( true, 1, SpinBoxTol );
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;
}
return true; return true;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -53,7 +54,7 @@ class SUIT_SelectionFilter;
// class : SMESHGUI_BuildCompoundDlg // class : SMESHGUI_BuildCompoundDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT; Q_OBJECT;

View File

@ -109,6 +109,7 @@ private:
//================================================================================= //=================================================================================
SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule ) SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myFilterDlg( 0 ) myFilterDlg( 0 )
@ -1132,14 +1133,9 @@ int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
//======================================================================= //=======================================================================
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded() void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
{ {
QString msg; if( !checkParameters( true, 1, AngleSpin ) )
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 );
return; return;
}
AnglesList->addItem(AngleSpin->text()); AnglesList->addItem(AngleSpin->text());
myAnglesList.append(AngleSpin->GetValue()); myAnglesList.append(AngleSpin->GetValue());
@ -1242,20 +1238,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_ExtrusionAlongPathDlg::isValid() bool SMESHGUI_ExtrusionAlongPathDlg::isValid()
{ {
QString msg; return checkParameters( true, 3, XSpin, YSpin, ZSpin );
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;
} }
//================================================================================= //=================================================================================

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -59,7 +60,7 @@ class SUIT_SelectionFilter;
// class : SMESHGUI_ExtrusionAlongPathDlg // class : SMESHGUI_ExtrusionAlongPathDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -88,6 +88,7 @@
//================================================================================= //=================================================================================
SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule) SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myFilterDlg( 0 ), myFilterDlg( 0 ),
@ -1009,26 +1010,11 @@ void SMESHGUI_ExtrusionDlg::setFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_ExtrusionDlg::isValid() bool SMESHGUI_ExtrusionDlg::isValid()
{ {
QString msg; QList<QAbstractSpinBox*> aSpinBoxList;
bool ok = true; if ( RadioButton3->isChecked() )
if ( RadioButton3->isChecked() ) { aSpinBoxList << SpinBox_Dx << SpinBox_Dy << SpinBox_Dz;
ok = SpinBox_Dx->isValid( msg, true ) && ok; else if ( RadioButton4->isChecked() )
ok = SpinBox_Dy->isValid( msg, true ) && ok; aSpinBoxList << SpinBox_Vx << SpinBox_Vy << SpinBox_Vz;
ok = SpinBox_Dz->isValid( msg, true ) && ok; aSpinBoxList << SpinBox_NbSteps;
} else if ( RadioButton4->isChecked() ) { return checkParameters( true, aSpinBoxList );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// SALOME GUI includes // SALOME GUI includes
#include <SALOME_InteractiveObject.hxx> #include <SALOME_InteractiveObject.hxx>
@ -61,7 +62,7 @@ class SalomeApp_IntSpinBox;
// class : SMESHGUI_ExtrusionDlg // class : SMESHGUI_ExtrusionDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -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;
}

View File

@ -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

View File

@ -40,6 +40,7 @@
#include <SUIT_MessageBox.h> #include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h> #include <SUIT_ResourceMgr.h>
#include <LightApp_Application.h> #include <LightApp_Application.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_IntSpinBox.h> #include <SalomeApp_IntSpinBox.h>
// Qt includes // Qt includes
@ -192,6 +193,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
break; break;
case QVariant::String: case QVariant::String:
{ {
/* ouv: temporarily disabled
if((*anIt).isVariable) { if((*anIt).isVariable) {
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
QString aVar = (*anIt).myValue.toString(); QString aVar = (*anIt).myValue.toString();
@ -213,13 +215,14 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
} }
} }
else { else {
*/
QLineEdit* le = new QLineEdit( GroupC1 ); QLineEdit* le = new QLineEdit( GroupC1 );
le->setObjectName( (*anIt).myName ); le->setObjectName( (*anIt).myName );
attuneStdWidget( le, i ); attuneStdWidget( le, i );
le->setText( (*anIt).myValue.toString() ); le->setText( (*anIt).myValue.toString() );
connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) ); connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
w = le; w = le;
} //}
} }
break; break;
} }
@ -476,7 +479,7 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWi
return false; return false;
} }
bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg, QStringList& absentParams ) const
{ {
bool ok = true; bool ok = true;
ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end(); 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" ) ) if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
{ {
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt ); 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" ) ) else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
{ {
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt ); SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
ok = sb->isValid( msg, true ) && ok; ok = sb->isValid( msg, absentParams, true ) && ok;
} }
} }
return ok; return ok;
@ -599,8 +602,17 @@ void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
void SMESHGUI_HypothesisDlg::accept() void SMESHGUI_HypothesisDlg::accept()
{ {
QString msg; 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" ) ); QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() ) if ( !msg.isEmpty() )
str += "\n" + msg; str += "\n" + msg;

View File

@ -57,7 +57,7 @@ public:
void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& ); void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr); void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
virtual bool checkParams( QString& ) const; virtual bool checkParams( QString&, QStringList& ) const;
virtual void onReject(); virtual void onReject();
virtual QString helpPage() const; virtual QString helpPage() const;

View File

@ -267,6 +267,7 @@ void SMESHGUI_MakeNodeAtPointDlg::ButtonToggled (bool on)
//================================================================================ //================================================================================
SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp() SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
: SMESHGUI_Helper( getSMESHGUI() )
{ {
mySimulation = 0; mySimulation = 0;
myDlg = new SMESHGUI_MakeNodeAtPointDlg; myDlg = new SMESHGUI_MakeNodeAtPointDlg;
@ -375,8 +376,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
QString msg; QString msg;
if ( !isValid( msg ) ) { // node id is invalid if ( !isValid( msg ) ) { // node id is invalid
if( !msg.isEmpty() ) if( !msg.isEmpty() )
SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ), SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ), msg );
tr("INVALID_ID") );
dlg()->show(); dlg()->show();
return false; return false;
} }
@ -442,6 +442,9 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg ) bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
{ {
if( !checkParameters( !myNoPreview, 3, myDlg->myX, myDlg->myY, myDlg->myZ ) )
return false;
bool ok = true; bool ok = true;
if ( myMeshActor && if ( myMeshActor &&
myDlg->myMoveRBtn->isChecked() && myDlg->myMoveRBtn->isChecked() &&
@ -455,11 +458,6 @@ bool SMESHGUI_MakeNodeAtPointOp::isValid( QString& msg )
if( !ok ) if( !ok )
msg += tr("INVALID_ID") + "\n"; 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; return ok;
} }

View File

@ -27,6 +27,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
#include "SMESHGUI_Dialog.h" #include "SMESHGUI_Dialog.h"
#include "SMESHGUI_SelectionOp.h" #include "SMESHGUI_SelectionOp.h"
@ -43,7 +44,7 @@ class SMESHGUI_MakeNodeAtPointDlg;
/*! /*!
* \brief Operation to make a mesh pass through a point * \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 Q_OBJECT

View File

@ -106,6 +106,7 @@
//======================================================================= //=======================================================================
SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule ) SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myBusy( false ), myBusy( false ),
@ -413,20 +414,12 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
{ {
if (isRefine()) if (isRefine())
{ {
QString msg; QList<QAbstractSpinBox*> aSpinBoxList;
bool ok = true; aSpinBoxList << myNode1;
ok = myNode1->isValid( msg, theMess ) && ok; if( myType == Type_3d )
if (myType == Type_3d) aSpinBoxList << myNode2;
ok = myNode2->isValid( msg, theMess ) && ok; if( !checkParameters( theMess, aSpinBoxList ) )
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 false;
}
} }
QList<int> ids; QList<int> ids;

View File

@ -27,6 +27,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -58,7 +59,7 @@ class SMESHGUI_PatternWidget;
Description : Dialog to specify filters for VTK viewer 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 Q_OBJECT

View File

@ -86,6 +86,7 @@
//================================================================================= //=================================================================================
SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg(SMESHGUI* theModule): SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg(SMESHGUI* theModule):
QDialog(SMESH::GetDesktop(theModule)), QDialog(SMESH::GetDesktop(theModule)),
SMESHGUI_Helper(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
{ {
@ -281,23 +282,7 @@ bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
tr("NODE_ID_IS_NOT_DEFINED")); tr("NODE_ID_IS_NOT_DEFINED"));
return false; return false;
} }
return checkParameters( theMess, 3, myX, myY, myZ );
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;
} }
//======================================================================= //=======================================================================

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -46,7 +47,7 @@ class LightApp_SelectionMgr;
// class : SMESHGUI_MoveNodesDlg // class : SMESHGUI_MoveNodesDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_MoveNodesDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_MoveNodesDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -103,6 +103,7 @@ SMESHGUI_MultiEditDlg
const int theMode, const int theMode,
const bool the3d2d): const bool the3d2d):
QDialog(SMESH::GetDesktop(theModule)), QDialog(SMESH::GetDesktop(theModule)),
SMESHGUI_Helper(theModule),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)), mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule) mySMESHGUI(theModule)
@ -1173,20 +1174,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess)
bool ok = SMESHGUI_MultiEditDlg::isValid( theMess ); bool ok = SMESHGUI_MultiEditDlg::isValid( theMess );
if( !ok ) if( !ok )
return false; return false;
return checkParameters( theMess, 1, myMaxAngleSpin );
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;
} }
bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,

View File

@ -27,6 +27,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -63,7 +64,7 @@ class QButtonGroup;
* union of two neighboring triangles * union of two neighboring triangles
*/ */
class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -223,6 +223,7 @@ namespace SMESH
//================================================================================= //=================================================================================
SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ):
QDialog( SMESH::GetDesktop( theModule ) ), QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ), mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
mySMESHGUI( theModule ) mySMESHGUI( theModule )
@ -610,18 +611,5 @@ void SMESHGUI_NodesDlg::keyPressEvent( QKeyEvent* e )
//================================================================================= //=================================================================================
bool SMESHGUI_NodesDlg::isValid() bool SMESHGUI_NodesDlg::isValid()
{ {
QString msg; return checkParameters( true, 3, SpinBox_X, SpinBox_Y, SpinBox_Z );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -55,7 +56,7 @@ namespace SMESH
// class : SMESHGUI_NodesDlg // class : SMESHGUI_NodesDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_NodesDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_NodesDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -89,6 +89,7 @@
//================================================================================= //=================================================================================
SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myVectorDefinition(NONE_SELECT), myVectorDefinition(NONE_SELECT),
@ -1181,24 +1182,8 @@ void SMESHGUI_RevolutionDlg::setFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_RevolutionDlg::isValid() bool SMESHGUI_RevolutionDlg::isValid()
{ {
QString msg; return checkParameters( true, 9,
bool ok = true; SpinBox_X, SpinBox_Y, SpinBox_Z,
ok = SpinBox_X->isValid( msg, true ) && ok; SpinBox_DX, SpinBox_DY, SpinBox_DZ,
ok = SpinBox_Y->isValid( msg, true ) && ok; SpinBox_Angle, SpinBox_NbSteps, SpinBox_Tolerance );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// SALOME GUI includes // SALOME GUI includes
#include <SALOME_InteractiveObject.hxx> #include <SALOME_InteractiveObject.hxx>
@ -65,7 +66,7 @@ class QAction;
// class : SMESHGUI_RevolutionDlg // class : SMESHGUI_RevolutionDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -89,6 +89,7 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action
//================================================================================= //=================================================================================
SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myFilterDlg(0), myFilterDlg(0),
@ -997,23 +998,8 @@ void SMESHGUI_RotationDlg::setFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_RotationDlg::isValid() bool SMESHGUI_RotationDlg::isValid()
{ {
bool ok = true; return checkParameters( true, 7,
QString msg; SpinBox_X, SpinBox_Y, SpinBox_Z,
SpinBox_DX, SpinBox_DY, SpinBox_DZ,
ok = SpinBox_X->isValid( msg, true ) && ok; SpinBox_Angle );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -56,7 +57,7 @@ class SMESH_LogicalFilter;
// class : SMESHGUI_RotationDlg // class : SMESHGUI_RotationDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RotationDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_RotationDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -90,6 +90,7 @@
//================================================================================= //=================================================================================
SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myFilterDlg(0), myFilterDlg(0),
@ -826,17 +827,5 @@ void SMESHGUI_SmoothingDlg::setNodeFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_SmoothingDlg::isValid() bool SMESHGUI_SmoothingDlg::isValid()
{ {
QString msg; return checkParameters( true, 2, SpinBox_IterationLimit, SpinBox_AspectRatio );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -57,7 +58,7 @@ class SMESH_LogicalFilter;
// class : SMESHGUI_SmoothingDlg // class : SMESHGUI_SmoothingDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -90,6 +90,7 @@ enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action
SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myFilterDlg(0), myFilterDlg(0),
@ -1096,24 +1097,9 @@ void SMESHGUI_SymmetryDlg::setFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_SymmetryDlg::isValid() bool SMESHGUI_SymmetryDlg::isValid()
{ {
bool ok = true; QList<QAbstractSpinBox*> aSpinBoxList;
QString msg; aSpinBoxList << SpinBox_X << SpinBox_Y << SpinBox_Z;
if( GetConstructorId() != 0 )
ok = SpinBox_X->isValid( msg, true ) && ok; aSpinBoxList << SpinBox_DX << SpinBox_DY << SpinBox_DZ;
ok = SpinBox_Y->isValid( msg, true ) && ok; return checkParameters( true, aSpinBoxList );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -56,7 +57,7 @@ class SMESH_LogicalFilter;
// class : SMESHGUI_SymmetryDlg // class : SMESHGUI_SymmetryDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_SymmetryDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_SymmetryDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View File

@ -107,6 +107,7 @@ private:
//================================================================================= //=================================================================================
SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule )
: QDialog( SMESH::GetDesktop( theModule ) ), : QDialog( SMESH::GetDesktop( theModule ) ),
SMESHGUI_Helper( theModule ),
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myFilterDlg(0), myFilterDlg(0),
@ -1044,24 +1045,9 @@ void SMESHGUI_TranslationDlg::setFilters()
//================================================================================= //=================================================================================
bool SMESHGUI_TranslationDlg::isValid() bool SMESHGUI_TranslationDlg::isValid()
{ {
bool ok = true; QList<QAbstractSpinBox*> aSpinBoxList;
QString msg; aSpinBoxList << SpinBox1_1 << SpinBox1_2 << SpinBox1_3;
if( GetConstructorId() == 0 )
ok = SpinBox1_1->isValid( msg, true ) && ok; aSpinBoxList << SpinBox2_1 << SpinBox2_2 << SpinBox2_3;
ok = SpinBox1_2->isValid( msg, true ) && ok; return checkParameters( true, aSpinBoxList );
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;
} }

View File

@ -28,6 +28,7 @@
// SMESH includes // SMESH includes
#include "SMESH_SMESHGUI.hxx" #include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Helper.h"
// Qt includes // Qt includes
#include <QDialog> #include <QDialog>
@ -56,7 +57,7 @@ class SMESH_LogicalFilter;
// class : SMESHGUI_TranslationDlg // class : SMESHGUI_TranslationDlg
// purpose : // purpose :
//================================================================================= //=================================================================================
class SMESHGUI_EXPORT SMESHGUI_TranslationDlg : public QDialog class SMESHGUI_EXPORT SMESHGUI_TranslationDlg : public QDialog, public SMESHGUI_Helper
{ {
Q_OBJECT Q_OBJECT

View 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) char* SMESH_Gen_i::ParseParameters(const char* theParameters)
{ {
/* ouv: temporarily disabled
//const char* aParameters = theParameters; //const char* aParameters = theParameters;
// const char* aParameters = CORBA::string_dup(theParameters); // const char* aParameters = CORBA::string_dup(theParameters);
TCollection_AsciiString anInputParams; TCollection_AsciiString anInputParams;
@ -982,6 +983,8 @@ char* SMESH_Gen_i::ParseParameters(const char* theParameters)
} }
} }
return CORBA::string_dup(anInputParams.ToCString()); return CORBA::string_dup(anInputParams.ToCString());
*/
return NULL;
} }
//======================================================================= //=======================================================================

View File

@ -188,6 +188,7 @@ char* SMESH_Hypothesis_i::GetParameters()
SMESH::ListOfParameters* SMESH_Hypothesis_i::GetLastParameters() SMESH::ListOfParameters* SMESH_Hypothesis_i::GetLastParameters()
{ {
SMESH::ListOfParameters_var aResult = new SMESH::ListOfParameters(); SMESH::ListOfParameters_var aResult = new SMESH::ListOfParameters();
/* ouv: temporarily disabled
SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen(); SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
if(gen) { if(gen) {
char *aParameters; char *aParameters;
@ -207,6 +208,7 @@ SMESH::ListOfParameters* SMESH_Hypothesis_i::GetLastParameters()
} }
} }
} }
*/
return aResult._retn(); return aResult._retn();
} }

View File

@ -3408,6 +3408,7 @@ char* SMESH_Mesh_i::GetParameters()
SMESH::string_array* SMESH_Mesh_i::GetLastParameters() SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
{ {
SMESH::string_array_var aResult = new SMESH::string_array(); SMESH::string_array_var aResult = new SMESH::string_array();
/* ouv: temporarily disabled
SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen(); SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen();
if(gen) { if(gen) {
char *aParameters = GetParameters(); char *aParameters = GetParameters();
@ -3422,6 +3423,7 @@ SMESH::string_array* SMESH_Mesh_i::GetLastParameters()
} }
} }
} }
*/
return aResult._retn(); return aResult._retn();
} }

View File

@ -639,6 +639,7 @@ void SMESH_NoteBook::ReplaceVariables()
//================================================================================ //================================================================================
void SMESH_NoteBook::InitObjectMap() void SMESH_NoteBook::InitObjectMap()
{ {
/* ouv: temporarily disabled
SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen(); SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
if(!aGen) if(!aGen)
return; return;
@ -700,6 +701,7 @@ void SMESH_NoteBook::InitObjectMap()
_objectMap.insert(pair<TCollection_AsciiString,ObjectStates*>(TCollection_AsciiString(aSObject->GetID()),aState)); _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; bool ok = false;
/* ouv: temporarily disabled
SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen(); SMESH_Gen_i *aGen = SMESH_Gen_i::GetSMESHGen();
if(!aGen) if(!aGen)
return ok; return ok;
@ -844,7 +847,7 @@ bool SMESH_NoteBook::GetReal(const TCollection_AsciiString& theVarName, double&
theValue = aStudy->GetReal(aVarName.ToCString()); theValue = aStudy->GetReal(aVarName.ToCString());
ok = true; ok = true;
} }
*/
return ok; return ok;
} }

View 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; return false;
NbSegmentsHypothesisData data_old, data_new; NbSegmentsHypothesisData data_old, data_new;
readParamsFromHypo( data_old ); readParamsFromHypo( data_old );
readParamsFromWidgets( data_new ); readParamsFromWidgets( data_new );
bool res = storeParamsToHypo( data_new ); bool res = storeParamsToHypo( data_new );
storeParamsToHypo( data_old ); storeParamsToHypo( data_old );
res = myNbSeg->isValid( msg, true ) && res; res = myNbSeg->isValid( msg, absentParams, true ) && res;
res = myScale->isValid( msg, true ) && res; res = myScale->isValid( msg, absentParams, true ) && res;
return res; return res;
} }

View File

@ -64,7 +64,7 @@ public:
StdMeshersGUI_NbSegmentsCreator(); StdMeshersGUI_NbSegmentsCreator();
virtual ~StdMeshersGUI_NbSegmentsCreator(); virtual ~StdMeshersGUI_NbSegmentsCreator();
virtual bool checkParams( QString& ) const; virtual bool checkParams( QString&, QStringList& ) const;
protected: protected:
virtual QFrame* buildFrame(); virtual QFrame* buildFrame();

View 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; return false;
// check if object reference parameter is set, as it has no default value // check if object reference parameter is set, as it has no default value

View File

@ -41,7 +41,7 @@ public:
StdMeshersGUI_StdHypothesisCreator( const QString& ); StdMeshersGUI_StdHypothesisCreator( const QString& );
virtual ~StdMeshersGUI_StdHypothesisCreator(); virtual ~StdMeshersGUI_StdHypothesisCreator();
virtual bool checkParams( QString& ) const; virtual bool checkParams( QString&, QStringList& ) const;
protected: protected:
virtual QFrame* buildFrame (); virtual QFrame* buildFrame ();