Salome HOME
enable make test
[modules/paravis.git] / test / VisuPrs / 3D_viewer / A9.py
index d52482d15d5a7df8dda61b08953432f33ad5c97a..02f61cb62da134ec846f942208e281f59065c067 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,10 +24,8 @@ from paravistest import *
 from presentations import *
 from pvsimple import *
 import sys
-import paravis
 import time
 
-
 def check_value(prs, property_name, value, do_raise=1, compare_toler=-1.0):
     # compare just set value and the one got from presentation
     really_set_value = prs.GetPropertyValue(property_name)
@@ -60,9 +58,6 @@ picturedir = get_picture_dir("3D_viewer/A9")
 if not picturedir.endswith(os.sep):
     picturedir += os.sep
 
-#import file
-myParavis = paravis.myParavis
-
 # Get view
 my_view = GetRenderView()
 reset_view(my_view)
@@ -73,7 +68,7 @@ print " --------------------------------- "
 print "file ", theFileName
 print " --------------------------------- "
 
-myParavis.ImportFile(theFileName)
+OpenDataFile(theFileName)
 proxy = GetActiveSource()
 if proxy is None:
     raise RuntimeError("Error: can't import file.")
@@ -104,8 +99,7 @@ shrink_filter = Shrink(scalar_map.Input)
 shrink_filter.ShrinkFactor = 0.8
 shrink_filter.UpdatePipeline()
 shrinked_scalar_map = GetRepresentation(shrink_filter)
-shrinked_scalar_map.ColorAttributeType = EntityType.get_pvtype(EntityType.CELL)
-shrinked_scalar_map.ColorArrayName = field_name
+shrinked_scalar_map.ColorArrayName = (EntityType.get_pvtype(EntityType.CELL), field_name)
 shrinked_scalar_map.Representation = scalar_map.Representation
 lookup_table = scalar_map.LookupTable
 shrinked_scalar_map.LookupTable = lookup_table
@@ -206,8 +200,7 @@ shrink_filter = Shrink(scalar_map.Input)
 shrink_filter.ShrinkFactor = 0.8
 shrink_filter.UpdatePipeline()
 shrinked_scalar_map = GetRepresentation(shrink_filter)
-shrinked_scalar_map.ColorAttributeType = EntityType.get_pvtype(EntityType.CELL)
-shrinked_scalar_map.ColorArrayName = field_name
+shrinked_scalar_map.ColorArrayName = (EntityType.get_pvtype(EntityType.CELL), field_name)
 shrinked_scalar_map.Representation = scalar_map.Representation
 lookup_table = scalar_map.LookupTable
 shrinked_scalar_map.LookupTable = lookup_table