Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/visu.git] / src / VISU_SWIG / visu.py
index daadf7aa4f935a60d91c2587847a18132f5e3518..c287e79aa922c4abff22e41042e8bdd24826b940 100644 (file)
@@ -81,6 +81,12 @@ def PublishComponent(theStudyDocument):
         pass
     
     return aSComponent;
+
+def SetName(theObj, theName):
+    anIOR  = myORB.object_to_string(theObj)
+    aSObj  = myLocalStudy.FindObjectIOR(anIOR)
+    anAttr = aSObj.FindAttribute("AttributeName")[1]
+    anAttr.SetValue(theName)
         
 def StrToMap(theString) :
     aPairList = split(theString,";")
@@ -339,7 +345,9 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
         while aFolderIter.More() :
             aFolderSObj = aFolderIter.Value()
             aFolderIter.Next()
-            anAttr = aFolderSObj.FindAttribute("AttributeName")[1]
+            anIsFound, anAttr = aFolderSObj.FindAttribute("AttributeName")
+            if not anIsFound :
+                continue
             anAttr = anAttr._narrow(SALOMEDS.AttributeName);
             aFolderName = anAttr.Value()
             print "    ", aFolderName
@@ -602,6 +610,23 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                             aPrsObj.RemoveFromStudy()
                                         else :
                                             aVISUObjList.append(aPrsObj)
+
+                                if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
+                                    print "          Creating ScalarMapOnDeformedShapeOnField",
+                                    aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+                                    if aPrsObj is None : print "Error"
+                                    else :
+                                        print ",OK"
+                                        theView.DisplayOnly(aPrsObj)
+                                        theView.FitAll()
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        if theIsAutoDelete :
+                                            aPrsObj.RemoveFromStudy()
+                                        else :
+                                            aVISUObjList.append(aPrsObj)
+                                
     return aVISUObjList