From: enk Date: Wed, 18 Oct 2006 12:26:05 +0000 (+0000) Subject: gauss points and scalarmap on deformed shape testing was added X-Git-Tag: mergeto_V3_2_0_maintainance_30Nov06~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37d1cea25a492b8b0acd4455653dcbcaf4ba37f3;p=modules%2Fvisu.git gauss points and scalarmap on deformed shape testing was added --- diff --git a/src/VISU_SWIG/visu.py b/src/VISU_SWIG/visu.py index 8e237dfb..7ed0b3ff 100644 --- a/src/VISU_SWIG/visu.py +++ b/src/VISU_SWIG/visu.py @@ -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