X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=test%2FVisuPrs%2Fdump_study%2FA6.py;h=e5613916c03e1d94ee61a8803f9a29b5ab3c124a;hb=937b15c6a43ec7efea52bd90272e2e35d89ab37b;hp=eeda64aa5d7541fa1b0f1205e459180df90f0cf3;hpb=f284847a1f9ec2519639285396adf10a84903eea;p=modules%2Fparavis.git diff --git a/test/VisuPrs/dump_study/A6.py b/test/VisuPrs/dump_study/A6.py index eeda64aa..e5613916 100644 --- a/test/VisuPrs/dump_study/A6.py +++ b/test/VisuPrs/dump_study/A6.py @@ -1,9 +1,9 @@ -# Copyright (C) 2010-2013 CEA/DEN, EDF R&D +# Copyright (C) 2010-2016 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 @@ -21,16 +21,21 @@ from paravistest import datadir, delete_with_inputs from presentations import * -import paravis from pvsimple import * +from paravistest import save_trace +from paraview import smtrace -my_paravis = paravis.myParavis +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} # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" -my_paravis.ImportFile(file_path) +OpenDataFile(file_path) med_reader = GetActiveSource() if med_reader is None: raise RuntimeError, "TimeStamps.med wasn't imported..." @@ -39,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"] @@ -60,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) @@ -72,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 @@ -165,7 +173,7 @@ if abs(cur_range_min - range_min) > tolerance: if abs(cur_range_max - range_max) > tolerance: print "ERROR!!! Maximum value of range of presentation is incorrect: ", cur_range_max, " instead of ", range_max errors += 1 - + # Scale factor scale = recreated_prs.Input.ScaleFactor if abs(scale - settings["Scale"]) > tolerance: