From f0f5cb61863e2e824ff62f4d5ba5155e5b314039 Mon Sep 17 00:00:00 2001 From: rnv Date: Thu, 10 Mar 2016 15:19:00 +0300 Subject: [PATCH] Update dump trace/study tests. --- src/PV_SWIG/presentations.py | 42 +++++++++++++------------- test/VisuPrs/dump_study/A0.py | 9 ++++-- test/VisuPrs/dump_study/A1.py | 18 +++++++++-- test/VisuPrs/dump_study/A2.py | 17 +++++++++-- test/VisuPrs/dump_study/A3.py | 23 ++++++++++---- test/VisuPrs/dump_study/A4.py | 18 +++++++++-- test/VisuPrs/dump_study/A5.py | 17 +++++++++-- test/VisuPrs/dump_study/A6.py | 17 +++++++++-- test/VisuPrs/dump_study/A8.py | 31 +++++++++++++------ test/VisuPrs/dump_study/B0.py | 11 ++++++- test/VisuPrs/dump_study/B3.py | 9 +++++- test/VisuPrs/dump_study/B4.py | 10 +++++- test/VisuPrs/dump_study/CMakeLists.txt | 2 +- 13 files changed, 165 insertions(+), 59 deletions(-) diff --git a/src/PV_SWIG/presentations.py b/src/PV_SWIG/presentations.py index 02097ac4..736ecc35 100644 --- a/src/PV_SWIG/presentations.py +++ b/src/PV_SWIG/presentations.py @@ -1122,7 +1122,7 @@ def ScalarMapOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - scalarmap.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(scalarmap, (EntityType.get_pvtype(entity), field_name)) scalarmap.LookupTable = lookup_table # Add scalar bar @@ -1213,7 +1213,7 @@ def CutPlanesOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_planes.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_planes, (EntityType.get_pvtype(entity), field_name)) cut_planes.LookupTable = lookup_table # Add scalar bar @@ -1360,7 +1360,7 @@ def CutLinesOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_lines.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_lines, (EntityType.get_pvtype(entity), field_name)) cut_lines.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1439,7 +1439,7 @@ def CutSegmentOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_segment.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_segment, (EntityType.get_pvtype(entity), field_name)) cut_segment.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1562,9 +1562,9 @@ def VectorsOnField(proxy, entity, field_name, timestamp_nb, # Set properties if (is_colored): - vectors.ColorArrayName = (EntityType.get_pvtype(entity), 'GlyphVector') + pvs.ColorBy(vectors, (EntityType.get_pvtype(entity), 'GlyphVector')) else: - vectors.ColorArrayName = (None, '') + pvs.ColorBy(vectors, (EntityType.get_pvtype(entity), None)) vectors.LookupTable = lookup_table vectors.LineWidth = 1.0 @@ -1666,9 +1666,9 @@ def DeformedShapeOnField(proxy, entity, field_name, # Set properties if is_colored: - defshape.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(defshape, (EntityType.get_pvtype(entity), field_name)) else: - defshape.ColorArrayName = (None, '') + pvs.ColorBy(defshape, (EntityType.get_pvtype(entity), None)) defshape.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1789,7 +1789,7 @@ def DeformedShapeAndScalarMapOnField(proxy, entity, field_name, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - defshapemap.ColorArrayName = (EntityType.get_pvtype(scalar_field_entity), scalar_field) + pvs.ColorBy(defshapemap, (EntityType.get_pvtype(scalar_field_entity), scalar_field)) defshapemap.LookupTable = lookup_table # Add scalar bar @@ -1964,7 +1964,7 @@ def Plot3DOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - plot3d.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(plot3d, (EntityType.get_pvtype(entity), field_name)) plot3d.LookupTable = lookup_table # Add scalar bar @@ -2045,7 +2045,7 @@ def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, if (scalar_range is None): scalar_range = get_data_range(proxy, entity, field_name, cut_off=True) - + # Get contour values for the range surfaces = get_contours(scalar_range, nb_surfaces) @@ -2072,9 +2072,9 @@ def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, # Set display properties if (is_colored): - isosurfaces.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(isosurfaces, (EntityType.get_pvtype(entity), field_name)) else: - isosurfaces.ColorArrayName = (None, '') + pvs.ColorBy(isosurfaces, (EntityType.get_pvtype(entity), None)) if color: isosurfaces.DiffuseColor = color isosurfaces.LookupTable = lookup_table @@ -2201,9 +2201,9 @@ def GaussPointsOnField(proxy, entity, field_name, # Set display properties if is_colored: - gausspnt.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), field_name)) else: - gausspnt.ColorArrayName = (None, '') + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), None)) if color: gausspnt.DiffuseColor = color @@ -2339,9 +2339,9 @@ def GaussPointsOnField1(proxy, entity, field_name, # Set display properties if is_colored: - gausspnt.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), field_name)) else: - gausspnt.ColorArrayName = (None, '') + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), None)) if color: gausspnt.DiffuseColor = color @@ -2499,9 +2499,9 @@ def StreamLinesOnField(proxy, entity, field_name, timestamp_nb, # Set properties if is_colored: - streamlines.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(streamlines, (EntityType.get_pvtype(entity), field_name)) else: - streamlines.ColorArrayName = (None, '') + pvs.ColorBy(streamlines, (EntityType.get_pvtype(entity), None)) if color: streamlines.DiffuseColor = color @@ -2544,7 +2544,7 @@ def MeshOnEntity(proxy, mesh_name, entity): proxy.GetDataInformation().GetNumberOfCells()): my_view = pvs.GetRenderView() prs = pvs.GetRepresentation(proxy, view=my_view) - prs.ColorArrayName = (None, '') + pvs.ColorBy(prs, (EntityType.get_pvtype(entity), None)) return prs @@ -2583,7 +2583,7 @@ def MeshOnGroup(proxy, extrGroups, group_name): if nb_points or nb_cells: # prs = pvs.GetRepresentation(proxy) prs = pvs.Show() - prs.ColorArrayName = '' + prs.ColorArrayName = (None, '') display_only(prs) return prs diff --git a/test/VisuPrs/dump_study/A0.py b/test/VisuPrs/dump_study/A0.py index 762f28c7..55a1c7e8 100644 --- a/test/VisuPrs/dump_study/A0.py +++ b/test/VisuPrs/dump_study/A0.py @@ -44,6 +44,8 @@ if med_reader is None : med_field = "vitesse" scalarmap = ScalarMapOnField(med_reader, EntityType.NODE, med_field, 1) +scalarmap.Visibility = 1 +scalarmap.SetScalarBarVisibility(GetActiveView(),1) # apply settings scalarmap.Position = settings["Offset"] @@ -60,8 +62,9 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] -text = smtrace.stop_trace() + # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "ScalarMap.py") save_trace( path_to_save, text ) @@ -74,8 +77,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_scalarmap = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_scalarmap = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A1.py b/test/VisuPrs/dump_study/A1.py index e0ef96d7..2123c74f 100644 --- a/test/VisuPrs/dump_study/A1.py +++ b/test/VisuPrs/dump_study/A1.py @@ -23,6 +23,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + + settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "NbSurfaces": 444} # 1. TimeStamps.med import @@ -36,6 +45,8 @@ if med_reader is None : med_field = "vitesse" isosurfaces = IsoSurfacesOnField(med_reader, EntityType.NODE, med_field, 1) +isosurfaces.Visibility = 1 +isosurfaces.SetScalarBarVisibility(GetActiveView(),1) # apply settings isosurfaces.Position = settings["Offset"] @@ -59,8 +70,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "IsoSurfaces.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(isosurfaces) @@ -71,8 +83,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_isosurfaces = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_isosurfaces = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A2.py b/test/VisuPrs/dump_study/A2.py index b996b2e5..9ec74067 100644 --- a/test/VisuPrs/dump_study/A2.py +++ b/test/VisuPrs/dump_study/A2.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal'} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "vitesse" cutplanes = CutPlanesOnField(med_reader, EntityType.NODE, med_field, 1) +cutplanes.Visibility = 1 +cutplanes.SetScalarBarVisibility(GetActiveView(),1) # apply settings cutplanes.Position = settings["Offset"] @@ -60,8 +70,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "CutPlanes.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(cutplanes) @@ -72,8 +83,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_cutplanes = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_cutplanes = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A3.py b/test/VisuPrs/dump_study/A3.py index 2e3cfa3e..1d43ea55 100644 --- a/test/VisuPrs/dump_study/A3.py +++ b/test/VisuPrs/dump_study/A3.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorArray": "", "ColorComponents": [0.111, 0.222, 0.333]} @@ -35,7 +43,9 @@ if med_reader is None : # 2. DeformedShape creation med_field = "vitesse" -deformedshape = DeformedShapeOnField(med_reader, EntityType.NODE, med_field, 1) +deformedshape = DeformedShapeOnField(med_reader, EntityType.NODE, med_field, 1, None, True) +deformedshape.Visibility = 1 +deformedshape.SetScalarBarVisibility(GetActiveView(),1) # apply settings deformedshape.Position = settings["Offset"] @@ -57,8 +67,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "DeformedShape.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(deformedshape) @@ -69,8 +80,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_deformedshape = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_deformedshape = view.Representations[0] errors = 0 tolerance = 1e-05 @@ -159,8 +170,8 @@ if abs(scale - settings["Scale"]) > tolerance: # Color array name array_name = recreated_deformedshape.ColorArrayName[1] -if array_name != settings["ColorArray"]: - print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", settings["arrayName"] +if array_name != med_field: + print "ERROR!!! Color array name of presentation is incorrect: ", array_name , " instead of ", med_field errors += 1 # Color diff --git a/test/VisuPrs/dump_study/A4.py b/test/VisuPrs/dump_study/A4.py index ce566bb4..f725439b 100644 --- a/test/VisuPrs/dump_study/A4.py +++ b/test/VisuPrs/dump_study/A4.py @@ -22,6 +22,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 1), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation"} @@ -36,6 +45,8 @@ if med_reader is None : med_field = "pression" gausspoints = GaussPointsOnField(med_reader, EntityType.CELL, med_field, 1) +gausspoints.Visibility = 1 +gausspoints.SetScalarBarVisibility(GetActiveView(),1) # apply settings gausspoints.Position = settings["Offset"] @@ -51,8 +62,9 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "GaussPoints.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(gausspoints) @@ -63,8 +75,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_gausspoints = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_gausspoints = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A5.py b/test/VisuPrs/dump_study/A5.py index 4a6583af..391dd504 100644 --- a/test/VisuPrs/dump_study/A5.py +++ b/test/VisuPrs/dump_study/A5.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "ScaleFactor": 0.25, "NbContours": 4} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "VITESSE" plot3d = Plot3DOnField(med_reader, EntityType.NODE, med_field, 1, is_contour=True) +plot3d.Visibility = 1 +plot3d.SetScalarBarVisibility(GetActiveView(),1) # apply settings plot3d.Position = settings["Offset"] @@ -68,8 +78,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "Plot3D.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(plot3d) @@ -80,8 +91,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_plot3d = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_plot3d = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A6.py b/test/VisuPrs/dump_study/A6.py index 7a024830..81c89b6a 100644 --- a/test/VisuPrs/dump_study/A6.py +++ b/test/VisuPrs/dump_study/A6.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.12929} @@ -36,6 +44,8 @@ if med_reader is None: med_field = "vitesse" prs = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, med_field, 1) +prs.Visibility = 1 +prs.SetScalarBarVisibility(GetActiveView(),1) # apply settings prs.Position = settings["Offset"] @@ -57,8 +67,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "ScalarMapOnDeformedShape.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(prs) @@ -69,8 +80,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_prs = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_prs = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A8.py b/test/VisuPrs/dump_study/A8.py index 32a28fd1..f45e9f96 100644 --- a/test/VisuPrs/dump_study/A8.py +++ b/test/VisuPrs/dump_study/A8.py @@ -22,8 +22,17 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace -settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorArray": "", "ColorComponents": [0.111, 0.222, 0.333], "LineWidth": 2, "GlyphType": 'Cone', "GlyphPos": [-0.5, 0.0, 0.0]} +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + + +settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorComponents": [0.111, 0.222, 0.333], "LineWidth": 2, "GlyphType": 'Cone', "GlyphPos": [-0.5, 0.0, 0.0]} # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" @@ -35,7 +44,9 @@ if med_reader is None : # 2. Vectors creation med_field = "vitesse" -vectors = VectorsOnField(med_reader, EntityType.NODE, med_field, 1) +vectors = VectorsOnField(med_reader, EntityType.NODE, med_field, 1,is_colored=True) +vectors.Visibility = 1 +vectors.SetScalarBarVisibility(GetActiveView(),1) # apply settings vectors.Position = settings["Offset"] @@ -45,8 +56,7 @@ vectors.LookupTable.Discretize = settings["Discretize"] vectors.LookupTable.NumberOfTableValues = settings["NbColors"] vectors.LookupTable.UseLogScale = settings["UseLogScale"] -vectors.Input.SetScaleFactor = settings["Scale"] -vectors.ColorArrayName = (None, '') +vectors.Input.ScaleFactor = settings["Scale"] vectors.AmbientColor = settings["ColorComponents"] vectors.LineWidth = settings["LineWidth"] @@ -63,8 +73,9 @@ bar.Orientation = settings["Orientation"] cone_glyth_type = type(vectors.Input.GlyphType) # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "Vectors.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(vectors) @@ -75,8 +86,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_vectors = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_vectors = view.Representations[0] errors = 0 tolerance = 1e-05 @@ -158,15 +169,15 @@ if orientation != settings["Orientation"]: errors += 1 # Scale factor -scale = recreated_vectors.Input.SetScaleFactor +scale = recreated_vectors.Input.ScaleFactor if abs(scale - settings["Scale"]) > tolerance: print "ERROR!!! Scale of presentation is incorrect: ", scale, " instead of ", settings["Scale"] errors += 1 # Color array name array_name = recreated_vectors.ColorArrayName[1] -if array_name != settings["ColorArray"]: - print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", settings["arrayName"] +if array_name != med_field: + print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", med_field errors += 1 # Color diff --git a/test/VisuPrs/dump_study/B0.py b/test/VisuPrs/dump_study/B0.py index 61f7aaf5..714ee9b8 100644 --- a/test/VisuPrs/dump_study/B0.py +++ b/test/VisuPrs/dump_study/B0.py @@ -22,6 +22,14 @@ from paravistest import datadir from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" @@ -57,8 +65,9 @@ for name in prs_names: prs_list.append(prs) # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "AllPresentations.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view source_list = GetSources().values() diff --git a/test/VisuPrs/dump_study/B3.py b/test/VisuPrs/dump_study/B3.py index 5269eff4..cee60c69 100644 --- a/test/VisuPrs/dump_study/B3.py +++ b/test/VisuPrs/dump_study/B3.py @@ -22,6 +22,12 @@ import paravistest from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) # 1. Table creation title = "My Table" @@ -69,8 +75,9 @@ table.UpdatePipeline() orig_script = table.Script # 2. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "table.py") -SaveTrace(path_to_save) +save_trace( path_to_save, text ) # 3. Delete the table Delete(table) diff --git a/test/VisuPrs/dump_study/B4.py b/test/VisuPrs/dump_study/B4.py index 80556bd5..d964d250 100644 --- a/test/VisuPrs/dump_study/B4.py +++ b/test/VisuPrs/dump_study/B4.py @@ -22,6 +22,13 @@ import paravistest from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + # 1. Table creation title = "My Table" @@ -69,8 +76,9 @@ table.UpdatePipeline() orig_script = table.Script # 2. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "table.py") -SaveTrace(path_to_save) +save_trace( path_to_save, text ) # 3. Delete the table Delete(table) diff --git a/test/VisuPrs/dump_study/CMakeLists.txt b/test/VisuPrs/dump_study/CMakeLists.txt index f5316281..90aa0dcd 100644 --- a/test/VisuPrs/dump_study/CMakeLists.txt +++ b/test/VisuPrs/dump_study/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(BASE_TESTS A0 B0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B3 B4 B5) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B3 B4 B5) # For make test IF(SALOME_PARAVIS_ALL_TEST) -- 2.39.2