Open jourdain opened 6 years ago
@jourdain - What are the differences between RemoteRenderer
and VtkRenderer
Is is to use self.getApplication().InvokeEvent('UpdateEvent')
The RemoteRenderer was the first implementation where the client request each image while the VtkRenderer expect a push from the server.
Great!
Apart from above, I had to add self.registerVtkWebProtocol(pv_protocols.ParaViewWebPublishImageDelivery(decode=False))
It works great with realtime push from backend without a page refresh to see updated image
@nodeCodeNinja : do you have a complete example of the changes you made to make realtime pushes work?
Instead of using
npm start
, you can serve the content ofwww
by adding--content /path/to/www
to the pvpython command line.Moreover, since the content will be served from the paraview http server the endpoint/sessionURL can be automatically guessed so the
config
can be empty when given to the smart connect.Inside your package.json, since you added
kw-web-suite
you don't need any build tools such as webpack askw-web-suite
aims to be similar toapt-get install build-essential
for linux. So your devDependencies could only containskw-web-suite
.You should replace
import RemoteRenderer from 'paraviewweb/src/NativeUI/Canvas/RemoteRenderer';
withimport VtkRenderer from 'paraviewweb/src/NativeUI/Renderers/VtkRenderer';
But for that you will have to:
VtkImageDelivery
const renderer = VtkRenderer.newInstance({ client: model.pvwClient });
onImageReady
methodself.getApplication().InvokeEvent('UpdateEvent')
call each time you want the client to have a new rendered image.