]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020598: EDF 1191 GEOM : Creation of hexa block from two faces V5_1_3_BR V5_1_3 V5_1_3_patch01 V5_1_3_patch02 V5_1_3_patch03 V5_1_3_patch04 V5_1_3_patch05 V5_1_3_patch06 V5_1_3_patch07 V5_1_3_patch08 V5_1_3_patch09 V5_1_3rc4 V5_1_3rc5
authordmv <dmv@opencascade.com>
Fri, 27 Nov 2009 09:12:06 +0000 (09:12 +0000)
committerdmv <dmv@opencascade.com>
Fri, 27 Nov 2009 09:12:06 +0000 (09:12 +0000)
src/GEOMBase/GEOMBase_Helper.cxx

index 926868a41dbb4a167c3e44a6b04ecbfba4eb7b26..70c5ebd6def54e10bb42cb80d263fe8c152b2c19 100755 (executable)
@@ -1084,23 +1084,23 @@ void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>
 
   GEOM::GEOM_IGroupOperations_var anOp = getGeomEngine()->GetIGroupOperations( getStudyId() );
  
-  for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ )
-    {
-      if ( !anOp->_is_nil() ) {
-       GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() );
-       if ( !aFatherObj->_is_nil() ) { 
-       GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() );
-      
-       //Add Object to study if its not exist
-       if ( aFindedObject == GEOM::GEOM_Object::_nil() )
-         GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy),
-                                               it.value(), it.key().toLatin1().data(), aFatherObj );
-       }
-      }
-      else {
-       //cout << " anOperations is NULL! " << endl;
+  for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ ) {
+    if ( !anOp->_is_nil() ) {
+      GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() );
+      if ( !aFatherObj->_is_nil() ) {
+        std::string aFatherEntry = getEntry( aFatherObj );      
+        if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191
+          GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() );
+          //Add Object to study if its not exist
+          if ( aFindedObject == GEOM::GEOM_Object::_nil() )
+            GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy),
+                                                  it.value(), it.key().toLatin1().data(), aFatherObj );
+        }
       }
+    } else {
+      //cout << " anOperations is NULL! " << endl;
     }
-}  
+  }
+}