Back to index

salome-paravis  6.5.0
demo4.py
Go to the documentation of this file.
00001 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 #
00003 # This library is free software; you can redistribute it and/or
00004 # modify it under the terms of the GNU Lesser General Public
00005 # License as published by the Free Software Foundation; either
00006 # version 2.1 of the License.
00007 #
00008 # This library is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 # Lesser General Public License for more details.
00012 #
00013 # You should have received a copy of the GNU Lesser General Public
00014 # License along with this library; if not, write to the Free Software
00015 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 #
00017 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 #
00019 
00020 
00021 if not ('servermanager' in dir()):
00022   from pvsimple import *
00023 
00024 import os
00025 
00026 def demo4(fname, animpth):
00027     """This method demonstrates the AnimateReader for creating animations."""
00028 
00029     reader = ExodusIIReader(FileName=fname)
00030     v = CreateRenderView()
00031     repr = Show(reader, view=v)
00032     v.StillRender()
00033     v.ResetCamera()
00034     ##v.CameraPosition = [0., -30, 0]
00035     ##v.CameraFocalPoint = [6.2, 9.5, -0.5]
00036     ##v.CameraViewUp = [-0.64, 0.2, -0.75]
00037     ##v.CameraViewAngle = [30]
00038     v.StillRender()
00039     c = v.GetActiveCamera()
00040     c.Elevation(95)
00041   
00042     r = AnimateReader(reader, view=v, filename=(animpth + "can.png"))
00043 
00044 
00045 testdir = os.getenv("TESTDIR")
00046 pvdata = os.getenv("PVDATA")
00047 
00048 if __name__ == "__main__":
00049  demo4(fname=pvdata+"/Data/can.ex2", animpth=testdir+"/Animation/")