]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
IPAL 0051560: wrong dump of visual parameters for displayed curves is generated for...
authorvsr <vsr@opencascade.com>
Fri, 26 Oct 2012 14:44:53 +0000 (14:44 +0000)
committervsr <vsr@opencascade.com>
Fri, 26 Oct 2012 14:44:53 +0000 (14:44 +0000)
src/VISU_I/VISU_DumpPython.cc

index 6180a5865747ddcb437cdafb43fc85784e826232..31b14b88ddf089adaf0a661ffaac1223cb329bb2 100644 (file)
@@ -1593,7 +1593,7 @@ namespace VISU
               bool withZ = aServant->GetZRow()>0;
               bool isV2 = aServant->GetIsV2();
               
-              theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
+              theStr << thePrefix << aName << " = visu.CreateCurve";
               if( isV2 )
                 theStr << "WithZExt";
               else if( withZ )
@@ -1636,6 +1636,8 @@ namespace VISU
                 case Curve::DASHDOTDOTLINE: aParam = "VISU.Curve.DASHDOTDOTLINE"; break;
               }
               theStr<<", "<<aParam<<", "<<aServant->GetLineWidth()<<")"<<endl; // line type,width
+             // Add to Name->Object map
+             theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = " << aName << endl;
             }
             return;
           case VISU::TTABLE:
@@ -2427,33 +2429,31 @@ namespace VISU
                                 aStr,
                                 aPrefix);
     
-  if (theIsPublished)
-  {
-    SALOMEDS::AttributeParameter_var ap = aStudy->GetModuleParameters("Interface Applicative", "Post-Pro", -1);
-       if(!CORBA::is_nil(ap)) {
-      std::map<std::string,std::string>::iterator it = aEntry2NameMap.begin();
-      for( ;it != aEntry2NameMap.end(); it++ ) {
-        //1. Encode entry
-        if ( ((*it).first).length() < 7 ) continue;
-           std::string tail( (*it).first, 6, ((*it).first).length()-1 );
-           std::string newEntry(ComponentDataType());
-           newEntry+=("_"+tail);
-       
-           CORBA::String_var anEntry = CORBA::string_dup(newEntry.c_str());
+    if (theIsPublished) {
+      SALOMEDS::AttributeParameter_var ap = aStudy->GetModuleParameters("Interface Applicative", "Post-Pro", -1);
+      if (!CORBA::is_nil(ap)) {
+       std::map<std::string,std::string>::iterator it = aEntry2NameMap.begin();
+       for ( ;it != aEntry2NameMap.end(); it++ ) {
+         //1. Encode entry
+         if ( ((*it).first).length() < 7 ) continue;
+         std::string tail( (*it).first, 6 );
+         std::string newEntry(ComponentDataType());
+         newEntry = newEntry + "_" + tail;
+         
+         CORBA::String_var anEntry = CORBA::string_dup( newEntry.c_str() );
 
-        if( ap->IsSet(anEntry, 6) ) { //6 Means string array, see SALOMEDS_Attributes.idl AttributeParameter interface
-             std::string idCommand = std::string("visu.getObjectID(") + (*it).second + std::string(")");
-             SALOMEDS::StringSeq_var aSeq= ap->GetStrArray(anEntry);
-             int oldLenght = aSeq->length();   
-             aSeq->length(oldLenght+2);
-             aSeq[oldLenght] = CORBA::string_dup("_PT_OBJECT_ID_");
-             aSeq[oldLenght + 1] = CORBA::string_dup(idCommand.c_str());
-             ap->SetStrArray( anEntry, aSeq );
-           }
+         if ( ap->IsSet( anEntry.in(), 6 ) ) { //6 Means string array, see SALOMEDS_Attributes.idl AttributeParameter interface
+           std::string idCommand = std::string("visu.getObjectID(") + (*it).second + std::string(")");
+           SALOMEDS::StringSeq_var aSeq= ap->GetStrArray(anEntry);
+           int oldLenght = aSeq->length();     
+           aSeq->length(oldLenght+2);
+           aSeq[oldLenght] = CORBA::string_dup("_PT_OBJECT_ID_");
+           aSeq[oldLenght + 1] = CORBA::string_dup(idCommand.c_str());
+           ap->SetStrArray( anEntry, aSeq );
          }
        }
-  }
-    
+      }
+    }
     
     //Output the script that sets up the visul parameters.
     if(theIsPublished) {