]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
ColorAttributeType does not exist anymore in Paraview 4.2
authorCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 3 Feb 2015 11:05:03 +0000 (12:05 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Fri, 27 Mar 2015 14:45:33 +0000 (15:45 +0100)
test/VisuPrs/3D_viewer/A5.py
test/VisuPrs/3D_viewer/A6.py
test/VisuPrs/3D_viewer/A9.py
test/VisuPrs/3D_viewer/B0.py
test/VisuPrs/SWIG_scripts/C7.py
test/VisuPrs/Util/paravistesthelper.py
test/VisuPrs/bugs/D5.py
test/VisuPrs/bugs/E0.py
test/VisuPrs/imps/A1.py

index f63d251661be747ef35c2b89580223d24c61580c..ee1df61efb84464129b383584e92b51256b724fd 100644 (file)
@@ -90,8 +90,7 @@ for reprCode in represents:
                 shrink_filter.ShrinkFactor = 0.8
                 shrink_filter.UpdatePipeline()
                 shrinked_ds = GetRepresentation(shrink_filter)
-                shrinked_ds.ColorAttributeType = ds.ColorAttributeType
-                shrinked_ds.ColorArrayName = ds.ColorArrayName
+                shrinked_ds.ColorArrayName = ds.ColorArrayName[0:2]
                 shrinked_ds.LookupTable = ds.LookupTable
             ds.Visibility = 0
             shrinked_ds.Representation = ds.Representation
index 694fc2bef8451607c735f15a7295eb663b0da9d0..99013d16986b11fad4fef4e523f005f12eea7429 100644 (file)
@@ -91,9 +91,8 @@ for reprCode in represents:
                 shrink_filter.ShrinkFactor = 0.8
                 shrink_filter.UpdatePipeline()
                 shr_sm_on_ds = GetRepresentation(shrink_filter)
-                shr_sm_on_ds.ColorArrayName = sm_on_ds.ColorArrayName
+                shr_sm_on_ds.ColorArrayName = sm_on_ds[0:2]
                 shr_sm_on_ds.LookupTable = sm_on_ds.LookupTable
-                shr_sm_on_ds.ColorAttributeType = sm_on_ds.ColorAttributeType
             sm_on_ds.Visibility = 0
             shr_sm_on_ds.Representation = sm_on_ds.Representation
             shape_to_show = shr_sm_on_ds
index c2299d1c01a0feb420acab11a6b295200fcd4c53..21159a143e07e48195e69f95b9af930de49a7d84 100644 (file)
@@ -104,8 +104,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 +205,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
index b6a5ec70efd37e76644dfe7b665af253cd813af9..0023dd6c735d8f166c5b4621d6fec43cdf561a8b 100644 (file)
@@ -88,9 +88,8 @@ for reprCode in represents:
                 shrink_filter = Shrink(scalar_map.Input)
                 shrinked_sm = GetRepresentation(shrink_filter)
                 shrink_filter.ShrinkFactor = 0.8
-                shrink_filter.UpdatePipeline()                
-                shrinked_sm.ColorAttributeType = scalar_map.ColorAttributeType
-                shrinked_sm.ColorArrayName = scalar_map.ColorArrayName
+                shrink_filter.UpdatePipeline()
+                shrinked_sm.ColorArrayName = scalar_map.ColorArrayName[0:2]
                 lookup_table = scalar_map.LookupTable
                 shrinked_sm.LookupTable = lookup_table
 
index 650fe8358fd61b33b930dc6411794e7ef9e8a0f4..cfddddaed70fd3008e0e8af9c3b270f4850afe65 100755 (executable)
@@ -97,8 +97,7 @@ lookup_table = get_lookup_table(table_name, nb_components, vector_mode)
 lookup_table.LockScalarRange = 0
 
 # Set properties
-pointmap3d.ColorAttributeType = EntityType.get_pvtype(entity)
-pointmap3d.ColorArrayName = table_name
+pointmap3d.ColorArrayName = (EntityType.get_pvtype(entity), table_name)
 pointmap3d.LookupTable = lookup_table
 
 # Add scalar bar
index f638b605247223fbc83fb9bd802c543bea2b7962..67f62359e093b004f61e0acb752d743e9c05dd18 100644 (file)
@@ -104,6 +104,8 @@ def run_test(command):
       print "    ** end of message **"
       pass
 
+  if _out:
+      print _out
   return res
 #
 
index ab838b43275098a1142fa6dc2c41582d49689473..deefe47dbaf0489e3057dd625baf79c391e89399 100644 (file)
@@ -46,19 +46,18 @@ for table_nb in range(0, tables_count):
     field_name = 'Table'
     vector_mode = 'Magnitude'
     nb_components = 1
-    
+
     # Get lookup table
     lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
     lookup_table.LockScalarRange = 0
 
     # Set properties
-    prs.ColorAttributeType = EntityType.get_pvtype(EntityType.NODE)
-    prs.ColorArrayName = field_name
+    prs.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name)
     prs.LookupTable = lookup_table
 
     # Add scalar bar
     bar = add_scalar_bar(available_tables[table_nb], nb_components, vector_mode,
                          lookup_table, "")
