Skip to content

Commit

Permalink
Update coloredSphere.py
Browse files Browse the repository at this point in the history
use integer tuple comparison
  • Loading branch information
jfavre authored Apr 15, 2024
1 parent bdfba76 commit 291c284
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions checks/apps/paraview/src/coloredSphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
if basename is None:
basename = "/tmp"

Version = (str(servermanager.vtkSMProxyManager.GetVersionMajor()) + "." +
str(servermanager.vtkSMProxyManager.GetVersionMinor()))
Version = (servermanager.vtkSMProxyManager.GetVersionMajor(),
servermanager.vtkSMProxyManager.GetVersionMinor(),
servermanager.vtkSMProxyManager.GetVersionPatch())

info = vtkPVOpenGLInformation()
info.CopyFromObject(None)
Expand Down Expand Up @@ -49,19 +50,19 @@
sphere.ThetaResolution = 1024
sphere.PhiResolution = 1024

if Version == '5.12.0':
pidscal = GenerateProcessIds(Input=sphere)
else:
if Version <= (5, 11, 2):
pidscal = ProcessIdScalars(sphere)
else:
pidscal = GenerateProcessIds(Input=sphere)

rep = Show(pidscal, view)

if Version == '5.12.0':
ColorBy(rep, ('POINTS', 'PointProcessIds'))
processIdLUT = GetColorTransferFunction('PointProcessIds')
else:
if Version <= (5, 11, 2):
ColorBy(rep, 'ProcessId')
processIdLUT = GetColorTransferFunction('ProcessId')
else:
ColorBy(rep, ('POINTS', 'PointProcessIds'))
processIdLUT = GetColorTransferFunction('PointProcessIds')

processIdLUT.AnnotationsInitialized = 1
processIdLUT.InterpretValuesAsCategories = 1
Expand Down Expand Up @@ -104,6 +105,7 @@
view.ViewSize = [1024, 1024]

# change the pathname to a place where you have write access
filename = basename + "/coloredSphere_v" + Version + "." + Vendor + ".png"
SourceVersion = servermanager.vtkSMProxyManager.GetParaViewSourceVersion()
filename = basename + "/coloredSphere_v" + SourceVersion.split()[-1] + "." + Vendor + ".png"
SaveScreenshot(filename=filename, view=view)
print("writing ", filename)

0 comments on commit 291c284

Please sign in to comment.