Salome HOME
IMP 22635: EDF 8345 - Creation of group based on groups V7_6_0b1
authoreap <eap@opencascade.com>
Tue, 14 Apr 2015 14:18:18 +0000 (17:18 +0300)
committereap <eap@opencascade.com>
Tue, 14 Apr 2015 14:18:18 +0000 (17:18 +0300)
    Bug: MAJORITY mode works wrong with triangles

IMP 22877: EDF 10054 SMESH: Add a new filter "BelongToSmeshGroup" for Create Groupe
    Bug: Invalid Python dump

src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESH_I/SMESH_2smeshpy.cxx
src/SMESH_I/SMESH_Filter_i.cxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/SMESH_SWIG/smeshBuilder.py

index c1b80e0d0c439c753f010e64f849f781f381d688..c2f4bd6e2fa145b34f1aa53bb15398e5f9f66431 100755 (executable)
@@ -3718,7 +3718,7 @@ void SMESHGUI_FilterDlg::onSelectionDone()
       }
       break;
     }
-  case SMESH::FT_BelongToMeshGroup: // get a group name and IOR
+  case SMESH::FT_BelongToMeshGroup: // get a group Name and Entry
     {
       SMESH::SMESH_GroupBase_var grp = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIO);
       if ( !grp->_is_nil() )
@@ -3732,13 +3732,8 @@ void SMESHGUI_FilterDlg::onSelectionDone()
         if ( !myGroup->_is_nil() && myGroup->IsInDependency( grp ))
           return; // avoid cyclic dependencies between Groups on Filter
 
-        SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
-          ( SUIT_Session::session()->activeApplication() );
-        if( !app ) return;
-        CORBA::String_var IOR = app->orb()->object_to_string( grp );
-
         myTable->SetThreshold(aRow, SMESH::toQStr( grp->GetName() ));
-        myTable->SetID       (aRow, IOR.in() );
+        myTable->SetID       (aRow, anIO->getEntry() );
       }
     }
   default: // get a GEOM object
@@ -3747,7 +3742,7 @@ void SMESHGUI_FilterDlg::onSelectionDone()
       if (!anObj->_is_nil())
       {
         myTable->SetThreshold(aRow, GEOMBase::GetName(anObj));
-        myTable->SetID(aRow, anIO->getEntry());
+        myTable->SetID       (aRow, anIO->getEntry());
       }
     }
   }
index a2d70b88bbca6d15740ea7c75114a5c670190e58..097dd94b7f57fa21ebf7cfb523030d46964153b2 100644 (file)
@@ -306,6 +306,8 @@ namespace {
     //   - FT_EntityType            = 36
     // v 7.3.0: FT_Undefined == 46, new items:
     //   - FT_ConnectedElements     = 39
+    // v 7.6.0: FT_Undefined == 47, new items:
+    //   - FT_BelongToMeshGroup     = 22
     //
     // It's necessary to continue recording this history and to fill
     // undef2newItems (see below) accordingly.
@@ -326,6 +328,7 @@ namespace {
       undef2newItems[ 44 ].push_back( 37 );
       undef2newItems[ 45 ].push_back( 36 );
       undef2newItems[ 46 ].push_back( 39 );
+      undef2newItems[ 47 ].push_back( 22 );
 
       ASSERT( undef2newItems.rbegin()->first == SMESH::FT_Undefined );
     }
index 7dc847a3e2db143ebc48b73e5011119816c9c532..46a46b18dfa5a1886bf191925ca594a07dcd2013 100644 (file)
@@ -764,7 +764,7 @@ void BelongToMeshGroup_i::SetGroupID( const char* theID ) // IOR or StoreName
     CORBA::Object_var obj = SMESH_Gen_i::GetORB()->string_to_object( myID.c_str() );
     SetGroup( SMESH::SMESH_GroupBase::_narrow( obj ));
   }
-  else if ( strncmp( ":0", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
+  else if ( strncmp( "0:", myID.c_str(), 2 ) == 0 ) // transient mode + GUI
   {
     SMESH_Gen_i* aSMESHGen     = SMESH_Gen_i::GetSMESHGen();
     SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy();
index ffc80579d419bbdf434e67ff1b1732b80f701081..2389d03b53054ef70bfb428939750e5135d157f1 100644 (file)
@@ -1615,7 +1615,7 @@ namespace // functions making checks according to SMESH::NB_COMMON_NODES_ENUM
   bool isMajorityOfNodesCommon(int nbChecked, int nbCommon, int nbNodes, int nbCorners,
                                bool & toStopChecking )
   {
-    return nbCommon >= nbNodes / 2;
+    return nbCommon >= (nbNodes+1) / 2;
   }
 }
 
index b85912b6b66779ddb3a88c3b1c7be579728ae81a..07d46509b3362c896619414bcafe7749e41355a7 100644 (file)
@@ -757,6 +757,13 @@ class smeshBuilder(object, SMESH._objref_SMESH_Gen):
                     raise ValueError, "Group type mismatches Element type"
                 aCriterion.ThresholdStr = aThreshold.GetName()
                 aCriterion.ThresholdID  = salome.orb.object_to_string( aThreshold )
+                study = self.GetCurrentStudy()
+                if study:
+                    so = study.FindObjectIOR( aCriterion.ThresholdID )
+                    if so:
+                        entry = so.GetID()
+                        if entry:
+                            aCriterion.ThresholdID = entry
             else:
                 raise TypeError, "The Threshold should be a Mesh Group"
         elif CritType == FT_RangeOfIds: