From: eap Date: Fri, 10 Jul 2020 16:33:14 +0000 (+0300) Subject: Merge remote-tracking branch 'origin/V9_5_BR' X-Git-Tag: V9_6_0a1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d55dbe18f5a898be97fbc9cf66d189a1398bae0f;hp=29c693b1c362e8045aaab556ec5d8c612294e22e;p=modules%2Fsmesh.git Merge remote-tracking branch 'origin/V9_5_BR' Conflicts: src/SMESH_I/SMESH_Mesh_i.cxx --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e2434f379..6e6839abd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ INCLUDE(CMakeDependentOption) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 4) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 5) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 5d33b4793..21b33c443 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -1402,9 +1402,11 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() SALOME_ListIteratorOfListIO anIt (aList); for (; anIt.More(); anIt.Next()) { - aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value()); - + CORBA::Object_var aGroupObj = SMESH::IObjectToObject(anIt.Value()); + if (CORBA::is_nil(aGroupObj)) + continue; // Check if the object is a geometry group + aGeomGroup = GEOM::GEOM_Object::_narrow(aGroupObj); if (CORBA::is_nil(aGeomGroup)) continue; diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index fdf9a8d1c..3a32c569b 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -43,8 +43,6 @@ #include #include #include -#include -#include // IDL includes #include @@ -79,8 +77,6 @@ void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr if( mgr ) { - myOwners.clear(); - mgr->selected(myOwners, client); for( int i=0, n=count(); i= 0 && ind < myTypes.count()) { - if (isReference(ind)) { - SUIT_DataOwner* aOwn = myOwners.at(ind); - LightApp_DataOwner* sowner = dynamic_cast(aOwn); - QString aEntry = sowner->entry(); - _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID(aEntry.toStdString()); - _PTR(SObject) aFatherObj = aSObject->GetFather(); - _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent(); - if (aComponent->ComponentDataType() == "SMESH") { - QString aObjEntry = entry(ind); - _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString()); - GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface(aGeomSObject); - if (!aObject->_is_nil()) - return aObject->IsParametrical(); + if ( ind >= 0 && isReference(ind) ) { + QString aEntry = objectInfo(ind, OI_RefEntry).toString(); + if (!aEntry.isEmpty()) { + _PTR(SObject) aSObject = SMESH::getStudy()->FindObjectID( aEntry.toStdString()); + if (aSObject) { + _PTR(SObject) aFatherObj = aSObject->GetFather(); + if (aFatherObj) { + _PTR(SComponent) aComponent = aFatherObj->GetFatherComponent(); + if (aComponent && aComponent->ComponentDataType() == "SMESH") { + QString aObjEntry = entry(ind); + _PTR(SObject) aGeomSObject = SMESH::getStudy()->FindObjectID(aObjEntry.toStdString()); + GEOM::GEOM_Object_var aObject = SMESH::SObjectToInterface(aGeomSObject); + if (!aObject->_is_nil()) + return aObject->IsParametrical(); + } + } } } } diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index b9727108f..710cfcf83 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -32,7 +32,6 @@ // SALOME GUI includes #include -#include // SALOME KERNEL includes #include @@ -99,7 +98,6 @@ private: QStringList myTypes; QStringList myControls; QList myActors; - SUIT_DataOwnerPtrList myOwners; }; #endif // SMESHGUI_SELECTION_H diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index cf2a16ea6..9c00cb31e 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -6757,7 +6757,8 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes() TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension map::iterator i_sm = _mapSubMesh.begin(); - for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) { + for ( ; i_sm != _mapSubMesh.end(); i_sm++ ) + { ::SMESH_subMesh* sm = (*i_sm).second; // shape of submesh const TopoDS_Shape& aSubMeshShape = sm->GetSubShape(); @@ -6767,7 +6768,8 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes() // Find out dimensions where the submesh can be concurrent. // We define the dimensions by algo of each of hypotheses in hypList list ::const_iterator hypIt = hypList.begin(); - for( ; hypIt != hypList.end(); hypIt++ ) { + for( ; hypIt != hypList.end(); hypIt++ ) + { SMESH_Algo* anAlgo = 0; const SMESH_Hypothesis* hyp = dynamic_cast(*hypIt); if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ) diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index cb0191fcc..3cb09bd0e 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -2636,7 +2636,15 @@ class Mesh(metaclass = MeshMeta): elif tgeo == "SOLID" or tgeo == "COMPSOLID": typ = VOLUME elif tgeo == "COMPOUND": - sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"]) + try: + sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"]) + except: + # try to get the SHAPERSTUDY engine directly, because GetGen does not work because of + # simplification of access in geomBuilder: omniORB.registerObjref + from SHAPERSTUDY_utils import getEngine + gen = getEngine() + if gen: + sub = gen.GetIShapesOperations().ExtractSubShapes(shape, self.geompyD.ShapeType["SHAPE"], False) if not sub: raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape)) return self._groupTypeFromShape( sub[0] ) diff --git a/src/SMESH_SWIG/smesh_algorithm.py b/src/SMESH_SWIG/smesh_algorithm.py index e7003b509..8ee3718a3 100644 --- a/src/SMESH_SWIG/smesh_algorithm.py +++ b/src/SMESH_SWIG/smesh_algorithm.py @@ -340,9 +340,20 @@ class Mesh_Algorithm: if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ): faceIDs = [] for shape in faces: - ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] ) - for f in ff: + try: + ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] ) + for f in ff: faceIDs.append( self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f)) + except: + # try to get the SHAPERSTUDY engine directly, because GetGen does not work because of + # simplification of access in geomBuilder: omniORB.registerObjref + from SHAPERSTUDY_utils import getEngine + gen = getEngine() + if gen: + aShapeOp = gen.GetIShapesOperations() + ff = aShapeOp.ExtractSubShapes( shape, self.mesh.geompyD.ShapeType["FACE"], False) + for f in ff: + faceIDs.append( aShapeOp.GetSubShapeIndex( self.mesh.geom, f )) faces = faceIDs hyp = self.Hypothesis("ViscousLayers", [thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore], @@ -392,9 +403,20 @@ class Mesh_Algorithm: if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ): edgeIDs = [] for shape in edges: + try: ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"]) for e in ee: - edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e )) + edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e )) + except: + # try to get the SHAPERSTUDY engine directly, because GetGen does not work because of + # simplification of access in geomBuilder: omniORB.registerObjref + from SHAPERSTUDY_utils import getEngine + gen = getEngine() + if gen: + aShapeOp = gen.GetIShapesOperations() + ee = aShapeOp.ExtractSubShapes( shape, self.mesh.geompyD.ShapeType["EDGE"], False) + for e in ee: + edgeIDs.append( aShapeOp.GetSubShapeIndex( self.mesh.geom, e )) edges = edgeIDs hyp = self.Hypothesis("ViscousLayers2D", [thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore],