Salome HOME
Merge remote-tracking branch 'origin/V9_5_BR'
authoreap <eap@opencascade.com>
Fri, 10 Jul 2020 16:33:14 +0000 (19:33 +0300)
committereap <eap@opencascade.com>
Fri, 10 Jul 2020 16:33:14 +0000 (19:33 +0300)
Conflicts:
src/SMESH_I/SMESH_Mesh_i.cxx

CMakeLists.txt
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_Selection.cxx
src/SMESHGUI/SMESHGUI_Selection.h
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_SWIG/smeshBuilder.py
src/SMESH_SWIG/smesh_algorithm.py

index e2434f3792c2abed0c59182f3c062e79b8296477..6e6839abd3aeef2b325a8e7fba5c51fef88879ea 100644 (file)
@@ -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})
index 5d33b479330ba498ca5f06d6402549de7428ce96..21b33c443b7e5022196c3a44633009fa7374f4a0 100644 (file)
@@ -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;
 
index fdf9a8d1c3c9a39e055e5dac43fa02beea59d1b0..3a32c569bf53cbceee1f916f7bba38c427dcaf06 100644 (file)
@@ -43,8 +43,6 @@
 #include <SalomeApp_Application.h>
 #include <LightApp_VTKSelector.h>
 #include <SVTK_ViewWindow.h>
-#include <LightApp_SelectionMgr.h>
-#include <LightApp_DataOwner.h>
 
 // IDL includes
 #include <SALOMEconfig.h>
@@ -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<n; i++ ) {
       myTypes.append( typeName( type( entry( i ) ) ) );
       myControls.append( controlMode( i ) );
@@ -659,20 +655,22 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
 
 bool SMESHGUI_Selection::canBreakLink( int ind ) const
 {
-  if ( ind >= 0 && ind < myTypes.count()) {
-    if (isReference(ind)) {
-      SUIT_DataOwner* aOwn = myOwners.at(ind);
-      LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>(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<GEOM::GEOM_Object>(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<GEOM::GEOM_Object>(aGeomSObject);
+           if (!aObject->_is_nil())
+             return aObject->IsParametrical();
+          }
+        }
       }
     }
   }
index b9727108fc389223cebe4c4a62330f9f485f2965..710cfcf83c880d2d9b85f609d5044c87225608e1 100644 (file)
@@ -32,7 +32,6 @@
 
 // SALOME GUI includes
 #include <LightApp_Selection.h>
-#include <SUIT_DataOwner.h>
 
 // SALOME KERNEL includes
 #include <SALOMEDSClient_definitions.hxx>
@@ -99,7 +98,6 @@ private:
   QStringList             myTypes;
   QStringList             myControls;
   QList<SMESH_Actor*>     myActors;
-  SUIT_DataOwnerPtrList   myOwners;
 };
 
 #endif // SMESHGUI_SELECTION_H
index cf2a16ea647d3354553b1c95a1b5c4f3d3056bb3..9c00cb31ee2073aa8d0f54e6090ba84c4c3d4ed8 100644 (file)
@@ -6757,7 +6757,8 @@ TListOfListOfInt SMESH_Mesh_i::findConcurrentSubMeshes()
   TDimHypList dimHypListArr[4]; // dimHyp list for each shape dimension
 
   map<int, ::SMESH_subMesh*>::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 SMESHDS_Hypothesis*>::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<const SMESH_Hypothesis*>(*hypIt);
       if ( hyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO )
index cb0191fccf112ce1f2e4ff25dfaa441cf5f5c581..3cb09bd0e35067f639becf200640454f8271589b 100644 (file)
@@ -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] )
index e7003b5094193a6954ba0695effc13d54679f6f6..8ee3718a3839b43650811b5842125d84af7bfed3 100644 (file)
@@ -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],