# trace generated using paraview version 5.6.0
#
# To ensure correct image size when batch processing, please search 
# for and uncomment the line `# renderView*.ViewSize = [*,*]`

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'XML Partitioned Unstructured Grid Reader'
cube_projectilet0005pvtu = XMLPartitionedUnstructuredGridReader(FileName=['./cube_projectile-t0005.pvtu'])

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [600, 600]

# show data in view
cube_projectilet0005pvtuDisplay = Show(cube_projectilet0005pvtu, renderView1)

# trace defaults for the display properties.
cube_projectilet0005pvtuDisplay.Representation = 'Surface'

# reset view to fit data
renderView1.ResetCamera()

# update the view to ensure updated data information
renderView1.Update()

# set scalar coloring
ColorBy(cube_projectilet0005pvtuDisplay, ('CELLS', 'rho'))

# rescale color and/or opacity maps used to include current data range
cube_projectilet0005pvtuDisplay.RescaleTransferFunctionToDataRange(True, False)

# show color bar/color legend
cube_projectilet0005pvtuDisplay.SetScalarBarVisibility(renderView1, True)

# get color transfer function/color map for 'rho'
rhoLUT = GetColorTransferFunction('rho')
rhoLUT.RGBPoints = [0.00016101374058052897, 0.231373, 0.298039, 0.752941, 0.13440489358617924, 0.865003, 0.865003, 0.865003, 0.26864877343177795, 0.705882, 0.0156863, 0.14902]
rhoLUT.ScalarRangeInitialized = 1.0

# get opacity transfer function/opacity map for 'rho'
rhoPWF = GetOpacityTransferFunction('rho')
rhoPWF.Points = [0.00016101374058052897, 0.0, 0.5, 0.0, 0.26864877343177795, 1.0, 0.5, 0.0]
rhoPWF.ScalarRangeInitialized = 1

# current camera placement for renderView1
renderView1.CameraPosition = [0.0, -0.019164588302373886, 0.6022873001371709]
renderView1.CameraFocalPoint = [0.0, -0.019164588302373886, 0.0]
renderView1.CameraParallelScale = 0.15588342389887788

# save screenshot
SaveScreenshot('trace_screenshot.jpeg', renderView1, ImageResolution=[600, 600])
