]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for the BUG "SALOME6.3.1: Bad dump python result in case if study contains Post...
authorrnv <rnv@opencascade.com>
Mon, 8 Aug 2011 06:48:07 +0000 (06:48 +0000)
committerrnv <rnv@opencascade.com>
Mon, 8 Aug 2011 06:48:07 +0000 (06:48 +0000)
src/VISU_I/VISU_DumpPython.cc

index 2303c455da55b0ddea5290f455ffb078477536b8..4fa096ccc44dbc06331ad753bbcfdfe5ca071bea 100644 (file)
@@ -993,12 +993,14 @@ namespace VISU
       if ( comma.empty() )
         comma = ",";
     }
+/*
     values    << '\0';
     rows      << '\0';
     columns   << '\0';
     rowUnits  << '\0';
     rowTitles << '\0';
     colTitles << '\0';
+*/
     // write FillTable command
     theStr<< thePrefix << aName << "_values  = [" << values.str()  << "]" << endl;
     theStr<< thePrefix << aName << "_rows    = [" << rows.str()    << "]" << endl;
@@ -1483,11 +1485,36 @@ namespace VISU
           return;
         case VISU::TPOINTMAP3D:
           if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
+
+               SALOMEDS::GenericAttribute_var anAttr;
+               if(theSObject->FindAttribute(anAttr,"AttributeString")){
+                       using namespace SALOMEDS;
+                       AttributeString_var aComment = AttributeString::_narrow(anAttr);
+                       CORBA::String_var aValue = aComment->Value();
+                       Storable::TRestoringMap aMap;
+                       Storable::StringToMap(aValue.in(),aMap);
+                       bool anIsExist;
+                       QString aSourceId = VISU::Storable::FindValue(aMap,"mySourceId",&anIsExist);
+                       if(anIsExist) {
+                               if( aSourceId == "TableAttr" ) {
+                                       DumpTableAttrToPython(theStudy,
+                                       theIsPublished,
+                                       theIsValidScript,
+                                       theSObject,
+                                       theStr,
+                                       theName2EntryMap,
+                                       theEntry2NameMap,
+                                       theArgumentName,
+                                       thePrefix);
+                               }
+                       }
+               }
+
            CORBA::Short aTag = theSObject->Tag();
-           theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
+               theStr<<thePrefix<<"anIsFound, aSObject = "<<(theArgumentName.empty() ? "aSComponent" : theArgumentName)<<".FindSubObject("<<aTag<<")"<<endl;
            theStr<<thePrefix<<"if anIsFound:"<<endl;
            thePrefix += PREFIX;
-           
+
            theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
            theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
            
@@ -1682,7 +1709,7 @@ namespace VISU
 
                  theStr<<thePrefix<<"pass"<<endl<<endl;
                }else if( aSourceId == "TableAttr" ){
-                 theArgumentName = aName;
+                 //theArgumentName = aName;
                  DumpTableAttrToPython(theStudy,
                                        theIsPublished,
                                        theIsValidScript,