]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Paraview 5.4: ScalarBar no longer have Position2 and NumberOfLabels attributes gdd/python3_dev_pv5.4
authorGilles DAVID <gilles-g.david@edf.fr>
Wed, 7 Jun 2017 09:08:10 +0000 (11:08 +0200)
committerGilles DAVID <gilles-g.david@edf.fr>
Wed, 7 Jun 2017 09:08:10 +0000 (11:08 +0200)
15 files changed:
test/VisuPrs/SWIG_scripts/A1.py
test/VisuPrs/ScalarMap/B3.py
test/VisuPrs/ScalarMap_On_DeformedShape/B3.py
test/VisuPrs/dump_study/A0.py
test/VisuPrs/dump_study/A1.py
test/VisuPrs/dump_study/A2.py
test/VisuPrs/dump_study/A3.py
test/VisuPrs/dump_study/A4.py
test/VisuPrs/dump_study/A5.py
test/VisuPrs/dump_study/A6.py
test/VisuPrs/dump_study/A8.py
test/VisuPrs/dump_study/A9.py
test/VisuPrs/imps/A3.py
test/VisuPrs/united/A1.py
test/VisuPrs/united/B0.py

index 8ffbd28c43ab7bff076ced6d58650206af1ad177..1dadfe77f17fb7dd6419cbcdeca5aa2d8e3fbc03 100644 (file)
@@ -60,7 +60,7 @@ else:
     bar = get_bar()
     bar.Orientation = 'Horizontal'
     bar.Position = [0.1, 0.1]
-    bar.Position2 = [0.1, 0.25]
+    #bar.Position2 = [0.1, 0.25]
     bar.AspectRatio = 3
 
     display_only(scalarmap, view)
index 02c8b16edb6283e109c8566e1bf70b023ac4b313..52d3cf74f1cfb8380f8deaad47c50facaaa14515 100644 (file)
@@ -110,19 +110,21 @@ bar.Position = [-1, -1]
 print("Position =", bar.Position)
 
 # 8. Size of scalar bar
-print("Default Height=", bar.Position2[1],"  :  Width=", bar.Position2[0])
+print("Default Length=", bar.ScalarBarLength,"  :  Thickness=", bar.ScalarBarThickness)
 
 print("Set positive Height and Width")
 h = 0.4
-w = 0.2
-bar.Position2 = [w, h]
-print("Size =", bar.Position2)
+w = 0.2 * 600 * 0.4
+bar.ScalarBarLength = h
+bar.ScalarBarThickness = int(w)
+print("Length=", bar.ScalarBarLength,"  :  Thickness=", bar.ScalarBarThickness)
 
 print("Set negative Height and Width")
 h = -0.4
-w = -0.2
-bar.Position2 = [w, h]
-print("Size =", bar.Position2)
+w = -0.2 * 600 * 0.4
+bar.ScalarBarLength = h
+bar.ScalarBarThickness = int(w)
+print("Length=", bar.ScalarBarLength,"  :  Thickness=", bar.ScalarBarThickness)
 
 # 9. Number of colors
 print("Default number of colors = ", scalarmap.LookupTable.NumberOfTableValues)
@@ -144,23 +146,25 @@ nb_colors = 256
 scalarmap.LookupTable.NumberOfTableValues = nb_colors
 print("Number of colors =", scalarmap.LookupTable.NumberOfTableValues)
 
+# NumberOfLabels no longer exists since Paraview 5.4
+
 # 10. Number of labels
-print("Default number of labels = ", bar.NumberOfLabels)
-
-print("Set negative number of labels")
-nb_labels = -10
-bar.NumberOfLabels = nb_labels
-print("Number of labels=", bar.NumberOfLabels)
-
-print("Set zero number of labels")
-nb_labels = 0
-bar.NumberOfLabels = nb_labels
-print("Number of labels=", bar.NumberOfLabels)
-
-print("Set positive number of labels")
-nb_labels = 10
-bar.NumberOfLabels = nb_labels
-print("Number of labels=", bar.NumberOfLabels)
+print("Default number of labels = ", bar.NumberOfLabels)
+
+#print("Set negative number of labels")
+#nb_labels = -10
+#bar.NumberOfLabels = nb_labels
+#print("Number of labels=", bar.NumberOfLabels)
+
+#print("Set zero number of labels")
+#nb_labels = 0
+#bar.NumberOfLabels = nb_labels
+#print("Number of labels=", bar.NumberOfLabels)
+
+#print("Set positive number of labels")
+#nb_labels = 10
+#bar.NumberOfLabels = nb_labels
+#print("Number of labels=", bar.NumberOfLabels)
 
 # 11. Scalar bar title
 print('Default Title ="', bar.Title, '"')
index 05d205b76eb5a53a363337af6043f7f99bbdddb2..317c40d53530554da0c28b86cfbb0dc388b63d2e 100644 (file)
@@ -150,18 +150,19 @@ pvsimple.Render(view)
 
 #============Stage8: bar size of Scalar Map On Deformed Shape===========
 print("Changing bar size:")
