From: Cédric Aguerre Date: Tue, 3 Feb 2015 11:05:03 +0000 (+0100) Subject: ColorAttributeType does not exist anymore in Paraview 4.2 X-Git-Tag: V7_6_0a1~2^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=31f86e26032aac3811669072bb1170cca322dd6a;p=modules%2Fparavis.git ColorAttributeType does not exist anymore in Paraview 4.2 --- diff --git a/test/VisuPrs/3D_viewer/A5.py b/test/VisuPrs/3D_viewer/A5.py index f63d2516..ee1df61e 100644 --- a/test/VisuPrs/3D_viewer/A5.py +++ b/test/VisuPrs/3D_viewer/A5.py @@ -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 diff --git a/test/VisuPrs/3D_viewer/A6.py b/test/VisuPrs/3D_viewer/A6.py index 694fc2be..99013d16 100644 --- a/test/VisuPrs/3D_viewer/A6.py +++ b/test/VisuPrs/3D_viewer/A6.py @@ -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 diff --git a/test/VisuPrs/3D_viewer/A9.py b/test/VisuPrs/3D_viewer/A9.py index c2299d1c..21159a14 100644 --- a/test/VisuPrs/3D_viewer/A9.py +++ b/test/VisuPrs/3D_viewer/A9.py @@ -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 diff --git a/test/VisuPrs/3D_viewer/B0.py b/test/VisuPrs/3D_viewer/B0.py index b6a5ec70..0023dd6c 100644 --- a/test/VisuPrs/3D_viewer/B0.py +++ b/test/VisuPrs/3D_viewer/B0.py @@ -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 diff --git a/test/VisuPrs/SWIG_scripts/C7.py b/test/VisuPrs/SWIG_scripts/C7.py index 650fe835..cfddddae 100755 --- a/test/VisuPrs/SWIG_scripts/C7.py +++ b/test/VisuPrs/SWIG_scripts/C7.py @@ -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 diff --git a/test/VisuPrs/Util/paravistesthelper.py b/test/VisuPrs/Util/paravistesthelper.py index f638b605..67f62359 100644 --- a/test/VisuPrs/Util/paravistesthelper.py +++ b/test/VisuPrs/Util/paravistesthelper.py @@ -104,6 +104,8 @@ def run_test(command): print " ** end of message **" pass + if _out: + print _out return res # diff --git a/test/VisuPrs/bugs/D5.py b/test/VisuPrs/bugs/D5.py index ab838b43..deefe47d 100644 --- a/test/VisuPrs/bugs/D5.py +++ b/test/VisuPrs/bugs/D5.py @@ -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) diff --git a/test/VisuPrs/bugs/E0.py b/test/VisuPrs/bugs/E0.py index 74946888..8a9a9e61 100644 --- a/test/VisuPrs/bugs/E0.py +++ b/test/VisuPrs/bugs/E0.py @@ -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() - - - diff --git a/test/VisuPrs/imps/A1.py b/test/VisuPrs/imps/A1.py index 2137f2fa..eecabd72 100644 --- a/test/VisuPrs/imps/A1.py +++ b/test/VisuPrs/imps/A1.py @@ -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"