Salome HOME
Fix for 10531.
authorakk <akk@opencascade.com>
Mon, 21 Nov 2005 14:37:55 +0000 (14:37 +0000)
committerakk <akk@opencascade.com>
Mon, 21 Nov 2005 14:37:55 +0000 (14:37 +0000)
src/VISU_SWIG/visu.py

index aee18c91112eea8f09c7723f0698a1b4e896b84a..037cc764ce9a2f0fa13ae14bb073e3ef8e34e7c7 100644 (file)
@@ -349,13 +349,14 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                         print "      ", anEntityName, aMeshName,
                         aMesh = theVisu.MeshOnEntity(theResult,aMeshName,anEntity)
                         if aMesh is None : print "Error"
-                        else : print ",OK"
-                        theView.DisplayOnly(aMesh)
-                        theView.FitAll()
-                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "." + thePictureExt
-                        aPictureName = re.sub("\s+","_", aPictureName);
-                        theView.SavePicture(aPictureName)
-                        aVISUObjList.append(aMesh)
+                        else :
+                            print ",OK"
+                            theView.DisplayOnly(aMesh)
+                            theView.FitAll()
+                            aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "." + thePictureExt
+                            aPictureName = re.sub("\s+","_", aPictureName);
+                            theView.SavePicture(aPictureName)
+                            aVISUObjList.append(aMesh)
                         
                         anFamilyIter = myLocalStudy.NewChildIterator(anEntitySObj);
                         while anFamilyIter.More() :
@@ -368,13 +369,14 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                 print "        ", anFamilyName,
                                 aMesh = theVisu.FamilyMeshOnEntity(theResult,aMeshName,anEntity,anFamilyName)
                                 if aMesh is None : print "Error"
-                                else : print ",OK"
-                                theView.DisplayOnly(aMesh)
-                                theView.FitAll()
-                                aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + anFamilyName + "." + thePictureExt
-                                aPictureName = re.sub("\s+","_", aPictureName);
-                                theView.SavePicture(aPictureName)
-                                aVISUObjList.append(aMesh)
+                                else :
+                                    print ",OK"
+                                    theView.DisplayOnly(aMesh)
+                                    theView.FitAll()
+                                    aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + anFamilyName + "." + thePictureExt
+                                    aPictureName = re.sub("\s+","_", aPictureName);
+                                    theView.SavePicture(aPictureName)
+                                    aVISUObjList.append(aMesh)
                                 
             if aFolderName == 'Groups' :
                 aGroupIter = myLocalStudy.NewChildIterator(aFolderSObj);
@@ -388,13 +390,14 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                         print "      ", aGroupName,
                         aMesh = theVisu.GroupMesh(theResult,aMeshName,aGroupName)
                         if aMesh is None : print "Error"
-                        else : print ",OK"
-                        theView.DisplayOnly(aMesh)
-                        theView.FitAll()
-                        aPictureName = thePictureDir + aMeshNamePic + "_" + aGroupName + "." + thePictureExt
-                        aPictureName = re.sub("\s+","_", aPictureName);
-                        theView.SavePicture(aPictureName)
-                        aVISUObjList.append(aMesh)
+                        else :
+                            print ",OK"
+                            theView.DisplayOnly(aMesh)
+                            theView.FitAll()
+                            aPictureName = thePictureDir + aMeshNamePic + "_" + aGroupName + "." + thePictureExt
+                            aPictureName = re.sub("\s+","_", aPictureName);
+                            theView.SavePicture(aPictureName)
+                            aVISUObjList.append(aMesh)
                         
             if aFolderName == 'Fields' :
                 aFieldIter = myLocalStudy.NewChildIterator(aFolderSObj);
@@ -436,68 +439,73 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                 print "          Creating ScalarMapOnField",
                                 aPrsObj = theVisu.ScalarMapOnField(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) + "_TSCALARMAP." + thePictureExt
-                                aPictureName = re.sub("\s+","_", aPictureName);
-                                theView.SavePicture(aPictureName)
-                                aVISUObjList.append(aPrsObj)
+                                else :
+                                    print ",OK"
+                                    theView.DisplayOnly(aPrsObj)
+                                    theView.FitAll()
+                                    aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAP." + thePictureExt
+                                    aPictureName = re.sub("\s+","_", aPictureName);
+                                    theView.SavePicture(aPictureName)
+                                    aVISUObjList.append(aPrsObj)
                                 
                             if HasValue(thePrsTypeList,VISU.TISOSURFACE) :
                                 print "          Creating IsoSurfacesOnField",
                                 aPrsObj = theVisu.IsoSurfacesOnField(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) + "_TISOSURFACE." + thePictureExt
-                                aPictureName = re.sub("\s+","_", aPictureName);
-                                theView.SavePicture(aPictureName)
-                                aVISUObjList.append(aPrsObj)
+                                else :
+                                    print ",OK"
+                                    theView.DisplayOnly(aPrsObj)
+                                    theView.FitAll()
+                                    aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TISOSURFACE." + thePictureExt
+                                    aPictureName = re.sub("\s+","_", aPictureName);
+                                    theView.SavePicture(aPictureName)
+                                    aVISUObjList.append(aPrsObj)
                                 
                             if HasValue(thePrsTypeList,VISU.TCUTPLANES) :
                                 print "          Creating CutPlanesOnField",
                                 aPrsObj = theVisu.CutPlanesOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
                                 if aPrsObj is None : print "Error"
