]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
gauss points and scalarmap on deformed shape testing was added
authorenk <enk@opencascade.com>
Wed, 18 Oct 2006 12:26:05 +0000 (12:26 +0000)
committerenk <enk@opencascade.com>
Wed, 18 Oct 2006 12:26:05 +0000 (12:26 +0000)
src/VISU_SWIG/visu.py

index 8e237dfbb8f3d358c0e1aafa335acde19139e81a..7ed0b3ffe4ce5cdae0ac4d6e66485ada337ddaf4 100644 (file)
@@ -641,6 +641,26 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                             aPrsObj.RemoveFromStudy()
                                         else :
                                             aVISUObjList.append(aPrsObj)
+
+                                if HasValue(thePrsTypeList,VISU.TGAUSSPOINTS) :
+                                    print "          Creating GaussPointsOnField",
+                                    aPrsObj = theVisu.GaussPointsOnField(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) + "_TGAUSSPOINTS." + thePictureExt
+                                        aPictureName = re.sub("\s+","_", aPictureName)
+                                        theView.SavePicture(aPictureName)
+                                        if theIsAutoDelete :
+                                            aPrsObj.RemoveFromStudy()
+                                            pass
+                                        else :
+                                            aVISUObjList.append(aPrsObj)
+                                            pass
+                                        pass
+                                    pass
                                 
     return aVISUObjList
 
@@ -951,7 +971,7 @@ def try_vectors_parameters(thePattern, theNum):
     
     return anObj
 
-def dump_vetctors_parameters(theObject):
+def dump_vectors_parameters(theObject):
     
     dump_deformedshape_parameters(theObject)
     
@@ -984,6 +1004,96 @@ def dump_isosurfaces_parameters(theObject):
     dump_scalarmap_parameters(theObject)
     print "GetNbSurfaces() = "+ str(theObject.GetNbSurfaces())
 
+# ----------------------------
+# SCALAR MAP ON DEFORMED SHAPE
+# ----------------------------
+def dump_scalarmapondeformedshape_parameters(theObject):
+    dump_scalarmap_parameters(theObject)
+    print "GetScale()          =", theObject.GetScale()
+    print "GetScalarCMeshName ()=|",theObject.GetScalarCMeshName(),"|"
+    print "GetScalarCFieldName()=|",theObject.GetScalarCFieldName(),"|"
+    print "GetScalarEEntity()   =",theObject.GetScalarEEntity()
+    print "GetScalarLIteration()=",theObject.GetScalarLIteration()
+    pass
+
+def try_scalarmapondeformedshape_parameters(thePattern):
+
+    if thePattern  is None : return None 
+    import copy
+    import random
+
+    anObj = try_scalarmap_parameters(thePattern)
+
+    # --- SCALING ---
+    print 
+    anObj.SetScale( anObj.GetScale()/random.random()*random.randint(1,10))
+
+    # --- Scalar Field ---
+    # not implemented yet.
+    
+    return anObj
+# ----------------------
+# PLOT 3D 
+# ----------------------
+def dump_plot3d_parameters(theObject):
+    dump_scalarmap_parameters(theObject)
+    print "GetOrientationType()=",str(theObject.GetOrientationType())
+    print "GetRotateX()=",theObject.GetRotateX()
+    print "GetRotateY()=",theObject.GetRotateY()
+    print "GetPlanePosition()=",theObject.GetPlanePosition()
+    print "IsPositionRelative()=",theObject.IsPositionRelative()
+    print "GetScaleFactor()=",theObject.GetScaleFactor()
+    print "GetIsContourPrs()=",theObject.GetIsContourPrs()
+    print "GetNbOfContours()=",theObject.GetNbOfContours()
+    pass
+
+def try_plot3d_parameters(thePattern):
+    if thePattern is None : return None
+    import random
+    
+    anObj = try_scalarmap_parameters(thePattern)
+
+    ORIENT = [VISU.Plot3D.XY, VISU.Plot3D.YZ, VISU.Plot3D.ZX]
+
+    theXAngle = random.random()*random.randint(-180,180)
+    theYAngle = random.random()*random.randint(-180,180)
+
+    # ORIENTATION and ANGLES
+    anObj.SetOrientation(ORIENT[random.randint(0,2)],theXAngle,theYAngle)
+
+    # Plane position (revative)
+    anObj.SetPlanePosition(random.random(),1)
+
+    # SCALE FACTOR
+    anObj.SetScaleFactor(random.random()*random.randint(-10000,10000))
+
+    # CONTOUR PRS
+    anObj.SetContourPrs(random.randint(0,1))
+    if anObj.GetIsContourPrs():
+        anObj.SetNbOfContours(random.randint(1,999))
+        pass
+    
+    pass
+
+# ----------------------
+# Gauss points
+# ----------------------
+def dump_gausspoints_parameters(theObject):
+    
+    print "\tGetScalarMode() = " + str(anObj.GetScalarMode())
+    print "\tGetMin() = " + str(anObj.GetMin()) + "  GetMax() = " + str (anObj.GetMax())
+    print "\tGetPosX() = ", str(anObj.GetPosX()) + "  GetPosY() = ", str(anObj.GetPosY())
+    print "\tGetWidth() = ", str ( anObj.GetWidth()) + "  GetHeight() = " + str(anObj.GetHeight())
+    print "\tGetNbColors() = " + str(anObj.GetNbColors())
+    print "\tGetLabels() = " + str(anObj.GetLabels())
+    print "\tGetTitle() = " + str(anObj.GetTitle())
+    pass
+
+def try_plot3d_parameters(thePattern):
+    if thePattern is None : return None
+    import random
+    
+    pass
 
 # ----------------------
 # TABLES AND CURVES