5 from batchmode_visu import *
7 #---------------------------------------------------------------
8 def WalkTroughTimeStamps(theVISUType,
11 aView = theViewManager.Create3DView();
12 aView.SetTitle("To test presentation of %s type" % theVISUType)
14 aCache = myVisu.GetColoredPrs3dCache(myVisu.GetCurrentStudy())
15 aHolder = aCache.CreateHolder(theVISUType, theInput)
18 print "It is impossible to create such kind of holder (%s) with the given parameters" % theVISUType
19 print "\ttheMeshName = '%s'" % theInput.myMeshName
20 print "\ttheEntity = %s" % theInput.myEntity
21 print "\ttheFieldName = '%s'" % theInput.myFieldName
22 print "\ttheTimeStampNumber = %s" % theInput.myTimeStampNumber
25 aPrs3d = aHolder.GetDevice()
27 if not aHolder.Apply(aPrs3d, theInput, aView):
28 print "It is impossible to create such kind of presentation (%s) with the given parameters" % theVISUType
29 print "\ttheMeshName = '%s'" % theInput.myMeshName
30 print "\ttheEntity = %s" % theInput.myEntity
31 print "\ttheFieldName = '%s'" % theInput.myFieldName
32 print "\ttheTimeStampNumber = %s" % theInput.myTimeStampNumber
38 aRange = aHolder.GetTimeStampsRange()
40 print "%d (%s); " % (anInfo.myNumber, anInfo.myTime)
41 theInput.myTimeStampNumber = anInfo.myNumber
42 aHolder.Apply(aPrs3d, theInput, aView)
47 #---------------------------------------------------------------
49 PRS3D_TYPE_LIST.append(VISU.TGAUSSPOINTS)
50 PRS3D_TYPE_LIST.append(VISU.TSCALARMAP)
51 PRS3D_TYPE_LIST.append(VISU.TISOSURFACES)
52 PRS3D_TYPE_LIST.append(VISU.TCUTPLANES)
53 PRS3D_TYPE_LIST.append(VISU.TCUTLINES)
54 PRS3D_TYPE_LIST.append(VISU.TPLOT3D)
55 PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE)
56 PRS3D_TYPE_LIST.append(VISU.TVECTORS)
57 PRS3D_TYPE_LIST.append(VISU.TSTREAMLINES)
58 PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
61 #---------------------------------------------------------------
62 aMedFile = "TimeStamps.med"
63 aMedFile = "ResOK_0000.med"
64 aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
65 aResult = myVisu.ImportFile(aMedFile)
69 aFieldName = "vitesse";
72 anInput = VISU.ColoredPrs3dHolder.BasicInput(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
74 aViewManager = myVisu.GetViewManager();
76 WalkTroughTimeStamps(VISU.TSCALARMAP, anInput, aViewManager)
78 for aVISUType in PRS3D_TYPE_LIST:
79 WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
82 anInput.myEntity = VISU.CELL;
83 anInput.myFieldName = "pression";
84 WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
86 #execfile('/data/apo/a.py')