-                                else : print ",OK"
-                                aPrsObj.SetOrientation(VISU.CutPlanes.ZX,aPrsObj.GetRotateX(),aPrsObj.GetRotateY())
-                                theView.DisplayOnly(aPrsObj)
-                                theView.FitAll()
-                                aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTPLANES." + thePictureExt
-                                aPictureName = re.sub("\s+","_", aPictureName)
-                                theView.SavePicture(aPictureName)
-                                aVISUObjList.append(aPrsObj)
+                                else :
+                                    print ",OK"
+                                    aPrsObj.SetOrientation(VISU.CutPlanes.ZX,aPrsObj.GetRotateX(),aPrsObj.GetRotateY())
+                                    theView.DisplayOnly(aPrsObj)
+                                    theView.FitAll()
+                                    aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTPLANES." + thePictureExt
+                                    aPictureName = re.sub("\s+","_", aPictureName)
+                                    theView.SavePicture(aPictureName)
+                                    aVISUObjList.append(aPrsObj)
                                 
                             if HasValue(thePrsTypeList,VISU.TCUTLINES) :
                                 print "          Creating CutLinesOnField",
                                 aPrsObj = theVisu.CutLinesOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
                                 if aPrsObj is None : print "Error"
-                                else : print ",OK"
-                                aPrsObj.SetOrientation(VISU.CutPlanes.XY,aPrsObj.GetRotateX(),aPrsObj.GetRotateY())
-                                aPrsObj.SetOrientation2(VISU.CutPlanes.ZX,aPrsObj.GetRotateX2(),aPrsObj.GetRotateY2())
-                                theView.DisplayOnly(aPrsObj)
-                                theView.FitAll()
-                                aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTLINES." + thePictureExt
-                                aPictureName = re.sub("\s+","_", aPictureName)
-                                theView.SavePicture(aPictureName)
-                                aVISUObjList.append(aPrsObj)
+                                else :
+                                    print ",OK"
+                                    aPrsObj.SetOrientation(VISU.CutPlanes.XY,aPrsObj.GetRotateX(),aPrsObj.GetRotateY())
+                                    aPrsObj.SetOrientation2(VISU.CutPlanes.ZX,aPrsObj.GetRotateX2(),aPrsObj.GetRotateY2())
+                                    theView.DisplayOnly(aPrsObj)
+                                    theView.FitAll()
+                                    aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TCUTLINES." + thePictureExt
+                                    aPictureName = re.sub("\s+","_", aPictureName)
+                                    theView.SavePicture(aPictureName)
+                                    aVISUObjList.append(aPrsObj)
                                 
                             if HasValue(thePrsTypeList,VISU.TPLOT3D) :
                                 print "          Creating Plot3DOnField",
                                 aPrsObj = theVisu.Plot3DOnField(theResult,aMeshName,anEntity,
                                                                 aFieldName,aTimeStampId)
                                 if aPrsObj is None : print "Error"
-                                else : print ",OK"
+                                else :
+                                    print ",OK"
                                 #aPrsObj.SetOrientation(VISU.CutPlanes.ZX,
                                 #                       aPrsObj.GetRotateX(),
                                 #                       aPrsObj.GetRotateY())
-                                theView.DisplayOnly(aPrsObj)
-                                theView.FitAll()
-                                aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TPLOT3D." + thePictureExt
-                                aPictureName = re.sub("\s+","_", aPictureName)
-                                theView.SavePicture(aPictureName)
-                                aVISUObjList.append(aPrsObj)
+                                    theView.DisplayOnly(aPrsObj)
+                                    theView.FitAll()
+                                    aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TPLOT3D." + thePictureExt
+                                    aPictureName = re.sub("\s+","_", aPictureName)
+                                    theView.SavePicture(aPictureName)
+                                    aVISUObjList.append(aPrsObj)
                                 
                             aNumComponent = atoi(aMap["myNumComponent"])
                             if aNumComponent > 1 :
@@ -505,37 +513,40 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                     print "          Creating DeformedShapeOnField",
                                     aPrsObj = theVisu.DeformedShapeOnField(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) + "_TDEFORMEDSHAPE." + thePictureExt
-                                    aPictureName = re.sub("\s+","_", aPictureName)
-                                    theView.SavePicture(aPictureName)
-                                    aVISUObjList.append(aPrsObj)
+                                    else :
+                                        print ",OK"
+                                        theView.DisplayOnly(aPrsObj)
+                                        theView.FitAll()
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TDEFORMEDSHAPE." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        aVISUObjList.append(aPrsObj)
 
                                 if HasValue(thePrsTypeList,VISU.TVECTORS) :
                                     print "          Creating VectorsOnField",
                                     aPrsObj = theVisu.VectorsOnField(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) + "_TVECTORS." + thePictureExt
-                                    aPictureName = re.sub("\s+","_", aPictureName)
-                                    theView.SavePicture(aPictureName)
-                                    aVISUObjList.append(aPrsObj)
+                                    else :
+                                        print ",OK"
+                                        theView.DisplayOnly(aPrsObj)
+                                        theView.FitAll()
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TVECTORS." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        aVISUObjList.append(aPrsObj)
                                     
                                 if HasValue(thePrsTypeList,VISU.TSTREAMLINES) :
                                     print "          Creating StreamLinesOnField",
                                     aPrsObj = theVisu.StreamLinesOnField(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) + "_TSTREAMLINES." + thePictureExt
-                                    aPictureName = re.sub("\s+","_", aPictureName)
-                                    theView.SavePicture(aPictureName)
-                                    aVISUObjList.append(aPrsObj)
+                                    else :
+                                        print ",OK"
+                                        theView.DisplayOnly(aPrsObj)
+                                        theView.FitAll()
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSTREAMLINES." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        aVISUObjList.append(aPrsObj)
                     
     return aVISUObjList