To render VTK objects in top of default ones, like vtkPolyData, vtkUnstructuredGrid, etc., you need to get both the active view and then the respective renderer to attach a VTK actor to that display or viewport. To do so we often rely on the “simple” module, for instance:
Sample helper class.
class ParaviewHelper:
@staticmethod
def GetActiveOrRenderView():
from paraview.simple import GetActiveView, GetRenderView
# Empty once loaded from session file?
active_view = GetActiveView()
if active_view != None:
return active_view
# Empty once loaded from session file?
return GetRenderView()
@staticmethod
def GetActiveRenderer():
active_view = GPParaviewHelper.GetActiveOrRenderView()
return active_view.GetRenderer() if active_view != None else None
We need to create a VTK actor to render “names” (strings) in 3-D as texture mappings via well-know mapper approach. However, it is illegal to call the “paraview.simple” module on a server, i.e., distributed plugin, because Paraview crashes. It seems that such API is not available on the server side. That said, I wonder how can I get the renderer from the plugin slot “RequestData” or executive object. Any hints about how this feature can be accomplished?
Thanks in advance,
Horacio Florez.