From: vsr Date: Wed, 29 Dec 2010 11:25:05 +0000 (+0000) Subject: Code refactoring X-Git-Tag: Start_BR_19998_21191~104 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3012e7ea8e821cf418c52109c8471ce0f41672d2;p=modules%2Fgeom.git Code refactoring --- diff --git a/src/GroupGUI/GroupGUI.cxx b/src/GroupGUI/GroupGUI.cxx index 863859fe4..c9b891fbe 100644 --- a/src/GroupGUI/GroupGUI.cxx +++ b/src/GroupGUI/GroupGUI.cxx @@ -97,11 +97,10 @@ bool GroupGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) aSelMgr->selectedObjects( aList ); if ( aList.Extent() == 1 ) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject( aList.First(), aResult ); + GEOMBase::ConvertIOinGEOMObject( aList.First() ); - if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) { + if ( !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) { aDlg = new GroupGUI_GroupDlg( GroupGUI_GroupDlg::EditGroup, getGeometryGUI(), parent ); break; } diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index 1b2caa0d2..9fb10fccc 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -213,11 +213,10 @@ void GroupGUI_GroupDlg::Init() aSelMgr->selectedObjects(aSelList); if (aSelList.Extent()) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !CORBA::is_nil(anObj) && anObj->GetType() == GEOM_GROUP) { + if ( !CORBA::is_nil(anObj) && anObj->GetType() == GEOM_GROUP ) { myGroup = anObj; mainFrame()->ResultName->setText(GEOMBase::GetName(myGroup)); @@ -376,10 +375,9 @@ void GroupGUI_GroupDlg::onGetInPlace() if (aSelList.Extent() != 1) return; - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); - if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) { + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( GEOMBase::IsShape(anObj) ) { if (!anObj->_is_equivalent(myMainObj) && !anObj->_is_equivalent(myGroup)) { SUIT_OverrideCursor wc; myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); @@ -455,11 +453,10 @@ void GroupGUI_GroupDlg::SelectionIntoArgument() int nbSel = aSelList.Extent(); if (nbSel == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) { + if ( GEOMBase::IsShape(anObj) ) { myMainObj = anObj; myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); // activate subshapes selection by default diff --git a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx index b49a52284..5000b3661 100644 --- a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx @@ -159,10 +159,7 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument() GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() > 0) { - Standard_Boolean testResult = Standard_False; - aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult) - aSelectedObject = GEOM::GEOM_Object::_nil(); + aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); } // clear selection diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx index b4a909c68..32b812011 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -170,11 +170,10 @@ void MeasureGUI_CenterMassDlg::SelectionIntoArgument() return; } - Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || aSelectedObject->_is_nil()) { + if ( aSelectedObject->_is_nil() ) { processObject(); return; } diff --git a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx index 1bef4c4ba..549542d29 100644 --- a/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx @@ -176,11 +176,10 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument() return; } - Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( !testResult || aSelectedObject->_is_nil() ) { + if ( aSelectedObject->_is_nil() ) { myGrp->LineEdit1->setText( "" ); processObject(); return; @@ -362,21 +361,16 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged() GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem]; GEOM::ListOfLong aObjLst = aErr.incriminated; - TopoDS_Shape aSelShape; - TopoDS_Shape aSubShape; - TopTools_IndexedMapOfShape anIndices; QStringList aSubShapeList; - QString aSubShapeName( "" ); - Standard_CString aTypeString; + TopoDS_Shape aSelShape; if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) { - TopExp::MapShapes( aSelShape, anIndices); + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes( aSelShape, anIndices ); for ( int i = 0, n = aObjLst.length(); i < n; i++ ) { - aSubShapeName = ""; - aSubShape = anIndices.FindKey(aObjLst[i]); - if ( GEOMBase::GetShapeTypeString( aSubShape, aTypeString ) ) - aSubShapeName = QString( aTypeString ) + QString( "_" ) + QString::number( aObjLst[i] ); - if ( !aSubShapeName.isEmpty() ) - aSubShapeList.append( aSubShapeName ); + TopoDS_Shape aSubShape = anIndices.FindKey( aObjLst[i] ); + QString aType = GEOMBase::GetShapeTypeString( aSubShape ); + if ( !aType.isEmpty() ) + aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) ); } } myGrp->ListBox2->clear(); diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx index baf8a5897..3796fc5b3 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -142,10 +142,7 @@ void MeasureGUI_DistanceDlg::SelectionIntoArgument() GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() > 0) { - Standard_Boolean testResult = Standard_False; - aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult) - aSelectedObject = GEOM::GEOM_Object::_nil(); + aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); } // clear selection diff --git a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx index db8097dee..220a0c043 100644 --- a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx @@ -171,11 +171,10 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/MeasureGUI/MeasureGUI_PointDlg.cxx b/src/MeasureGUI/MeasureGUI_PointDlg.cxx index c7064a96b..0cf30c113 100644 --- a/src/MeasureGUI/MeasureGUI_PointDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_PointDlg.cxx @@ -135,11 +135,10 @@ void MeasureGUI_PointDlg::SelectionIntoArgument() if (aSelList.Extent() < 1) return; - Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || aSelectedObject->_is_nil()) + if ( aSelectedObject->_is_nil() ) return; myObj = aSelectedObject; diff --git a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx index 9621487ed..50f39f3c2 100644 --- a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx @@ -177,16 +177,13 @@ bool MeasureGUI_PropertiesDlg::getParameters( double& theLength, //================================================================================= SALOME_Prs* MeasureGUI_PropertiesDlg::buildPrs() { - TopoDS_Shape aShape, aResult; - - if ( myObj->_is_nil() || - !GEOMBase::GetShape( myObj, aShape ) || - aShape.IsNull() || - aShape.ShapeType() != TopAbs_EDGE || - !GEOMBase::CreateArrowForLinearEdge( aShape, aResult ) || - aResult.IsNull() ) - return 0; - - return getDisplayer()->BuildPrs( aResult ); + SALOME_Prs* prs = 0; + TopoDS_Shape shape; + if ( GEOMBase::GetShape( myObj, shape, TopAbs_EDGE ) ) { + shape = GEOMBase::CreateArrowForLinearEdge( shape ); + if ( !shape.IsNull() ) + prs = getDisplayer()->BuildPrs( shape ); + } + return prs; } diff --git a/src/MeasureGUI/MeasureGUI_Skeleton.cxx b/src/MeasureGUI/MeasureGUI_Skeleton.cxx index 12a31df08..30104aaa8 100644 --- a/src/MeasureGUI/MeasureGUI_Skeleton.cxx +++ b/src/MeasureGUI/MeasureGUI_Skeleton.cxx @@ -254,10 +254,7 @@ void MeasureGUI_Skeleton::SelectionIntoArgument() GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() > 0) { - Standard_Boolean testResult = Standard_False; - aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult) - aSelectedObject = GEOM::GEOM_Object::_nil(); + aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); } if (aSelectedObject->_is_nil()) { diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 3f0233552..ac94da8a2 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -188,10 +188,9 @@ void OperationGUI_ArchimedeDlg::SelectionIntoArgument() if (aSelList.Extent() != 1) return; - Standard_Boolean testResult = Standard_False; - myShape = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + myShape = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || myShape->_is_nil() || !GEOMBase::IsShape(myShape)) { + if ( !GEOMBase::IsShape(myShape) ) { myShape = GEOM::GEOM_Object::_nil(); return; } diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 71a6e290c..ccfc070c1 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -415,11 +415,10 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() { myShape = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { myShape = anObj; myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); displayPreview(); @@ -433,11 +432,10 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() { myFace[ aCurrFocus ] = -1; if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { TColStd_IndexedMapOfInteger anIndexes; aSelMgr->GetIndexes(aSelList.First(), anIndexes); @@ -456,11 +454,10 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() if (aCurrFocus == Faces) myFaces.Clear(); else myEdges.Clear(); if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { TColStd_IndexedMapOfInteger anIndexes; aSelMgr->GetIndexes(aSelList.First(), anIndexes); diff --git a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx index f7aea996c..a22141dde 100644 --- a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx +++ b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx @@ -188,11 +188,10 @@ void OperationGUI_Fillet1d2dDlg::SelectionIntoArgument() if (myEditCurrentArgument == GroupVertexes->LineEdit1) { myShape = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { QString aName = GEOMBase::GetName( anObj ); TopoDS_Shape aShape; if ( GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { @@ -229,11 +228,10 @@ void OperationGUI_Fillet1d2dDlg::SelectionIntoArgument() myVertexes.Clear(); bool isPreview = myIs1D; if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { TColStd_IndexedMapOfInteger anIndexes; aSelMgr->GetIndexes(aSelList.First(), anIndexes); diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index e18e1cb4c..8295c2178 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -345,11 +345,10 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() { myShape = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { myShape = anObj; myEditCurrentArgument->setText(GEOMBase::GetName(anObj)); displayPreview(); @@ -365,11 +364,10 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() if (myEditCurrentArgument == Group2->LineEdit2) myEdges.Clear(); else myFaces.Clear(); if (aSelList.Extent() == 1) { - Standard_Boolean aResult = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (aResult && !anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { TColStd_IndexedMapOfInteger anIndexes; aSelMgr->GetIndexes(aSelList.First(), anIndexes); diff --git a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx index 9d815ba0c..dd2b7225a 100644 --- a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx +++ b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx @@ -189,9 +189,8 @@ void OperationGUI_GetShapesOnShapeDlg::SelectionIntoArgument() int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName, true); if (nbSel > 0) { - Standard_Boolean aRes = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes); - if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) { + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( GEOMBase::IsShape(aSelectedObject) ) { myEditCurrentArgument->setText(aName); // clear selection @@ -294,9 +293,8 @@ GEOM::GEOM_IOperations_ptr OperationGUI_GetShapesOnShapeDlg::createOperation() bool OperationGUI_GetShapesOnShapeDlg::isValid(QString&) { //Handle(SALOME_InteractiveObject) IO = firstIObject(); - //Standard_Boolean testResult; - //GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult); - //if (!testResult || anObject->_is_nil()) + //GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO ); + //if ( anObject->_is_nil() ) // return false; return !CORBA::is_nil(myObject1) && !CORBA::is_nil(myObject2); diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index b7899baeb..5ca674101 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -248,10 +248,9 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument() } // nbSel == 1 - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 6e7138640..4b4791414 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -263,10 +263,9 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument() } // nbSel == 1 - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 45905b643..29532dabb 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -257,10 +257,9 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument() } // nbSel == 1 - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if (CORBA::is_nil(aSelectedObject)) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index 264dee772..397188996 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -309,10 +309,9 @@ void PrimitiveGUI_DiskDlg::SelectionIntoArgument() // nbSel == 1 Handle(SALOME_InteractiveObject) anIO = aSelList.First(); - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO, testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx index c803419d7..b5b4b4aaf 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx @@ -329,10 +329,9 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument() } // nbSel == 1 - Standard_Boolean aRes = Standard_False; TopAbs_ShapeEnum aNeedType = TopAbs_EDGE; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), aRes ); - if ( !CORBA::is_nil( aSelectedObject ) && aRes ) { + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( !CORBA::is_nil( aSelectedObject ) ) { QString aName = GEOMBase::GetName( aSelectedObject ); TopoDS_Shape aShape; diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 9821190d9..1102a37a5 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -246,10 +246,9 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument() } /* nbSel == 1 ! */ - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( !testResult || CORBA::is_nil( aSelectedObject ) ) + if ( CORBA::is_nil( aSelectedObject ) ) return; QString aName = GEOMBase::GetName( aSelectedObject ); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index e331a0c30..3b7ba62aa 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -253,10 +253,9 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx index 87b6d503d..fd8c6be0c 100644 --- a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx +++ b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx @@ -173,11 +173,10 @@ void RepairGUI_ChangeOrientationDlg::SelectionIntoArgument() } // nbSel == 1 - Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_ptr aSelectedObject = - GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult ); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( !testResult ) + if ( CORBA::is_nil( aSelectedObject ) ) return; if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { diff --git a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx index eb90d8a4c..565c9e561 100644 --- a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx +++ b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx @@ -184,9 +184,8 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument() Handle(SALOME_InteractiveObject) anIO = aSelList.First(); if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes); - if (aRes && GEOMBase::IsShape(myObject)) { + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( GEOMBase::IsShape(myObject) ) { myEditCurrentArgument->setText(GEOMBase::GetName(myObject)); TopoDS_Shape aShape; if (GEOMBase::GetShape(myObject, aShape, TopAbs_WIRE)) diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 7423d3b94..4e67a04b0 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -243,9 +243,8 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument() if ( aSelList.Extent() == 1 ) { Handle(SALOME_InteractiveObject) anIO = aSelList.First(); - Standard_Boolean aRes; - GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); - if ( !CORBA::is_nil( aSelectedObj ) && aRes ) + GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( !CORBA::is_nil( aSelectedObj ) ) { TopoDS_Shape aShape; QString aName = GEOMBase::GetName( aSelectedObj ); diff --git a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx index b98105588..ddcb80472 100644 --- a/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeBoundDlg.cxx @@ -204,11 +204,10 @@ void RepairGUI_FreeBoundDlg::onSelectionDone() if ( aSelList.Extent() != 1 ) return; - Standard_Boolean isOk = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject( aSelList.First(), isOk ); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) ) + if ( !GEOMBase::IsShape( anObj ) ) return; else { myObj = anObj; diff --git a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx index 95cda8d98..88007ac2a 100644 --- a/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_FreeFacesDlg.cxx @@ -239,11 +239,10 @@ void RepairGUI_FreeFacesDlg::onSelectionDone() return; } - Standard_Boolean isOk = Standard_False; GEOM::GEOM_Object_var anObj = - GEOMBase::ConvertIOinGEOMObject( aSelList.First(), isOk ); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) ) { + if ( !GEOMBase::IsShape( anObj ) ) { myEdit->setText( "" ); return; } diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index e4f446246..e1f233113 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -298,9 +298,8 @@ void RepairGUI_GlueDlg::SelectionIntoArgument() if ( aSelList.Extent() == 1 ) { Handle(SALOME_InteractiveObject) anIO = aSelList.First(); - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); - if ( aRes ) + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( !CORBA::is_nil( myObject ) ) myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) ); } updateButtonState(); diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx index 19cfe7a02..ecebe2dfb 100644 --- a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx @@ -210,9 +210,8 @@ void RepairGUI_LimitToleranceDlg::SelectionIntoArgument() if (aSelList.Extent() == 1) { Handle(SALOME_InteractiveObject) anIO = aSelList.First(); - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes); - if (aRes) + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( !CORBA::is_nil( myObject ) ) myEditCurrentArgument->setText(GEOMBase::GetName(myObject)); } updateButtonState(); diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx index 1a654d7c0..c4f0c1038 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx @@ -179,11 +179,10 @@ void RepairGUI_RemoveExtraEdgesDlg::SelectionIntoArgument() } // nbSel == 1 - Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_ptr aSelectedObject = - GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult ); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if ( !testResult ) + if ( CORBA::is_nil( aSelectedObject ) ) return; if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { diff --git a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx index c6a710636..8c4335c29 100644 --- a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx @@ -186,9 +186,8 @@ void RepairGUI_RemoveHolesDlg::SelectionIntoArgument() Handle(SALOME_InteractiveObject) anIO = aSelList.First(); if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes); - if (aRes && GEOMBase::IsShape(myObject)) { + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( GEOMBase::IsShape(myObject) ) { myEditCurrentArgument->setText(GEOMBase::GetName(myObject)); // clear selection diff --git a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx index a844da195..97807e449 100644 --- a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx @@ -173,9 +173,8 @@ void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument() Handle(SALOME_InteractiveObject) anIO = aSelList.First(); if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes); - if (aRes && GEOMBase::IsShape(myObject)) { + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( GEOMBase::IsShape(myObject) ) { myEditCurrentArgument->setText(GEOMBase::GetName(myObject)); // clear selection diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index 006a929b8..1ce88ae29 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -187,9 +187,8 @@ void RepairGUI_SewingDlg::SelectionIntoArgument() if ( aSelList.Extent() == 1 ) { Handle(SALOME_InteractiveObject) anIO = aSelList.First(); - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes ); - if ( aRes ) + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( !CORBA::is_nil( myObject ) ) myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) ); } } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 5e2871f1b..7d8449d33 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -366,13 +366,12 @@ void RepairGUI_ShapeProcessDlg::selectionChanged() SALOME_ListIO aSelList; aSelMgr->selectedObjects(aSelList); - Standard_Boolean aRes = Standard_False; int i = 0; myObjects->length(aSelList.Extent()); for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) { - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes ); - if ( !CORBA::is_nil( aSelectedObject ) && aRes ) - myObjects[i++] = aSelectedObject; + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() ); + if ( !CORBA::is_nil( aSelectedObject ) ) + myObjects[i++] = aSelectedObject; } myObjects->length( i ); if ( i == 1 ) diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index 65a390055..9403ec765 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -177,9 +177,8 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument() if (aSelList.Extent() == 1) { Handle(SALOME_InteractiveObject) anIO = aSelList.First(); - Standard_Boolean aRes; - myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes); - if (aRes && GEOMBase::IsShape(myObject)) { + myObject = GEOMBase::ConvertIOinGEOMObject( anIO ); + if ( GEOMBase::IsShape(myObject) ) { myEditCurrentArgument->setText(GEOMBase::GetName(myObject)); TopoDS_Shape aShape; if (GEOMBase::GetShape(myObject, aShape, TopAbs_FACE)) @@ -245,10 +244,9 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument() aSelMgr->clearSelected(); - Standard_Boolean isOk; QString objIOR = GEOMBase::GetIORFromObject(myObject); - Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR.toLatin1().constData(), isOk, true); - if (!isOk || aSh.IsNull()) + Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape( objIOR, true ); + if ( aSh.IsNull() ) return; aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false); diff --git a/src/TransformationGUI/TransformationGUI.cxx b/src/TransformationGUI/TransformationGUI.cxx index 3da2f8d8d..aa725e4a3 100644 --- a/src/TransformationGUI/TransformationGUI.cxx +++ b/src/TransformationGUI/TransformationGUI.cxx @@ -122,9 +122,8 @@ bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) SALOME_ListIteratorOfListIO aSelIt (aSelList); for (; aSelIt.More(); aSelIt.Next()) { Handle(SALOME_InteractiveObject) io = aSelIt.Value(); - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject(io, testResult); - if (testResult) { + GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject( io ); + if ( !CORBA::is_nil( aGeomObj ) ) { anOp->RecomputeObject(aGeomObj); SUIT_ViewWindow* wnd; diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index 18c96f017..58f650769 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -244,49 +244,46 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False; - myArgument = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult || CORBA::is_nil(myArgument)) + myArgument = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( CORBA::is_nil(myArgument) ) return; aName = GEOMBase::GetName(myArgument); - if (testResult && !myArgument->_is_nil()) { - TopoDS_Shape aShape; - if (GEOMBase::GetShape(myArgument, aShape, TopAbs_SHAPE) && !aShape.IsNull()) { - TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX; - if (getConstructorId() == 1) - aNeedType = TopAbs_EDGE; - else if (getConstructorId() == 2) - aNeedType = TopAbs_FACE; - - TColStd_IndexedMapOfInteger aMap; - aSelMgr->GetIndexes(aSelList.First(), aMap); - if (aMap.Extent() == 1) { - int anIndex = aMap(1); - if (aNeedType == TopAbs_VERTEX) - aName += QString(":vertex_%1").arg(anIndex); - else - aName += QString(":edge_%1").arg(anIndex); - - //Find SubShape Object in Father - GEOM::GEOM_Object_var aFindedObject = findObjectInFather(myArgument, aName); - - if (aFindedObject->_is_nil()) { // Object not found in study - GEOM::GEOM_IShapesOperations_var aShapesOp = - getGeomEngine()->GetIShapesOperations(getStudyId()); - myArgument = aShapesOp->GetSubShape(myArgument, anIndex); - } - else { - myArgument = aFindedObject; // get Object from study - } - } - else { - if (aShape.ShapeType() != aNeedType) { - myArgument = GEOM::GEOM_Object::_nil(); - aName = ""; - } - } + TopoDS_Shape aShape; + if (GEOMBase::GetShape(myArgument, aShape, TopAbs_SHAPE) && !aShape.IsNull()) { + TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX; + if (getConstructorId() == 1) + aNeedType = TopAbs_EDGE; + else if (getConstructorId() == 2) + aNeedType = TopAbs_FACE; + + TColStd_IndexedMapOfInteger aMap; + aSelMgr->GetIndexes(aSelList.First(), aMap); + if (aMap.Extent() == 1) { + int anIndex = aMap(1); + if (aNeedType == TopAbs_VERTEX) + aName += QString(":vertex_%1").arg(anIndex); + else + aName += QString(":edge_%1").arg(anIndex); + + //Find SubShape Object in Father + GEOM::GEOM_Object_var aFindedObject = findObjectInFather(myArgument, aName); + + if (aFindedObject->_is_nil()) { // Object not found in study + GEOM::GEOM_IShapesOperations_var aShapesOp = + getGeomEngine()->GetIShapesOperations(getStudyId()); + myArgument = aShapesOp->GetSubShape(myArgument, anIndex); + } + else { + myArgument = aFindedObject; // get Object from study + } + } + else { + if (aShape.ShapeType() != aNeedType) { + myArgument = GEOM::GEOM_Object::_nil(); + aName = ""; + } } } myEditCurrentArgument->setText(aName); diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index f1fbc770a..0ba657cc0 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -307,11 +307,10 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False;; GEOM::GEOM_Object_var aSelectedObject = - GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject) || !GEOMBase::IsShape(aSelectedObject)) + if ( !GEOMBase::IsShape(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index 77c4a7bb5..43be5d91d 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -338,10 +338,9 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False;; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject) || !GEOMBase::IsShape(aSelectedObject)) + if ( !GEOMBase::IsShape(aSelectedObject) ) return; QString aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index da9067e0f..7eeca1040 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -353,9 +353,8 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False; - myStartLCS = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult || CORBA::is_nil(myStartLCS)) + myStartLCS = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( CORBA::is_nil(myStartLCS) ) return; aName = GEOMBase::GetName(myStartLCS); @@ -369,9 +368,8 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument() if (aSelList.Extent() != 1) return; - Standard_Boolean testResult = Standard_False; - myEndLCS = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult || CORBA::is_nil(myEndLCS)) + myEndLCS = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( CORBA::is_nil(myEndLCS) ) return; aName = GEOMBase::GetName(myEndLCS); @@ -385,9 +383,8 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument() if (aSelList.Extent() != 1) return; - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult || aSelectedObject->_is_nil()) + GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( aSelectedObject->_is_nil() ) return; aName = GEOMBase::GetName(myPath); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index c999df5a2..0711b7ac3 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -288,10 +288,9 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False; - aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index 17023381f..d8fba7cfe 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -309,9 +309,8 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument() GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil(); if (aSelList.Extent() == 1) { - Standard_Boolean testResult = Standard_False; - aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (testResult) + aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); + if ( !CORBA::is_nil( aSelectedObject ) ) { aName = GEOMBase::GetName(aSelectedObject); diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 292af61f6..cb60732a9 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -347,10 +347,9 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument() return; // nbSel == 1 - Standard_Boolean testResult = Standard_False; - GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() ); - if (!testResult || CORBA::is_nil(aSelectedObject)) + if ( CORBA::is_nil(aSelectedObject) ) return; aName = GEOMBase::GetName(aSelectedObject);