X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_ShapeByMeshDlg.cxx;h=ba0041988ed419ce13161824bc81bf079a696645;hp=4ce31d65ba68560f29605bde16c161f44f6aa11d;hb=refs%2Ftags%2FV9_7_0b1;hpb=2b3c553f4facafcea7cb1b2f23ab4b91b64771df diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index 4ce31d65b..ba0041988 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -318,14 +318,14 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() } else { - GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); + GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); - if (geomGen->_is_nil()) + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen( aMeshShape ); + if ( geomGen->_is_nil() ) return; - GEOM::GEOM_IShapesOperations_wrap aShapesOp = - geomGen->GetIShapesOperations(); - if (aShapesOp->_is_nil() ) + GEOM::GEOM_IShapesOperations_wrap aShapesOp = geomGen->GetIShapesOperations(); + if ( aShapesOp->_is_nil() ) return; TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; @@ -333,8 +333,6 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() std::map aGeomObjectsMap; GEOM::GEOM_Object_wrap aGeomObject; - GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); - for ( int i = 0; i < aListId.count(); i++ ) { aGeomObject = // received object need UnRegister()! @@ -362,9 +360,8 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() } else if (aNumberOfGO > 1) { - GEOM::GEOM_IGroupOperations_ptr aGroupOp = - geomGen->GetIGroupOperations(); - if(aGroupOp->_is_nil()) + GEOM::GEOM_IGroupOperations_wrap aGroupOp = geomGen->GetIGroupOperations(); + if ( aGroupOp->_is_nil() ) return; GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO(); @@ -379,7 +376,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() aGeomObject = aGroupOp->CreateGroup(aMeshShape, aGroupType); aGroupOp->UnionList(aGeomObject, aGeomObjects); - if (!aGroupOp->IsDone()) + if ( !aGroupOp->IsDone() ) return; } @@ -419,7 +416,7 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone() try { SALOME_ListIO aList; selectionMgr()->selectedObjects(aList); - if (!myIsMultipleAllowed && aList.Extent() != 1) + if ( aList.IsEmpty() || ( !myIsMultipleAllowed && aList.Extent() != 1) ) return; SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(aList.First()); @@ -472,7 +469,7 @@ void SMESHGUI_ShapeByMeshOp::activateSelection() //purpose : SLOT. Called when element type changed. //======================================================================= -void SMESHGUI_ShapeByMeshOp::onTypeChanged (int theType) +void SMESHGUI_ShapeByMeshOp::onTypeChanged (int /*theType*/) { setElementID(""); activateSelection(); @@ -501,7 +498,7 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText) case VOLUME: type = SMDSAbs_Volume; break; default: return; } - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts); for ( int i = 0; i < aListId.count(); i++ ) { if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))