From: ouv Date: Wed, 2 Dec 2009 10:00:53 +0000 (+0000) Subject: Notebook: automatic variable definition. X-Git-Tag: PHASE_17_Part1_V1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bfb286e532d9dd48a853abf9c6d6ad17a04b40a1;p=modules%2Fgeom.git Notebook: automatic variable definition. --- diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 67ed1d620..27db94110 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -615,14 +615,14 @@ static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje // function : isValid // purpose : //================================================================================= -bool BasicGUI_CircleDlg::isValid( QString& msg ) +bool BasicGUI_CircleDlg::isValid( QString& msg, QStringList& absentParams ) { const int id = getConstructorId(); if ( id == 0 ) { //return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0; //nil point means origin of global CS //nil vector means Z axis - bool ok = GroupPntVecR->SpinBox_DX->isValid(msg, !IsPreview()); + bool ok = GroupPntVecR->SpinBox_DX->isValid(msg, absentParams, !IsPreview()); return getRadius() > 0 && ok; } else if ( id == 1 ) diff --git a/src/BasicGUI/BasicGUI_CircleDlg.h b/src/BasicGUI/BasicGUI_CircleDlg.h index b1574fd6d..0b6ebaa83 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.h +++ b/src/BasicGUI/BasicGUI_CircleDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 61340d3be..899d0effe 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -430,7 +430,7 @@ GEOM::GEOM_IOperations_ptr BasicGUI_EllipseDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BasicGUI_EllipseDlg::isValid( QString& msg ) +bool BasicGUI_EllipseDlg::isValid( QString& msg, QStringList& absentParams ) { double aMajorR = GroupPoints->SpinBox_DX->value(); double aMinorR = GroupPoints->SpinBox_DY->value(); @@ -442,8 +442,8 @@ bool BasicGUI_EllipseDlg::isValid( QString& msg ) //nil point means origin of global CS //nil vector means Z axis bool ok = true; - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; return ok; } diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.h b/src/BasicGUI/BasicGUI_EllipseDlg.h index c80bce197..0e15f56f5 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.h +++ b/src/BasicGUI/BasicGUI_EllipseDlg.h @@ -45,7 +45,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index e99553a59..8e84a43d9 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -683,7 +683,7 @@ GEOM::GEOM_IOperations_ptr BasicGUI_MarkerDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BasicGUI_MarkerDlg::isValid( QString& msg ) +bool BasicGUI_MarkerDlg::isValid( QString& msg, QStringList& absentParams ) { const int id = getConstructorId(); gp_Vec v1( myData[ DX1 ]->value(), myData[ DY1 ]->value(), myData[ DZ1 ]->value() ), @@ -702,7 +702,7 @@ bool BasicGUI_MarkerDlg::isValid( QString& msg ) case 0: { bool ok = true; for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) - ok = anIter.value()->isValid( msg, !IsPreview()) && ok; + ok = anIter.value()->isValid( msg, absentParams, !IsPreview()) && ok; return isOk && ok; } case 1: diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.h b/src/BasicGUI/BasicGUI_MarkerDlg.h index 364b0d737..6c153411f 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.h +++ b/src/BasicGUI/BasicGUI_MarkerDlg.h @@ -50,7 +50,7 @@ public: protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void displayPreview ( const bool = false, const bool = true, diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 924ad265f..7eb7489ef 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -750,7 +750,7 @@ static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje // function : isValid // purpose : //================================================================================= -bool BasicGUI_PlaneDlg::isValid( QString& msg ) +bool BasicGUI_PlaneDlg::isValid( QString& msg, QStringList& absentParams ) { const int id = getConstructorId(); if ( getSize() <= 0 ) { @@ -759,22 +759,22 @@ bool BasicGUI_PlaneDlg::isValid( QString& msg ) } if ( id == 0 ) { - bool ok = GroupPntDir->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = GroupPntDir->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) && ok; } else if ( id == 1 ) { - bool ok = Group3Pnts->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = Group3Pnts->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) && !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 ) && ok; } else if ( id == 2 ) { - bool ok = GroupFace->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = GroupFace->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return !CORBA::is_nil( myFace ) && ok; } else if ( id == 3 ) { - bool ok = Group2Vec->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = Group2Vec->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return !CORBA::is_nil( myVec1 ) && !CORBA::is_nil( myVec2 ) && !isEqual( myVec1, myVec2 ) && ok; } else if ( id == 4 ) { - bool ok = GroupLCS->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = GroupLCS->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return ok; } return false; diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.h b/src/BasicGUI/BasicGUI_PlaneDlg.h index 6b2a6fde3..e2585097e 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.h +++ b/src/BasicGUI/BasicGUI_PlaneDlg.h @@ -48,7 +48,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index dfcc38456..f94ad83b3 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -733,32 +733,32 @@ GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BasicGUI_PointDlg::isValid( QString& msg ) +bool BasicGUI_PointDlg::isValid( QString& msg, QStringList& absentParams ) { const int id = getConstructorId(); if ( id == GEOM_POINT_XYZ ) { bool ok = true; - ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; return ok; } else if ( id == GEOM_POINT_REF ) { bool ok = true; - ok = GroupRefPoint->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupRefPoint->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupRefPoint->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupRefPoint->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupRefPoint->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupRefPoint->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; return !myRefPoint->_is_nil() && ok; } else if ( id == GEOM_POINT_EDGE ) { bool ok = true; if ( myParamCoord->checkedId() == PARAM_VALUE ) - ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() ); + ok = GroupOnCurve->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); else { - ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myEdge->_is_nil() && ok; } @@ -767,13 +767,13 @@ bool BasicGUI_PointDlg::isValid( QString& msg ) else if ( id == GEOM_POINT_SURF ) { bool ok = true; if ( myParamCoord->checkedId() == PARAM_VALUE ) { - ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupOnSurface->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupOnSurface->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupOnSurface->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } else { - ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupXYZ->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myFace->_is_nil() && ok; diff --git a/src/BasicGUI/BasicGUI_PointDlg.h b/src/BasicGUI/BasicGUI_PointDlg.h index c3f95979e..a56f7803f 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.h +++ b/src/BasicGUI/BasicGUI_PointDlg.h @@ -59,7 +59,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 612557ff2..cfbc8ce5e 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -452,16 +452,16 @@ GEOM::GEOM_IOperations_ptr BasicGUI_VectorDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BasicGUI_VectorDlg::isValid( QString& msg ) +bool BasicGUI_VectorDlg::isValid( QString& msg, QStringList& absentParams ) { if(getConstructorId() == 0) return !myPoint1->_is_nil() && !myPoint2->_is_nil(); else if(getConstructorId() == 1) { bool ok = true; - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; return ok; } return false; diff --git a/src/BasicGUI/BasicGUI_VectorDlg.h b/src/BasicGUI/BasicGUI_VectorDlg.h index 747ef534b..245dadb39 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.h +++ b/src/BasicGUI/BasicGUI_VectorDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx index 347600849..6d32462bd 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx @@ -367,11 +367,11 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation() // function : isValid() // purpose : Verify validity of input data //================================================================================= -bool BlocksGUI_ExplodeDlg::isValid (QString& msg) +bool BlocksGUI_ExplodeDlg::isValid (QString& msg, QStringList& absentParams) { bool okSP = true; - okSP = myGrp1->SpinBox1->isValid( msg, !IsPreview() ) && okSP; - okSP = myGrp1->SpinBox2->isValid( msg, !IsPreview() ) && okSP; + okSP = myGrp1->SpinBox1->isValid( msg, absentParams, !IsPreview() ) && okSP; + okSP = myGrp1->SpinBox2->isValid( msg, absentParams, !IsPreview() ) && okSP; bool ok = false; switch ( getConstructorId() ) { diff --git a/src/BlocksGUI/BlocksGUI_ExplodeDlg.h b/src/BlocksGUI/BlocksGUI_ExplodeDlg.h index 63b616a4d..6f4b866be 100644 --- a/src/BlocksGUI/BlocksGUI_ExplodeDlg.h +++ b/src/BlocksGUI/BlocksGUI_ExplodeDlg.h @@ -45,7 +45,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr ); diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index cf6c2afef..ab5f72210 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -548,18 +548,18 @@ GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation() // function : isValid // purpose : Verify validity of input data //================================================================================= -bool BlocksGUI_TrsfDlg::isValid (QString& msg) +bool BlocksGUI_TrsfDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = false, okSP = true; switch (getConstructorId()) { case 0: ok = !myShape->_is_nil() && myFaces[Face1] > 0; - okSP = mySpinBox[SpinBox1]->isValid( msg, !IsPreview() ); + okSP = mySpinBox[SpinBox1]->isValid( msg, absentParams, !IsPreview() ); break; case 1: ok = !myShape->_is_nil() && myFaces[Face1U] > 0 && myFaces[Face1V] > 0; - okSP = mySpinBox[SpinBox2U]->isValid( msg, !IsPreview() ) && okSP; - okSP = mySpinBox[SpinBox2V]->isValid( msg, !IsPreview() ) && okSP; + okSP = mySpinBox[SpinBox2U]->isValid( msg, absentParams, !IsPreview() ) && okSP; + okSP = mySpinBox[SpinBox2V]->isValid( msg, absentParams, !IsPreview() ) && okSP; break; default: break; diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.h b/src/BlocksGUI/BlocksGUI_TrsfDlg.h index 558ea7516..dedeab36f 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.h +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.h @@ -53,7 +53,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid (QString&); + virtual bool isValid (QString&, QStringList&); virtual bool execute (ObjectList&); private: diff --git a/src/BuildGUI/BuildGUI_WireDlg.cxx b/src/BuildGUI/BuildGUI_WireDlg.cxx index 58d24c027..26c4306f8 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.cxx +++ b/src/BuildGUI/BuildGUI_WireDlg.cxx @@ -240,9 +240,9 @@ GEOM::GEOM_IOperations_ptr BuildGUI_WireDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BuildGUI_WireDlg::isValid (QString& msg) +bool BuildGUI_WireDlg::isValid (QString& msg, QStringList& absentParams) { - bool ok = GroupArgs->SpinBox_DX->isValid(msg, !IsPreview()); + bool ok = GroupArgs->SpinBox_DX->isValid(msg, absentParams, !IsPreview()); return myOkEdgesAndWires && ok; } diff --git a/src/BuildGUI/BuildGUI_WireDlg.h b/src/BuildGUI/BuildGUI_WireDlg.h index 6b500ee30..3b9de6e56 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.h +++ b/src/BuildGUI/BuildGUI_WireDlg.h @@ -45,7 +45,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private: diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index b645a08c4..af146a185 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -1331,32 +1331,41 @@ GEOM::GEOM_IOperations_ptr EntityGUI_SketcherDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool EntityGUI_SketcherDlg::isValid( QString& msg ) +bool EntityGUI_SketcherDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; bool toCorrect = !IsPreview() || myIsApply; if( Group1Spin->isVisible() ) { - ok = Group1Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok; + ok = Group1Spin->SpinBox_DX->isValid( msg, absentParams, toCorrect ) && ok; } else if( Group2Spin->isVisible() ) { - ok = Group2Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok; - ok = Group2Spin->SpinBox_DY->isValid( msg, toCorrect ) && ok; + ok = Group2Spin->SpinBox_DX->isValid( msg, absentParams, toCorrect ) && ok; + ok = Group2Spin->SpinBox_DY->isValid( msg, absentParams, toCorrect ) && ok; } else if( Group3Spin->isVisible() ) { - ok = Group3Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok; - ok = Group3Spin->SpinBox_DY->isValid( msg, toCorrect ) && ok; - ok = Group3Spin->SpinBox_DZ->isValid( msg, toCorrect ) && ok; + ok = Group3Spin->SpinBox_DX->isValid( msg, absentParams, toCorrect ) && ok; + ok = Group3Spin->SpinBox_DY->isValid( msg, absentParams, toCorrect ) && ok; + ok = Group3Spin->SpinBox_DZ->isValid( msg, absentParams, toCorrect ) && ok; } else if( Group4Spin->isVisible() ) { - ok = Group4Spin->SpinBox_DX->isValid( msg, toCorrect ) && ok; - ok = Group4Spin->SpinBox_DY->isValid( msg, toCorrect ) && ok; - ok = Group4Spin->SpinBox_DZ->isValid( msg, toCorrect ) && ok; - ok = Group4Spin->SpinBox_DS->isValid( msg, toCorrect ) && ok; + ok = Group4Spin->SpinBox_DX->isValid( msg, absentParams, toCorrect ) && ok; + ok = Group4Spin->SpinBox_DY->isValid( msg, absentParams, toCorrect ) && ok; + ok = Group4Spin->SpinBox_DZ->isValid( msg, absentParams, toCorrect ) && ok; + ok = Group4Spin->SpinBox_DS->isValid( msg, absentParams, toCorrect ) && ok; } - if( myIsApply && !ok ) + if( myIsApply && !ok ) { + if ( !absentParams.isEmpty() ) { + if( SalomeApp_Application* app = + dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + { + app->defineAbsentParameters( absentParams ); + return ok; + } + } showError( msg ); + } return ok; } diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.h b/src/EntityGUI/EntityGUI_SketcherDlg.h index 774068fc1..0af9ad247 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.h +++ b/src/EntityGUI/EntityGUI_SketcherDlg.h @@ -76,7 +76,7 @@ protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); void closeEvent( QCloseEvent* ); diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index ed25af099..5967bcb58 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -87,7 +87,7 @@ GEOM::GEOM_Gen_ptr GEOMBase_Helper::getGeomEngine() GEOMBase_Helper::GEOMBase_Helper( SUIT_Desktop* desktop ) : myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), myNoteBook( 0 ), isPreview( false ) { - if( SalomeApp_Application* app = (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) ) + if( SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) if( SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ) ) myNoteBook = new SalomeApp_Notebook( appStudy ); } @@ -262,7 +262,9 @@ void GEOMBase_Helper::displayPreview( const bool activate, { isPreview = true; QString msg; - if ( !isValid( msg ) ) + QStringList absentParams; + // only one prototype of isValid() methods called below will be actually processed + if ( !isValid( msg ) || !isValid( msg, absentParams ) ) { erasePreview( update ); isPreview = false; @@ -803,11 +805,8 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction ) return false; } - QString msg; - if ( !isValid( msg ) ) { - showError( msg ); + if( !checkIsValid() ) return false; - } erasePreview( false ); @@ -915,6 +914,33 @@ void GEOMBase_Helper::showError( const QString& msg ) SUIT_MessageBox::critical(SUIT_Session::session()->activeApplication()->desktop(), QObject::tr( "GEOM_ERROR" ), str, QObject::tr( "BUT_OK" ) ); } +//================================================================ +// Function : checkIsValid +// Purpose : Checks validity of the dialog contents and shows the error message +// or displays a notebook dialog if some parameters used in the dialog are not defined. +// In the second case it also redisplays preview if argument is . +//================================================================ +bool GEOMBase_Helper::checkIsValid( bool updatePreview ) +{ + SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); + if ( !app ) + return false; + + QString msg; + QStringList absentParams; + // only one prototype of isValid() methods called below will be actually processed + if ( !isValid( msg ) || !isValid( msg, absentParams ) ) { + if ( !absentParams.isEmpty() ) { + if ( app->defineAbsentParameters( absentParams ) && updatePreview ) + displayPreview(); + return false; + } + showError( msg ); + return false; + } + return true; +} + ////////////////////////////////////////////////////////////////// // Virtual methods to be redefined in dialogs ////////////////////////////////////////////////////////////////// @@ -932,12 +958,23 @@ GEOM::GEOM_IOperations_ptr GEOMBase_Helper::createOperation() //================================================================ // Function : isValid // Purpose : Called by onAccept(). Redefine this method to check validity of user input in dialog boxes. +// (This method should be redefined if there are no parametrized spin-boxes in the dialog box). //================================================================ bool GEOMBase_Helper::isValid( QString& ) { return true; } +//================================================================ +// Function : isValid +// Purpose : Called by onAccept(). Redefine this method to check validity of user input in dialog boxes. +// (This method should be redefined if there are some parametrized spin-boxes in the dialog box). +//================================================================ +bool GEOMBase_Helper::isValid( QString&, QStringList& ) +{ + return true; +} + //================================================================ // Function : execute // Purpose : This method is called by onAccept(). diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index 5aa304374..d9d646ecf 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -125,6 +125,10 @@ protected: void showError( const QString& msg ); // Shows a error message followed by + bool checkIsValid( bool updatePreview = true ); + // Checks validity of the dialog contents and shows the error message + // or displays a notebook dialog if some parameters used in the dialog are not defined + GEOM::GEOM_IOperations_ptr getOperation(); // If is nil --> calls createOperation() and put the result // into and returns it; @@ -147,6 +151,11 @@ protected: virtual bool isValid( QString& msg ); // Called by onAccept(). Redefine this method to check validity of user input in dialog boxes. + // (This method should be redefined if there are no parametrized spin-boxes in the dialog box). + + virtual bool isValid( QString& msg, QStringList& absentParams ); + // Called by onAccept(). Redefine this method to check validity of user input in dialog boxes. + // (This method should be redefined if there are some parametrized spin-boxes in the dialog box). virtual bool execute( ObjectList& objects ); // This method is called by onAccept(). diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx index 69f9d09e8..7fec8a421 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.cxx @@ -338,14 +338,14 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_FillingDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool GenerationGUI_FillingDlg::isValid( QString& msg ) +bool GenerationGUI_FillingDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; - ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox4->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox5->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox1->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox2->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox3->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox4->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox5->isValid( msg, absentParams, !IsPreview() ) && ok; return myOkCompound > 0 && ok; } diff --git a/src/GenerationGUI/GenerationGUI_FillingDlg.h b/src/GenerationGUI/GenerationGUI_FillingDlg.h index ed4de1d3d..d717a6257 100644 --- a/src/GenerationGUI/GenerationGUI_FillingDlg.h +++ b/src/GenerationGUI/GenerationGUI_FillingDlg.h @@ -45,7 +45,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private: diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index f8f4b677d..0c6fdcb08 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -623,16 +623,16 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool GenerationGUI_PrismDlg::isValid (QString& msg) +bool GenerationGUI_PrismDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; if( getConstructorId() == 0 ) - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; else if( getConstructorId() == 2 ) { - ok = GroupPoints3->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints3->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints3->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints3->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } if (getConstructorId() == 0) diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.h b/src/GenerationGUI/GenerationGUI_PrismDlg.h index 1ccc7461b..3616f4c79 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.h +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.h @@ -47,7 +47,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index 57057dd49..0595d03c8 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -392,9 +392,9 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_RevolDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool GenerationGUI_RevolDlg::isValid (QString& msg) +bool GenerationGUI_RevolDlg::isValid (QString& msg, QStringList& absentParams) { - bool ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return myOkBase && myOkAxis && ok; } diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.h b/src/GenerationGUI/GenerationGUI_RevolDlg.h index 89318effc..53ec8a636 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.h +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.h @@ -45,7 +45,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index d90d8092b..f1bf43048 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -250,12 +250,12 @@ GEOM::GEOM_IOperations_ptr OperationGUI_ArchimedeDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool OperationGUI_ArchimedeDlg::isValid( QString& msg ) +bool OperationGUI_ArchimedeDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; return !myShape->_is_nil() && ok; } diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.h b/src/OperationGUI/OperationGUI_ArchimedeDlg.h index 640e06f77..ea7820cbf 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.h +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.h @@ -45,7 +45,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private: diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 1115e6ea3..24c2170b4 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -741,48 +741,48 @@ GEOM::GEOM_IOperations_ptr OperationGUI_ChamferDlg::createOperation() // function : isValid() // purpose : Verify validity of input data //================================================================================= -bool OperationGUI_ChamferDlg::isValid (QString& msg) +bool OperationGUI_ChamferDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; switch (getConstructorId()) { case 0: - ok = mySpinBox[ SpinBox1 ]->isValid( msg, !IsPreview() ); + ok = mySpinBox[ SpinBox1 ]->isValid( msg, absentParams, !IsPreview() ); return !myShape->_is_nil() && ok; case 1: if (myRadioButton[ RadioButton21 ]->isChecked()) { - ok = mySpinBox[ SpinBox21 ]->isValid( msg, !IsPreview() ) && ok; - ok = mySpinBox[ SpinBox22 ]->isValid( msg, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox21 ]->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox22 ]->isValid( msg, absentParams, !IsPreview() ) && ok; } else { - ok = mySpinBox[ SpinBox23 ]->isValid( msg, !IsPreview() ) && ok; - ok = mySpinBox[ SpinBox24 ]->isValid( msg, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox23 ]->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox24 ]->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myShape->_is_nil() && myFace[ Face1 ] > 0 && myFace[ Face2 ] > 0 && ok; case 2: if (myRadioButton[ RadioButton31 ]->isChecked()) { - ok = mySpinBox[ SpinBox31 ]->isValid( msg, !IsPreview() ) && ok; - ok = mySpinBox[ SpinBox32 ]->isValid( msg, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox31 ]->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox32 ]->isValid( msg, absentParams, !IsPreview() ) && ok; } else { - ok = mySpinBox[ SpinBox33 ]->isValid( msg, !IsPreview() ) && ok; - ok = mySpinBox[ SpinBox34 ]->isValid( msg, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox33 ]->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox34 ]->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myShape->_is_nil() && myFaces.Extent() > 0 && ok; case 3: if (myRadioButton[ RadioButton41 ]->isChecked()) { - ok = mySpinBox[ SpinBox41 ]->isValid( msg, !IsPreview() ) && ok; - ok = mySpinBox[ SpinBox42 ]->isValid( msg, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox41 ]->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox42 ]->isValid( msg, absentParams, !IsPreview() ) && ok; } else { - ok = mySpinBox[ SpinBox43 ]->isValid( msg, !IsPreview() ) && ok; - ok = mySpinBox[ SpinBox44 ]->isValid( msg, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox43 ]->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = mySpinBox[ SpinBox44 ]->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myShape->_is_nil() && myEdges.Extent() > 0 && ok; default: return false; diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.h b/src/OperationGUI/OperationGUI_ChamferDlg.h index dfbe25d92..64a5ea52a 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.h +++ b/src/OperationGUI/OperationGUI_ChamferDlg.h @@ -63,7 +63,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private slots: diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 0c8517e38..4550f8648 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -587,30 +587,30 @@ GEOM::GEOM_IOperations_ptr OperationGUI_FilletDlg::createOperation() // function : isValid() // purpose : Verify validity of input data //================================================================================= -bool OperationGUI_FilletDlg::isValid (QString& msg) +bool OperationGUI_FilletDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; switch (getConstructorId()) { case 0: - ok = Group1->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = Group1->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; return !myShape->_is_nil() && ok; case 1: if (Group2->RadioButton1->isChecked()) - ok = Group2->SpinBox_DX->isValid( msg, !IsPreview() ); + ok = Group2->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); else { - ok = Group2->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = Group2->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = Group2->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = Group2->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myShape->_is_nil() && myEdges.Extent() > 0 && ok; case 2: if (Group3->RadioButton1->isChecked()) - ok = Group3->SpinBox_DX->isValid( msg, !IsPreview() ); + ok = Group3->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); else { - ok = Group3->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = Group3->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = Group3->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = Group3->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } return !myShape->_is_nil() && myFaces.Extent() > 0 && ok; default: return false; diff --git a/src/OperationGUI/OperationGUI_FilletDlg.h b/src/OperationGUI/OperationGUI_FilletDlg.h index 5a5a71a33..7f8dd40f5 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.h +++ b/src/OperationGUI/OperationGUI_FilletDlg.h @@ -48,7 +48,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private slots: diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 1409fae4f..c6078f364 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -423,14 +423,14 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_BoxDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_BoxDlg::isValid (QString& msg) +bool PrimitiveGUI_BoxDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; if( getConstructorId() == 1 ) { - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; ok = fabs( GroupDimensions->SpinBox_DX->value() ) > Precision::Confusion() && ok; ok = fabs( GroupDimensions->SpinBox_DY->value() ) > Precision::Confusion() && ok; diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h index 8cb75c19b..bb9d8cbf2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 1f3ad9113..436d142fb 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -439,7 +439,7 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_ConeDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_ConeDlg::isValid (QString& msg) +bool PrimitiveGUI_ConeDlg::isValid (QString& msg, QStringList& absentParams) { if (!getRadius1() && !getRadius2()) return false; @@ -447,15 +447,15 @@ bool PrimitiveGUI_ConeDlg::isValid (QString& msg) bool ok = true; if( getConstructorId() == 0 ) { - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } else if( getConstructorId() == 1 ) { - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DZ->isValid( msg, absentParams, !IsPreview() ) && ok; } ok = fabs( getHeight() ) > Precision::Confusion() && ok; return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok; diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h index 2d1d6dc83..06e88f46c 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 4fab51638..5f9eb433b 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -435,18 +435,18 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_CylinderDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_CylinderDlg::isValid (QString& msg) +bool PrimitiveGUI_CylinderDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; if( getConstructorId() == 0 ) { - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } else if( getConstructorId() == 1 ) { - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } ok = fabs( getHeight() ) > Precision::Confusion() && ok; return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok; diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h index 0e6fc18fd..2c34f1dd5 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index 3c98df4bb..5258e16d5 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -543,13 +543,13 @@ static bool isEqual (const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_DiskDlg::isValid (QString& msg) +bool PrimitiveGUI_DiskDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; if( getConstructorId() == 0 ) - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; else if( getConstructorId() == 1 ) - ok = GroupPntVecR->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = GroupPntVecR->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; const int id = getConstructorId(); if (id == 0) diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h index 83ddb2df0..5fb9f60b3 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h @@ -48,7 +48,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx index 0ac3a49a8..eb1c542a3 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx @@ -458,18 +458,18 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_FaceDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_FaceDlg::isValid( QString& msg ) +bool PrimitiveGUI_FaceDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; if( getConstructorId() == 0 ) { - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } else if( getConstructorId() == 1 ) { - ok = GroupPlane->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPlane->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupPlane->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPlane->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } const int id = getConstructorId(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.h b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.h index 90d034e8b..bf55087f5 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.h @@ -47,7 +47,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 65a3d2958..1ff802fa9 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -377,13 +377,13 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_SphereDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_SphereDlg::isValid( QString& msg ) +bool PrimitiveGUI_SphereDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; if( getConstructorId() == 0 ) - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; else if( getConstructorId() == 1 ) - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; return getConstructorId() == 0 ? !myPoint->_is_nil() && ok : ok; } diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h index 80ffe3f27..0eea01a9e 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index f286e5c5f..939d62761 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -432,18 +432,18 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_TorusDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool PrimitiveGUI_TorusDlg::isValid (QString& msg) +bool PrimitiveGUI_TorusDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; if( getConstructorId() == 0 ) { - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } else if( getConstructorId() == 1 ) { - ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; } return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) && ok : ok; } diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h index c173b0edf..265fb4179 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index d104c80b9..9668bd57b 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -351,9 +351,9 @@ GEOM::GEOM_IOperations_ptr RepairGUI_DivideEdgeDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool RepairGUI_DivideEdgeDlg::isValid( QString& msg ) +bool RepairGUI_DivideEdgeDlg::isValid( QString& msg, QStringList& absentParams ) { - bool ok = myValEdt->isValid( msg, !IsPreview() ); + bool ok = myValEdt->isValid( msg, absentParams, !IsPreview() ); return !myObject->_is_nil() && ok; } diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.h b/src/RepairGUI/RepairGUI_DivideEdgeDlg.h index d2a71bf35..4ebb23515 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.h +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.h @@ -47,7 +47,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private: diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index a9d20a4ac..59e243f0a 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -381,19 +381,19 @@ GEOM::GEOM_IOperations_ptr RepairGUI_GlueDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool RepairGUI_GlueDlg::isValid( QString& msg ) +bool RepairGUI_GlueDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; double v = 0; switch ( getConstructorId() ) { case 0: + ok = myTolEdt->isValid( msg, absentParams, !IsPreview() ); v = myTolEdt->value(); - ok = myTolEdt->isValid( msg, !IsPreview() ); break; case 1: + ok = myTolEdt2->isValid( msg, absentParams, !IsPreview() ); v = myTolEdt2->value(); - ok = myTolEdt2->isValid( msg, !IsPreview() ); break; } return !myObject->_is_nil() && ( IsPreview() || v > 0. ) && ok; @@ -552,11 +552,8 @@ bool RepairGUI_GlueDlg::onAcceptLocal() return false; } - QString msg; - if ( !isValid( msg ) ) { - showError( msg ); + if( !checkIsValid() ) return false; - } erasePreview( false ); @@ -630,11 +627,8 @@ bool RepairGUI_GlueDlg::onAcceptLocal() void RepairGUI_GlueDlg::onDetect() { clearTemporary(); - QString msg; - if ( !isValid( msg ) ) { - showError( msg ); + if( !checkIsValid( false ) ) return; - } buttonOk()->setEnabled( false ); buttonApply()->setEnabled( false ); @@ -646,6 +640,7 @@ void RepairGUI_GlueDlg::onDetect() for ( int i = 0, n = aList->length(); i < n; i++ ) myTmpObjs.push_back(GEOM::GEOM_Object::_duplicate(aList[i])); + QString msg; if ( myTmpObjs.size() > 0 ) { msg = tr( "FACES_FOR_GLUING_ARE_DETECTED" ).arg( myTmpObjs.size() ); mySubShapesChk->setChecked( true ); diff --git a/src/RepairGUI/RepairGUI_GlueDlg.h b/src/RepairGUI/RepairGUI_GlueDlg.h index 8d838ab85..e06399894 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.h +++ b/src/RepairGUI/RepairGUI_GlueDlg.h @@ -48,7 +48,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index 019d77f0e..597ccc521 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -265,10 +265,10 @@ GEOM::GEOM_IOperations_ptr RepairGUI_SewingDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool RepairGUI_SewingDlg::isValid( QString& msg ) +bool RepairGUI_SewingDlg::isValid( QString& msg, QStringList& absentParams ) { myClosed = -1; - bool ok = myTolEdt->isValid( msg, !IsPreview() ); + bool ok = myTolEdt->isValid( msg, absentParams, !IsPreview() ); return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && ok; } diff --git a/src/RepairGUI/RepairGUI_SewingDlg.h b/src/RepairGUI/RepairGUI_SewingDlg.h index 3bd6dfb7e..09c2afa6b 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.h +++ b/src/RepairGUI/RepairGUI_SewingDlg.h @@ -47,7 +47,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private: diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 2dec5a40b..a65884560 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -559,7 +559,7 @@ GEOM::GEOM_IOperations_ptr RepairGUI_ShapeProcessDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool RepairGUI_ShapeProcessDlg::isValid( QString& msg ) +bool RepairGUI_ShapeProcessDlg::isValid( QString& msg, QStringList& absentParams ) { bool ok = true; QMapIterator aMapIter( myValMap ); @@ -571,9 +571,9 @@ bool RepairGUI_ShapeProcessDlg::isValid( QString& msg ) const QString& aParam = aListIter.next(); QWidget* aControl = getControl( aParam ); if ( qobject_cast( aControl ) ) - ok = qobject_cast( aControl )->isValid( msg, !IsPreview() ) && ok; + ok = qobject_cast( aControl )->isValid( msg, absentParams, !IsPreview() ) && ok; else if ( qobject_cast( aControl ) ) - ok = qobject_cast( aControl )->isValid( msg, !IsPreview() ) && ok; + ok = qobject_cast( aControl )->isValid( msg, absentParams, !IsPreview() ) && ok; } } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h index e5fd0e902..4ace66edd 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h @@ -52,7 +52,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); private: diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 9ff7f31e0..24dc1e215 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -538,18 +538,18 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool TransformationGUI_MultiRotationDlg::isValid (QString& msg) +bool TransformationGUI_MultiRotationDlg::isValid (QString& msg, QStringList& absentParams) { bool ok = true; switch(getConstructorId()){ case 0: - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; break; case 1: - ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX1->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY1->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX2->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY2->isValid( msg, absentParams, !IsPreview() ) && ok; break; } return !(myBase->_is_nil() || myVector->_is_nil()) && ok; diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index 6e2c319df..e3fb24bb7 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -47,7 +47,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index 518fa32ea..024aab303 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -638,22 +638,22 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_MultiTranslationDlg::createOperatio // function : isValid // purpose : //================================================================================= -bool TransformationGUI_MultiTranslationDlg::isValid (QString& msg) +bool TransformationGUI_MultiTranslationDlg::isValid (QString& msg, QStringList& absentParams) { int aConstructorId = getConstructorId(); if (aConstructorId == 0) { bool ok = true; - ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox_DY->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox_DY->isValid( msg, absentParams, !IsPreview() ) && ok; return !(myBase->_is_nil() || myVectorU->_is_nil()) && ok; } else if (aConstructorId == 1) { bool ok = true; - ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) && ok; - ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX1->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY1->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DX2->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupDimensions->SpinBox_DY2->isValid( msg, absentParams, !IsPreview() ) && ok; return !(myBase->_is_nil() || myVectorU->_is_nil() || myVectorV->_is_nil()) && ok; } return 0; diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index 112147caa..385f3ccd6 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -47,7 +47,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index 5121b3bc9..76f1a9473 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -268,7 +268,7 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_OffsetDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool TransformationGUI_OffsetDlg::isValid( QString& msg ) +bool TransformationGUI_OffsetDlg::isValid( QString& msg, QStringList& absentParams ) { //return !(myObjects.length() == 0); if ( myObjects.length() == 0 ) return false; @@ -280,7 +280,7 @@ bool TransformationGUI_OffsetDlg::isValid( QString& msg ) return false; } } - return GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ); + return GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.h b/src/TransformationGUI/TransformationGUI_OffsetDlg.h index c83ec5fed..e36a6ee9f 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.h +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index c87556f4c..6849d1395 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -510,11 +510,11 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_RotationDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool TransformationGUI_RotationDlg::isValid (QString& msg) +bool TransformationGUI_RotationDlg::isValid (QString& msg, QStringList& absentParams) { switch (getConstructorId()) { case 0: { - bool ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = GroupPoints->SpinBox_DX->isValid( msg, absentParams, !IsPreview() ); return myObjects.length() > 0 && !(myAxis->_is_nil()) && ok; break; } diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.h b/src/TransformationGUI/TransformationGUI_RotationDlg.h index 9b774f704..c45cd2d1e 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index 63ba25638..7c12e7c53 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -462,18 +462,18 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool TransformationGUI_ScaleDlg::isValid (QString& msg) +bool TransformationGUI_ScaleDlg::isValid (QString& msg, QStringList& absentParams) { // && !myPoint->_is_nil() if (getConstructorId() == 0) { - bool ok = SpinBox_FX->isValid( msg, !IsPreview() ); + bool ok = SpinBox_FX->isValid( msg, absentParams, !IsPreview() ); return myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001 && ok; } bool ok = true; - ok = SpinBox_FX->isValid( msg, !IsPreview() ) && ok; - ok = SpinBox_FY->isValid( msg, !IsPreview() ) && ok; - ok = SpinBox_FZ->isValid( msg, !IsPreview() ) && ok; + ok = SpinBox_FX->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = SpinBox_FY->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = SpinBox_FZ->isValid( msg, absentParams, !IsPreview() ) && ok; return myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001 && fabs(SpinBox_FY->value()) > 0.00001 && diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.h b/src/TransformationGUI/TransformationGUI_ScaleDlg.h index 0c22428d0..ba5b31689 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.h +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.h @@ -51,7 +51,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index d2067f3bc..0088d849f 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -518,7 +518,7 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_TranslationDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool TransformationGUI_TranslationDlg::isValid (QString& msg) +bool TransformationGUI_TranslationDlg::isValid (QString& msg, QStringList& absentParams) { int aConstructorId = getConstructorId(); @@ -526,16 +526,16 @@ bool TransformationGUI_TranslationDlg::isValid (QString& msg) case 0: { bool ok = true; - ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok; - ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox1->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox2->isValid( msg, absentParams, !IsPreview() ) && ok; + ok = GroupPoints->SpinBox3->isValid( msg, absentParams, !IsPreview() ) && ok; return myObjects.length() > 0 && ok; } case 1: return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil()); case 2: { - bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ); + bool ok = GroupPoints->SpinBox3->isValid( msg, absentParams, !IsPreview() ); return myObjects.length() > 0 && !(myVector->_is_nil()) && ok; } default: diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.h b/src/TransformationGUI/TransformationGUI_TranslationDlg.h index e08425b5a..fdaaedda1 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.h @@ -46,7 +46,7 @@ public: protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); + virtual bool isValid( QString&, QStringList& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );