Back to index

salome-paravis  6.5.0
B9.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 # This case corresponds to: /visu/SWIG_scripts/B9 case
00021 
00022 from paravistest import datadir
00023 from presentations import EntityType, ScalarMapOnField, CutPlanesOnField
00024 import paravis
00025 import pvsimple
00026 
00027 
00028 my_paravis = paravis.myParavis
00029 
00030 # Get view
00031 view1 = pvsimple.GetRenderView()
00032 
00033 # Import MED file
00034 med_file = datadir + "pointe.med"
00035 field_name = "fieldnodedouble"
00036 entity = EntityType.NODE
00037 timestamp = 1
00038 
00039 my_paravis.ImportFile(med_file)
00040 med_reader = pvsimple.GetActiveSource()
00041 
00042 # Create presentations
00043 scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp)
00044 pvsimple.ResetCamera(view1)
00045 
00046 view2 = pvsimple.CreateRenderView()
00047 cutlines = CutPlanesOnField(med_reader, entity, field_name, timestamp)
00048 pvsimple.ResetCamera(view2)
00049 
00050 # Delete
00051 source = cutlines.Input
00052 pvsimple.Delete(source)
00053 pvsimple.Delete(med_reader)
00054 
00055 # Clear views from scalar bar and update views
00056 for rview in pvsimple.GetRenderViews():
00057     rview.Representations.Clear()
00058     pvsimple.Render(rview)