Skip to content

Commit

Permalink
Merge pull request #185 from eth-cscs/jfavre-patch-1
Browse files Browse the repository at this point in the history
Update ParaView test coloredSphere.py
  • Loading branch information
teojgo authored Apr 17, 2024
2 parents a044288 + b96d5fd commit 5c403b5
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 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,11 +50,20 @@
sphere.ThetaResolution = 1024
sphere.PhiResolution = 1024

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

rep = Show(pidscal, view)
ColorBy(rep, 'ProcessId')
processIdLUT = GetColorTransferFunction('ProcessId')

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 @@ -95,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 5c403b5

Please sign in to comment.