]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Additional fix for the issue "16219: EDF PAL 469: "RemoveFromStudy" Function": dump... V6_3_0a1
authorrnv <rnv@opencascade.com>
Fri, 15 Apr 2011 08:55:44 +0000 (08:55 +0000)
committerrnv <rnv@opencascade.com>
Fri, 15 Apr 2011 08:55:44 +0000 (08:55 +0000)
src/GEOM/GEOM_Engine.cxx
src/GEOM/GEOM_Engine.hxx
src/GEOM_I/GEOM_DumpPython.cc

index f05ab56e9d514dcc22eee9ed272a98a19d6cc01b..2555e1ab92d65e2e1a62aa6f90968125e36f985d 100644 (file)
@@ -727,6 +727,23 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
       aScript += anEntryToCmd->second;
   }
 
+  //RNV: issue 16219: EDF PAL 469: "RemoveFromStudy" Function
+  //Add unpublish command if need
+  TCollection_AsciiString unpublishCmd("\n");
+  if(isMultiFile)
+    unpublishCmd += "\t";
+  unpublishCmd += "geompy.hideInStudy(";
+  
+  for (aStEntry2ObjDataPtrIt  = aStEntry2ObjDataPtr.begin();
+       aStEntry2ObjDataPtrIt != aStEntry2ObjDataPtr.end();
+       ++aStEntry2ObjDataPtrIt)
+    {
+      TObjectData* data = aStEntry2ObjDataPtrIt->second;      
+      if ( data->_unpublished && !data->_pyName.IsEmpty() ) {
+       aScript +=  unpublishCmd + data->_pyName + ")";
+      }
+    }    
+  
   //aScript += "\n\tpass\n";
   aScript += "\n";
   aValidScript = true;
index 4e8158a78190cb526fdbfef67bdaa65fa09fb48f..0e8a0c923f27175e2f8929e30f4ca5d3f5ad41a8 100644 (file)
@@ -48,6 +48,7 @@ struct TObjectData
   TCollection_AsciiString _studyEntry;
   TCollection_AsciiString _name;
   TCollection_AsciiString _pyName;
+  bool                    _unpublished;
 };
   
 class Handle_TDataStd_HArray1OfByte;
index 07c58fb70238cb47c75ee4f906953eac69d5199a..f91628a264c9bc215f3c805bb0638b175ca448c1 100644 (file)
@@ -92,6 +92,16 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
         objData._name       = aName.in();
         objData._entry      = anEntry.in();
         objData._studyEntry = aStudyEntry.in();
+
+       //Find Drawable Attribute
+       SALOMEDS::GenericAttribute_var aGenAttr;
+       if(aValue->FindAttribute(aGenAttr, "AttributeDrawable") ) {
+         SALOMEDS::AttributeDrawable_var aDrw = SALOMEDS::AttributeDrawable::_narrow(aGenAttr);
+         objData._unpublished = !aDrw->IsDrawable();
+       } else {
+         objData._unpublished = false;
+       }
+
        objectDataVec.push_back( objData );
 
        //Find attribute with list of used notebook variables