1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
27 from batchmode_visu import *
29 #---------------------------------------------------------------
30 def WalkTroughTimeStamps(theVISUType,
33 aView = theViewManager.Create3DView();
34 aView.SetTitle("To test presentation of %s type" % theVISUType)
36 aCache = myVisu.GetColoredPrs3dCache(myVisu.GetCurrentStudy())
37 aHolder = aCache.CreateHolder(theVISUType, theInput)
40 print "It is impossible to create such kind of holder (%s) with the given parameters" % theVISUType
41 print "\ttheMeshName = '%s'" % theInput.myMeshName
42 print "\ttheEntity = %s" % theInput.myEntity
43 print "\ttheFieldName = '%s'" % theInput.myFieldName
44 print "\ttheTimeStampNumber = %s" % theInput.myTimeStampNumber
47 aPrs3d = aHolder.GetDevice()
49 if not aHolder.Apply(aPrs3d, theInput, aView):
50 print "It is impossible to create such kind of presentation (%s) with the given parameters" % theVISUType
51 print "\ttheMeshName = '%s'" % theInput.myMeshName
52 print "\ttheEntity = %s" % theInput.myEntity
53 print "\ttheFieldName = '%s'" % theInput.myFieldName
54 print "\ttheTimeStampNumber = %s" % theInput.myTimeStampNumber
60 aRange = aHolder.GetTimeStampsRange()
62 print "%d (%s); " % (anInfo.myNumber, anInfo.myTime)
63 theInput.myTimeStampNumber = anInfo.myNumber
64 aHolder.Apply(aPrs3d, theInput, aView)
69 #---------------------------------------------------------------
71 PRS3D_TYPE_LIST.append(VISU.TGAUSSPOINTS)
72 PRS3D_TYPE_LIST.append(VISU.TSCALARMAP)
73 PRS3D_TYPE_LIST.append(VISU.TISOSURFACES)
74 PRS3D_TYPE_LIST.append(VISU.TCUTPLANES)
75 PRS3D_TYPE_LIST.append(VISU.TCUTLINES)
76 PRS3D_TYPE_LIST.append(VISU.TCUTSEGMENT)
77 PRS3D_TYPE_LIST.append(VISU.TPLOT3D)
78 PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE)
79 PRS3D_TYPE_LIST.append(VISU.TVECTORS)
80 PRS3D_TYPE_LIST.append(VISU.TSTREAMLINES)
81 PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
82 PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPEANDSCALARMAP)
85 #---------------------------------------------------------------
86 aMedFile = "TimeStamps.med"
87 aMedFile = "ResOK_0000.med"
88 aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
89 aResult = myVisu.ImportFile(aMedFile)
93 aFieldName = "vitesse";
96 anInput = VISU.ColoredPrs3dHolder.BasicInput(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
98 aViewManager = myVisu.GetViewManager();
100 WalkTroughTimeStamps(VISU.TSCALARMAP, anInput, aViewManager)
102 for aVISUType in PRS3D_TYPE_LIST:
103 WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
106 anInput.myEntity = VISU.CELL;
107 anInput.myFieldName = "pression";
108 WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
110 #execfile('/data/apo/a.py')