The Paraview slice handles are not shown in Trame view-port! #775
-
|
Hello guys. def open_pvd_file_paraview(path: str):
with server.state:
server.reader = pvs.PVDReader(FileName=path)
server.surface = pvs.Show(proxy=server.reader)
# server.surface.Representation = server.state.representation
server.surface.SetRepresentationType(server.state.representation)
point_contour_names = [array.Name for array in server.reader.PointData]
server.state.contour_list = point_contour_names
server.state.contour = point_contour_names[0]
server.state.timestep_list = [str(timestep) for timestep in pvs.GetAnimationScene().TimeKeeper.TimestepValues]
server.state.timestep = server.state.timestep_list[-1]
slice1 = pvs.Slice(registrationName='Slice1', Input=server.reader)
slice1.SliceType = 'Plane'
slice1.HyperTreeGridSlicer = 'Plane'
slice1.UseDual = 0
slice1.Crinkleslice = 0
slice1.Triangulatetheslice = 1
slice1.SliceOffsetValues = [0.0]
slice1.PointMergeMethod = 'Uniform Binning'
renderView1 = pvs.GetActiveViewOrCreate('RenderView')
slice1Display = pvs.Show(slice1, renderView1, 'GeometryRepresentation')
pvs.SetActiveSource(slice1)
active = pvs.GetActiveSource()
pvs.ShowInteractiveWidgets(slice1Display)
server.controller.view_update()I use VtkRemoteLocalView for showing stuff as follows: html_view = paraview.VtkRemoteLocalView(pvs.GetActiveViewOrCreate("RenderView"), namespace="view")
server.controller.view_update = html_view.update
server.controller.view_update_geometry = html_view.update_geometry
server.controller.view_update_image = html_view.update_image
server.controller.view_reset_camera = html_view.reset_cameraMy problem is that in Paraview the handles of the slice tool are shown with no problem, meanwhile in Trame I can't see the handles of the slice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
3D widgets are not exposed in ParaView from the Python API. The actual code for toggling those rely on the Qt layer and therefore is missing in pure python execution like trame. But this is something we are thinking of cleaning up in ParaView. |
Beta Was this translation helpful? Give feedback.
Thanks a lot, dear @jourdain.
I managed to use vtkImplicitPlaneWidget2 to create and show a 3D widget in the Trame viewport.