+
     reset_view()
     pvsimple.Delete(bar)
index 74946888bf8f43ce769cb22c3a6a07be51d17c1e..8a9a9e6152a4b65238e96ed7cc8997e45ac816ee 100644 (file)
@@ -47,7 +47,7 @@ field_name = 'vitesse'
 
 print "Creating Scalar Map......."
 scmap1 = ScalarMapOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
-if scmap1 is None : 
+if scmap1 is None :
     raise RuntimeError, "ScalarMap presentation is None!!!"
 else:
     print "OK"
@@ -70,11 +70,11 @@ time.sleep(sleep_delay)
 # 3. Create Deformed Shape And Scalar Map
 print "Creating DeformedShapeAndScalarMap......."
 scmap2 = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
-if scmap2 is None : 
+if scmap2 is None :
     raise RuntimeError, "DeformedShapeAndScalarMapOnField presentation is None!!!"
 else:
     print "OK"
-    
+
 scmap2.Input.ScaleFactor = 1.0
 
 display_only(scmap2)
@@ -95,7 +95,7 @@ time.sleep(sleep_delay)
 # 4.Create Deformed Shape
 print "Creating DeformedShape........"
 scmap3 = DeformedShapeOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
-if scmap3 is None : 
+if scmap3 is None :
     raise RuntimeError, "DeformedShapeOnField presentation is None!!!"
 else:
     print "OK"
@@ -115,11 +115,7 @@ time.sleep(sleep_delay)
 scmap2.Input.ScaleFactor = 1.0
 
 # show colored:
-scmap3.ColorAttributeType = EntityType.get_pvtype(EntityType.NODE)
-scmap3.ColorArrayName = field_name
+scmap3.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name)
 
 display_only(scmap3)
 reset_view()
-
-
-
index 2137f2fa3ecb4a000667ab134ff5e4e528c5a5dc..eecabd72d0c70c123ea9088e4716817086a8f964 100644 (file)
@@ -32,7 +32,7 @@ picturedir = get_picture_dir("imps/A1")
 def set_prs_colored(prs, proxy, entity, field_name, vector_mode, timestamp_nb):
     # Get time value
     time_value = get_time(proxy, timestamp_nb)
-    
+
     # Check vector mode
     nb_components = get_nb_components(proxy, entity, field_name)
     check_vector_mode(vector_mode, nb_components)
@@ -47,14 +47,13 @@ def set_prs_colored(prs, proxy, entity, field_name, vector_mode, timestamp_nb):
     lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0]
 
     # Set properties
-    prs.ColorAttributeType = EntityType.get_pvtype(entity)
-    prs.ColorArrayName = field_name
+    prs.ColorArrayName = (EntityType.get_pvtype(entity), field_name)
     prs.LookupTable = lookup_table
 
     # Add scalar bar
     add_scalar_bar(field_name, nb_components,
                    vector_mode, lookup_table, time_value)
-    
+
 
 # 1. Import of the "Penta6.med" file
 print 'Import "Penta6.med" file........',
@@ -71,7 +70,7 @@ view = pvsimple.GetRenderView()
 # 2. Creation of "CutPlanes" presentation, based on time stamp of "scalar field" field
 print 'Creation of "CutPlanes" presentation, based on time stamp of "scalar field" field....'
 cutplanes = CutPlanesOnField(med_reader, EntityType.CELL, "scalar field", 1)
-if cutplanes is None : 
+if cutplanes is None :
     raise RuntimeError, "Presentation is None!!!"
 else:
     print "OK"
@@ -96,7 +95,7 @@ process_prs_for_test(presentation, view, pic_path)
 print 'Creation of "CutPlanes" presentation, based on time stamp of "vectoriel field" field....'
 cutplanes = CutPlanesOnField(med_reader, EntityType.CELL, "vectoriel field", 1)
 
-if cutplanes is None : 
+if cutplanes is None :
     raise RuntimeError, "Presentation is None!!!"
 else:
     print "OK"