1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2010 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
28 from batchmode_visu import *
30 #---------------------------------------------------------------
31 def WalkTroughTimeStamps(theVISUType,
34 aView = theViewManager.Create3DView();
35 aView.SetTitle("To test presentation of %s type" % theVISUType)
37 aCache = myVisu.GetColoredPrs3dCache(myVisu.GetCurrentStudy())
38 aHolder = aCache.CreateHolder(theVISUType, theInput)
41 print "It is impossible to create such kind of holder (%s) with the given parameters" % theVISUType
42 print "\ttheMeshName = '%s'" % theInput.myMeshName
43 print "\ttheEntity = %s" % theInput.myEntity
44 print "\ttheFieldName = '%s'" % theInput.myFieldName
45 print "\ttheTimeStampNumber = %s" % theInput.myTimeStampNumber
48 aPrs3d = aHolder.GetDevice()
50 if not aHolder.Apply(aPrs3d, theInput, aView):
51 print "It is impossible to create such kind of presentation (%s) with the given parameters" % theVISUType
52 print "\ttheMeshName = '%s'" % theInput.myMeshName
53 print "\ttheEntity = %s" % theInput.myEntity
54 print "\ttheFieldName = '%s'" % theInput.myFieldName
55 print "\ttheTimeStampNumber = %s" % theInput.myTimeStampNumber
61 aRange = aHolder.GetTimeStampsRange()
63 print "%d (%s); " % (anInfo.myNumber, anInfo.myTime)
64 theInput.myTimeStampNumber = anInfo.myNumber
65 aHolder.Apply(aPrs3d, theInput, aView)
70 #---------------------------------------------------------------
72 PRS3D_TYPE_LIST.append(VISU.TGAUSSPOINTS)
73 PRS3D_TYPE_LIST.append(VISU.TSCALARMAP)
74 PRS3D_TYPE_LIST.append(VISU.TISOSURFACES)
75 PRS3D_TYPE_LIST.append(VISU.TCUTPLANES)
76 PRS3D_TYPE_LIST.append(VISU.TCUTLINES)
77 PRS3D_TYPE_LIST.append(VISU.TCUTSEGMENT)
78 PRS3D_TYPE_LIST.append(VISU.TPLOT3D)
79 PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE)
80 PRS3D_TYPE_LIST.append(VISU.TVECTORS)
81 PRS3D_TYPE_LIST.append(VISU.TSTREAMLINES)
82 PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
83 PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPEANDSCALARMAP)
86 #---------------------------------------------------------------
87 aMedFile = "TimeStamps.med"
88 aMedFile = "ResOK_0000.med"
89 aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
90 aResult = myVisu.ImportFile(aMedFile)
94 aFieldName = "vitesse";
97 anInput = VISU.ColoredPrs3dHolder.BasicInput(aResult,aMeshName,anEntity,aFieldName,aTimeStampNumber);
99 aViewManager = myVisu.GetViewManager();
101 WalkTroughTimeStamps(VISU.TSCALARMAP, anInput, aViewManager)
103 for aVISUType in PRS3D_TYPE_LIST:
104 WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
107 anInput.myEntity = VISU.CELL;
108 anInput.myFieldName = "pression";
109 WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
111 #execfile('/data/apo/a.py')