From: ouv Date: Tue, 9 Dec 2008 10:01:59 +0000 (+0000) Subject: Dump Puthon extension X-Git-Tag: TG_DumpPython_Extension_3_1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c1a4bf7ccc66ec5ba965e9c3935ee6102e403d76;p=modules%2Fgeom.git Dump Puthon extension --- diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index ea201026c..d9da6c7ad 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -617,11 +617,13 @@ static bool isEqual( const GEOM::GEOM_Object_var& thePnt1, const GEOM::GEOM_Obje bool BasicGUI_CircleDlg::isValid( QString& msg ) { const int id = getConstructorId(); - if ( id == 0 ) + if ( id == 0 ) { //return !myPoint->_is_nil() && !myDir->_is_nil() && getRadius() > 0; //nil point means origin of global CS //nil vector means Z axis - return getRadius() > 0 && GroupPntVecR->SpinBox_DX->isValid(msg, !IsPreview()); + bool ok = GroupPntVecR->SpinBox_DX->isValid(msg, !IsPreview()); + return getRadius() > 0 && ok; + } else if ( id == 1 ) return !myPoint1->_is_nil() && !myPoint2->_is_nil() && !myPoint3->_is_nil() && !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 ); diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 06da54a80..d34e63c9e 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -613,16 +613,19 @@ bool BasicGUI_PlaneDlg::isValid( QString& msg ) return false; } - if ( id == 0 ) - return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) && - GroupPntDir->SpinBox_DX->isValid( msg, !IsPreview() ); + if ( id == 0 ) { + bool ok = GroupPntDir->SpinBox_DX->isValid( msg, !IsPreview() ); + return !CORBA::is_nil( myPoint ) && !CORBA::is_nil( myDir ) && ok; + } else if ( id == 1 ) { + bool ok = Group3Pnts->SpinBox_DX->isValid( msg, !IsPreview() ); return !CORBA::is_nil( myPoint1 ) && !CORBA::is_nil( myPoint2 ) && !CORBA::is_nil( myPoint3 ) && - !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 ) && - Group3Pnts->SpinBox_DX->isValid( msg, !IsPreview() );; + !isEqual( myPoint1, myPoint2 ) && !isEqual( myPoint1, myPoint3 ) && !isEqual( myPoint2, myPoint3 ) && ok; + } + else if ( id == 2 ) { + bool ok = GroupFace->SpinBox_DX->isValid( msg, !IsPreview() ); + return !CORBA::is_nil( myFace ) && ok; } - else if ( id == 2 ) - return !CORBA::is_nil( myFace ) && GroupFace->SpinBox_DX->isValid( msg, !IsPreview() ); return false; } diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 36027937d..ff41a0e6b 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -706,7 +706,8 @@ bool BasicGUI_PointDlg::isValid( QString& msg ) return !myRefPoint->_is_nil() && ok; } else if ( id == 2 ) { - return !myEdge->_is_nil() && GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() ); + bool ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() ); + return !myEdge->_is_nil() && ok; } else if ( id == 3 ) return ( !myLine1->_is_nil() && !myLine2->_is_nil() ); diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 1e643e763..6456720fd 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -340,7 +340,8 @@ GEOM::GEOM_IOperations_ptr RepairGUI_DivideEdgeDlg::createOperation() //================================================================================= bool RepairGUI_DivideEdgeDlg::isValid( QString& msg ) { - return !myObject->_is_nil() && myValEdt->isValid( msg, !IsPreview() ); + bool ok = myValEdt->isValid( msg, !IsPreview() ); + return !myObject->_is_nil() && ok; } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index 997d6333e..db5ccfc4a 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -266,7 +266,8 @@ GEOM::GEOM_IOperations_ptr RepairGUI_SewingDlg::createOperation() bool RepairGUI_SewingDlg::isValid( QString& msg ) { myClosed = -1; - return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && myTolEdt->isValid( msg, !IsPreview() ); + bool ok = myTolEdt->isValid( msg, !IsPreview() ); + return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && ok; } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 9f75f8085..0d76ad6fd 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -501,14 +501,14 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_RotationDlg::createOperation() //================================================================================= bool TransformationGUI_RotationDlg::isValid (QString& msg) { - if (myObjects.length() < 1) return false; - switch (getConstructorId()) { - case 0: - return !(myAxis->_is_nil()) && GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ); + case 0: { + bool ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ); + return myObjects.length() > 0 && !(myAxis->_is_nil()) && ok; break; + } case 1: - return !(myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil()); + return myObjects.length() > 0 && !(myCentPoint->_is_nil() || myPoint1->_is_nil() || myPoint2->_is_nil()); break; default: break; diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index e77150d3a..89d5da51d 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -460,20 +460,20 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_ScaleDlg::createOperation() //================================================================================= bool TransformationGUI_ScaleDlg::isValid (QString& msg) { - if (myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001) - { - // && !myPoint->_is_nil() - if (getConstructorId() == 0) { - return SpinBox_FX->isValid( msg, !IsPreview() ); - } - if (fabs(SpinBox_FY->value()) > 0.00001 && - fabs(SpinBox_FZ->value()) > 0.00001 && - SpinBox_FX->isValid( msg, !IsPreview()) && - SpinBox_FY->isValid( msg, !IsPreview()) && - SpinBox_FZ->isValid( msg, !IsPreview())) - return true; + // && !myPoint->_is_nil() + if (getConstructorId() == 0) { + bool ok = SpinBox_FX->isValid( msg, !IsPreview() ); + return myObjects.length() > 0 && fabs(SpinBox_FX->value()) > 0.00001 && ok; } - return false; + + bool ok = true; + ok = SpinBox_FX->isValid( msg, !IsPreview() ) && ok; + ok = SpinBox_FY->isValid( msg, !IsPreview() ) && ok; + ok = SpinBox_FZ->isValid( msg, !IsPreview() ) && ok; + return myObjects.length() > 0 && + fabs(SpinBox_FX->value()) > 0.00001 && + fabs(SpinBox_FY->value()) > 0.00001 && + fabs(SpinBox_FZ->value()) > 0.00001 && ok; } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 4267e2a11..d55273267 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -520,8 +520,6 @@ bool TransformationGUI_TranslationDlg::isValid (QString& msg) { int aConstructorId = getConstructorId(); - if (myObjects.length() < 1) return false; - switch (aConstructorId) { case 0: { @@ -529,12 +527,15 @@ bool TransformationGUI_TranslationDlg::isValid (QString& msg) ok = GroupPoints->SpinBox1->isValid( msg, !IsPreview() ) && ok; ok = GroupPoints->SpinBox2->isValid( msg, !IsPreview() ) && ok; ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ) && ok; - return ok; + return myObjects.length() > 0 && ok; } case 1: - return !(myPoint1->_is_nil() || myPoint2->_is_nil()); + return myObjects.length() > 0 && !(myPoint1->_is_nil() || myPoint2->_is_nil()); case 2: - return !(myVector->_is_nil()) && GroupPoints->SpinBox3->isValid( msg, !IsPreview() ); + { + bool ok = GroupPoints->SpinBox3->isValid( msg, !IsPreview() ); + return myObjects.length() > 0 && !(myVector->_is_nil()) && ok; + } default: break; }