-print("Default [width, height]: ", bar.Position2)
+print("Default ScalarBarLength: ", bar.ScalarBarLength)
+print("Default ScalarBarThickness: ", bar.ScalarBarThickness)
 
-print("Set height = height*1.2")
-height = bar.Position2[1] * 1.2
-bar.Position2[1] = height
-print("Bar [width, height]: ", bar.Position2)
+print("Set length = length*1.2")
+length = bar.ScalarBarLength * 1.2
+bar.ScalarBarLength = length
+print("Bar length: ", bar.ScalarBarLength)
 pvsimple.Render(view)
 
-print("Set width = width*2")
-width = bar.Position2[0] * 2
-bar.Position2[0] = width
-print("Bar [width, height]: ", bar.Position2)
+print("Set thickness = thickness*2")
+thickness = bar.ScalarBarThickness * 2
+bar.ScalarBarThickness = thickness
+print("Bar thickness: ", bar.ScalarBarThickness)
 pvsimple.Render(view)
 
 #=============Stage9: nb of colors of Scalar Map On Deformed Shape======
@@ -187,27 +188,28 @@ lt.NumberOfTableValues = num
 print("Number of colors: ", lt.NumberOfTableValues)
 pvsimple.Render(view)
 
+# NumberOfLabels no longer exists in Paraview 5.4
 #=============Stage10: nb of labels of Scalar Map On Deformed Shape=====
-print("Changing number of labels:")
-print("Default number of labels: ", bar.NumberOfLabels)
+#print("Changing number of labels:")
+#print("Default number of labels: ", bar.NumberOfLabels)
 
-print("Set negative number of labels")
-num = -128
-bar.NumberOfLabels = num
-print("Number of labels: ", bar.NumberOfLabels)
-pvsimple.Render(view)
+#print("Set negative number of labels")
+#num = -128
+#bar.NumberOfLabels = num
+#print("Number of labels: ", bar.NumberOfLabels)
+#pvsimple.Render(view)
 
-print("Set zero number of labels")
-num = 0
-bar.NumberOfLabels = num
-print("Number of labels: ", bar.NumberOfLabels)
-pvsimple.Render(view)
+#print("Set zero number of labels")
+#num = 0
+#bar.NumberOfLabels = num
+#print("Number of labels: ", bar.NumberOfLabels)
+#pvsimple.Render(view)
 
-print("Set positive number of labels")
-num = 256
-bar.NumberOfLabels = num
-print("Number of labels: ", bar.NumberOfLabels)
-pvsimple.Render(view)
+#print("Set positive number of labels")
+#num = 256
+#bar.NumberOfLabels = num
+#print("Number of labels: ", bar.NumberOfLabels)
+#pvsimple.Render(view)
 
 #=============Stage11: bar title of Scalar Map On Deformed Shape=========
 print("Changing bar title:")
index f2cebabcf40db8591dde338fd9b8cedaf88cd565..f4d55a2f781d229fc48e6af636db72edaee7ffee 100644 (file)
@@ -57,8 +57,8 @@ scalarmap.LookupTable.UseLogScale = settings["UseLogScale"]
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -113,15 +113,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_scalarmap.LookupTable.Discretize
@@ -136,10 +136,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 82449db71e28a9df757f02bb695ba85c82cb7dda..33608150cd9193d1741645b6826d6403e71ff255 100644 (file)
@@ -64,8 +64,8 @@ contour_filter.Isosurfaces = surfaces
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -119,15 +119,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_isosurfaces.LookupTable.Discretize
@@ -142,10 +142,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 20e3cdbb0e9553990a619da9a0efe3ac8176ecdb..fcaea04654a92ae26d60b0ae8fbead79620a20fa 100644 (file)
@@ -64,8 +64,8 @@ cutplanes.Input.SliceOffsetValues = pos
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -119,15 +119,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_cutplanes.LookupTable.Discretize
@@ -142,10 +142,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 808c9ea63f488643b92f2c5cc9743b4679d47a83..1555c186f599255100048dc956579378978228f3 100644 (file)
@@ -61,8 +61,8 @@ deformedshape.AmbientColor = settings["ColorComponents"]
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -116,15 +116,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_deformedshape.LookupTable.Discretize
@@ -139,10 +139,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 5ed08d0be3ef906fc4e5a120b2f20f8c39b9061a..73aaf0fa1ce074d9cf40cb5c1b67f776947586f0 100644 (file)
@@ -57,8 +57,8 @@ gausspoints.LookupTable.NumberOfTableValues = settings["NbColors"]
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 
 # 3. Dump Study
