Salome HOME
One more update of ParaVis tests:
authorrnv <rnv@opencascade.com>
Tue, 15 Mar 2016 13:35:40 +0000 (16:35 +0300)
committerrnv <rnv@opencascade.com>
Tue, 15 Mar 2016 13:45:31 +0000 (16:45 +0300)
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.

test/VisuPrs/bugs/C7.py [deleted file]
test/VisuPrs/bugs/CMakeLists.txt
test/VisuPrs/dump_study/A7.py
test/VisuPrs/dump_study/A9.py

diff --git a/test/VisuPrs/bugs/C7.py b/test/VisuPrs/bugs/C7.py
deleted file mode 100644 (file)
index b0b9f78..0000000
+++ /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..."
index 2a0c0907a428f5a7d6e9d9e704a89c609bd4b958..d50fc8a799a746c9b56b3dde9ec1e36fc233b032 100644 (file)
@@ -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
index 65dc0bc92cdd6e1ae8fd16ca47ab4593c3689e73..b35347eb4b0eeff5757ed6e203ad05af4453d5c3 100644 (file)
 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)
index e14157f7cdc6011bede4845b1b635da4cd3ac740..d543b1203c7a4a4ec1a2666d80b7b899219f1fc1 100644 (file)
 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)