1 # Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Animation of "vitesse" field, stored in file TimeStamps.med
22 # This script is equivalent to non-regression test script 003/A5
31 medFile = os.getenv("DATA_DIR") + "/MedFiles/TimeStamps.med"
33 print 'Importing "TimeStamps.med"................',
34 myVisu = visu_gui.myVisu
35 myResult = myVisu.ImportFile(medFile)
36 if myResult is None : print "Error"
39 print "Creating Cut Lines........................",
42 aCutLines = myVisu.CutLinesOnField(myResult,'dom',VISU.NODE,medField,1.0)
43 aCutLines.SetOrientation(VISU.CutPlanes.XY, 0, 0)
44 aCutLines.SetOrientation2(VISU.CutPlanes.ZX, 0, 0)
45 aCutLines.SetNbLines(20)
46 if aCutLines is None : print "Error"
49 print "Creating a Viewer.........................",
50 myViewManager = myVisu.GetViewManager();
51 myView = myViewManager.Create3DView();
52 if myView is None : print "Error"
54 myView.Display(aCutLines);
57 aCutLinesSObj = salome.myStudy.FindObjectIOR(aCutLines.GetID())
58 aFather = aCutLinesSObj.GetFather().GetFather();
60 print "Creating an Animation.....................",
61 myAnim = myVisu.CreateAnimation(myView);
62 if myAnim is None : print "Error"
65 print "Animation.................................",
66 myAnim.addField(aFather);
67 myAnim.generatePresentations(0);
68 myAnim.generateFrames();
70 myAnim.startAnimation();
75 if not myAnim.isRunning():
76 myAnim.stopAnimation()