From: rnv Date: Tue, 15 Mar 2016 13:35:40 +0000 (+0300) Subject: One more update of ParaVis tests: X-Git-Tag: V8_1_0a1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=666cd82d27c6bbb1e378bef0728d576cab3c612e;p=modules%2Fparavis.git One more update of ParaVis tests: 1) Remove bugs/C7.py (because it is uses currupted Bug583-Quadratique.resu.med file) 2) Update dump_study/A7.py and dump_study/A9.py tests. --- diff --git a/test/VisuPrs/bugs/C7.py b/test/VisuPrs/bugs/C7.py deleted file mode 100644 index b0b9f786..00000000 --- a/test/VisuPrs/bugs/C7.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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, 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 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/bugs2/C7 case - -import os -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/C7") - -# 1. Import MED file -med_file_path = datadir + "Bug583-Quadratique.resu.med" - -print 'Importing "Bug583-Quadratique.resu.med"....', -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - raise RuntimeError, "File wasn't imported!!!" -else: - print "OK" - -# 2. Creation of GaussPoints presentations -mesh_name = "MAIL" -field_names = ["RESU_EQUI_ELNO_SIGM", "RESU_SIEF_ELGA_DEPL", "RESU_SIEF_ELNO_ELGA", "RESU_SIGM_ELNO_DEPL"] - -view = pvsimple.GetRenderView() - -print "BREAKPOINT_1" -error = 0 - -for field in field_names: - print "Creation of the GaussPoints presentation.. Field: ", field, "; Iteration: 1" - presentation = GaussPointsOnField1(med_reader, EntityType.CELL, field, 1) - if presentation is None: - print "ERROR!!! GaussPoints presentation wasn't created for the ", field, " field!!!" - error += 1 - else: - pic_path = os.path.join(picturedir, "GaussPoints_" + mesh_name + "_" + field + "." + pictureext) - process_prs_for_test(presentation, view, pic_path) - -if not error: - print "BREAKPOINT_2" -else: - raise RuntimeError, "There are some errors were occured... For more info see ERRORs above..." diff --git a/test/VisuPrs/bugs/CMakeLists.txt b/test/VisuPrs/bugs/CMakeLists.txt index 2a0c0907..d50fc8a7 100644 --- a/test/VisuPrs/bugs/CMakeLists.txt +++ b/test/VisuPrs/bugs/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(BASE_TESTS A0 B1 C3 D0 E0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C5 C6 C7 C9 +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C5 C6 C9 D1 D3 D6 D7 E0) # For make test diff --git a/test/VisuPrs/dump_study/A7.py b/test/VisuPrs/dump_study/A7.py index 65dc0bc9..b35347eb 100644 --- a/test/VisuPrs/dump_study/A7.py +++ b/test/VisuPrs/dump_study/A7.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) + # StreamLines settings settings = {'name': 'myStreamLines', @@ -74,8 +83,9 @@ stream.SeedType.NumberOfPoints = settings['SeedType.NumberOfPoints'] stream.SeedType.Radius = settings['SeedType.Radius'] # 4. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "StreamLines.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects delete_with_inputs(stream) diff --git a/test/VisuPrs/dump_study/A9.py b/test/VisuPrs/dump_study/A9.py index e14157f7..d543b120 100644 --- a/test/VisuPrs/dump_study/A9.py +++ b/test/VisuPrs/dump_study/A9.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', "Orientation_BasePlane": [Orientation.ZX, 22, 33], "Orientation_CuttingPlanes": [Orientation.YZ, 44, 55], "Displacement": 0.1, "Displacement2": 0.2, "BasePlane_Position": 0.1, "NbLines": 3} @@ -46,6 +54,9 @@ d1 = settings["Displacement"] d2 = settings["Displacement2"] cutlines = CutLinesOnField(med_reader, EntityType.NODE, med_field, 1, nb_lines, orient1, base_ang1, base_ang2, orient2, cut_ang1, cut_ang2, d1, d2) +cutlines.Visibility = 1 +cutlines.SetScalarBarVisibility(GetActiveView(),1) + # apply settings cutlines.Position = settings["Offset"] @@ -70,8 +81,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"), "CutLines.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(cutlines)