@@ -111,15 +111,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_gausspoints.LookupTable.Discretize
@@ -134,10 +134,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 1d571c5b2395a42f03b212ec8a698dd52bcf41c0..0553aa9265066961a95c9e6821e20664c335ddaf 100644 (file)
@@ -72,8 +72,8 @@ contour_filter.Isosurfaces = surfaces
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -127,15 +127,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_plot3d.LookupTable.Discretize
@@ -150,10 +150,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 44c5ac3ae19a52824d355d9eb655d253c6d2de6f..0e939f58ddef8c762ee693b19e26862c62eb779d 100644 (file)
@@ -61,8 +61,8 @@ range_max = prs.LookupTable.RGBPoints[4]
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -116,15 +116,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_prs.LookupTable.Discretize
@@ -139,10 +139,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index 411f11ef053547bf9ba6e0f3eb3f35b9df8e153e..f1c1c0e02b44238dea08d8422cb56706fc5ebba8 100644 (file)
@@ -65,8 +65,8 @@ vectors.Input.GlyphType.Center = settings["GlyphPos"]
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -122,15 +122,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_vectors.LookupTable.Discretize
@@ -145,10 +145,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index e05318c2ae15fa2cb79002284720f4c9c99aa17d..fdfa65b8e4c83281b01b8f570632bd2b3e39613f 100644 (file)
@@ -75,8 +75,8 @@ pos2 = list(cutlines.Input.SliceOffsetValues)
 
 bar = get_bar()
 bar.Position = settings["Position"]
-bar.Position2 = settings["Size"]
-bar.NumberOfLabels = settings["NbLabels"]
+#bar.Position2 = settings["Size"]
+#bar.NumberOfLabels = settings["NbLabels"]
 bar.Title = settings["Title"]
 bar.Orientation = settings["Orientation"]
 
@@ -130,15 +130,15 @@ if abs(pos_y - settings["Position"][1]) > tolerance:
     errors += 1
 
 # Size of scalar bar
-width  = recreated_bar.Position2[0]
-height = recreated_bar.Position2[1]
+#width  = recreated_bar.Position2[0]
+#height = recreated_bar.Position2[1]
 
-if abs(width - settings["Size"][0]) > tolerance:
-    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
-    errors += 1
-if abs(height - settings["Size"][1]) > tolerance:
-    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
-    errors += 1
+#if abs(width - settings["Size"][0]) > tolerance:
+#    print("ERROR!!! Width of scalar bar is incorrect: ",  width, " instead of ", settings["Size"][0])
+#    errors += 1
+#if abs(height - settings["Size"][1]) > tolerance:
+#    print("ERROR!!! Height of scalar bar is incorrect: ",  height, " instead of ", settings["Size"][1])
+#    errors += 1
 
 # Discretize
 discretize = recreated_cutlines.LookupTable.Discretize
@@ -153,10 +153,10 @@ if nb_colors != settings["NbColors"]:
     errors += 1
 
 # Number of labels
-nb_labels = recreated_bar.NumberOfLabels
-if nb_labels != settings["NbLabels"]:
-    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
-    errors += 1
+#nb_labels = recreated_bar.NumberOfLabels
+#if nb_labels != settings["NbLabels"]:
+#    print("ERROR!!! Number of labels of scalar bar is incorrect: ",  nb_labels, " instead of ", settings["NbLabels"])
+#    errors += 1
 
 # Title
 title = recreated_bar.Title
index f85c4ef96847e98a88dd1180e3f153ff4cc3ca69..9b0545e4b079e230c8b5b645900a37d69d181b65 100644 (file)
@@ -48,7 +48,7 @@ if bar.Orientation != 'Vertical':
    error = error+1
 
 error = error + compare_lists(bar.Position, [0.85, 0.05])
-error = error + compare_lists(bar.Position2, [0.12, 0.43])
+#error = error + compare_lists(bar.Position2, [0.12, 0.43])
 
 if error > 0:
     raise RuntimeError("There is(are) some error(s) was(were) found... For more info see ERRORs above...")
index 3b82286f107c5a48300c49a48f1cd116cc38b956..ba2af940e7c499d68a865e870bf262bb666a3949 100644 (file)
@@ -58,7 +58,7 @@ else:
     bar = get_bar()
     bar.Orientation = 'Horizontal'
     bar.Position = [0.1, 0.1]
-    bar.Position2 = [0.1, 0.25]
+#    bar.Position2 = [0.1, 0.25]
     bar.AspectRatio = 3
 
     display_only(scalarmap, view)
index d6b11f93c41dadf589a594a71e5add1ab0df6dfd..60c4358f7c4d8218dd0881ba6d6c81c6749745b4 100644 (file)
@@ -60,16 +60,17 @@ bar.Position = [0.01, 0.01]
 error = error + compare_lists(bar.Position, [0.01, 0.01])
 
 # Scalar bar size
-bar.Position2 = [0.05, 0.5]
-error = error + compare_lists(bar.Position2, [0.05, 0.5])
+#bar.Position2 = [0.05, 0.5]
+#error = error + compare_lists(bar.Position2, [0.05, 0.5])
 
 # Number of colors and labels
 smondefshape.LookupTable.NumberOfTableValues = 4
-bar.NumberOfLabels = 5
+#bar.NumberOfLabels = 5
 
 nb_colors = smondefshape.LookupTable.NumberOfTableValues
-nb_labels = bar.NumberOfLabels
-error = error + compare_lists([nb_colors, nb_labels], [4, 5])
+#nb_labels = bar.NumberOfLabels
+#error = error + compare_lists([nb_colors, nb_labels], [4, 5])
+error = error + compare_lists([nb_colors], [4])
 
 # Title
 bar.Title = 'Pression, Pa'