Salome HOME
Prefix test names with component name + update test base according to 4219a9 and...
[modules/paravis.git] / test / VisuPrs / IsoSurfaces / G2.py
index 3b459bdfc71afefa235ba1184e7b31e805aedabb..674cc9d48161155600352d719b5139fc384e3895 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2010-2013  CEA/DEN, EDF R&D
+# Copyright (C) 2010-2015  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,11 +24,8 @@ import sys
 from paravistest import datadir, pictureext, get_picture_dir
 from presentations import *
 from pvsimple import *
-import paravis
 
-# Create presentations
-myParavis = paravis.myParavis
-picturedir = get_picture_dir(sys.argv[1], "IsoSurfaces/G2")
+picturedir = get_picture_dir("IsoSurfaces/G2")
 
 theFileName = datadir +  "Bug829_resu_mode.med"
 print " --------------------------------- "
@@ -37,45 +34,41 @@ print " --------------------------------- "
 
 """Build presentations of the given types for all fields of the given file."""
 #print "Import %s..." % theFileName.split('/')[-1],
-result = myParavis.ImportFile(theFileName)
+result = OpenDataFile(theFileName)
 aProxy = GetActiveSource()
 if aProxy is None:
-       raise RuntimeError, "Error: can't import file."
+        raise RuntimeError, "Error: can't import file."
 else: print "OK"
 # Get viewScalarMap
 aView = GetRenderView()
 
 # Create required presentations for the proxy
 # CreatePrsForProxy(aProxy, aView, thePrsTypeList, thePictureDir, thePictureExt, theIsAutoDelete)
-aFieldNames = aProxy.PointArrays.GetData()
-aNbOnNodes = len(aFieldNames)
-aFieldNames.extend(aProxy.CellArrays.GetData())
-aTimeStamps = aProxy.TimestepValues.GetData()
 aFieldEntity = EntityType.NODE
-aFieldName = "MODES_DEPL"
+aFieldName = "MODES___DEPL____________________"
 
 #create Iso Surfaces presentations for 10 timestamps
 for i in range(1,11):
-    hide_all(aView, True)
+    #hide_all(aView, True)
     aPrs = IsoSurfacesOnField(aProxy, aFieldEntity,aFieldName , i)
     if aPrs is None:
         raise RuntimeError, "Presentation is None!!!"
     #display only current scalar map
-    aPrs.Visibility=1
+    display_only(aPrs, aView)
     reset_view(aView)
-    Render(aView)    
-    
+    Render(aView)
+
     # Add path separator to the end of picture path if necessery
     if not picturedir.endswith(os.sep):
             picturedir += os.sep
     prs_type = PrsTypeEnum.ISOSURFACES
-            
+
     # Get name of presentation type
-    prs_name = PrsTypeEnum.get_name(prs_type)    
+    prs_name = PrsTypeEnum.get_name(prs_type)
     f_prs_type = prs_name.replace(' ', '').upper()
     # Construct image file name
     pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext
-    
+
     # Show and record the presentation
     process_prs_for_test(aPrs, aView, pic_name)