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
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
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
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
# 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
# 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
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
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
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)
# 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
# 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
# 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
# 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
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
if nb_points or nb_cells:
# prs = pvs.GetRepresentation(proxy)
prs = pvs.Show()
- prs.ColorArrayName = ''
+ prs.ColorArrayName = (None, '')
display_only(prs)
return prs
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"]
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 )
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
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
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"]
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)
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
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'}
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"]
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)
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
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]}
# 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"]
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)
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
# 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
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"}
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"]
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)
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
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}
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"]
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)
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
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}
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"]
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)
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
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"
# 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"]
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"]
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)
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
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
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"
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()
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"
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)
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"
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)
#
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)