1
1
# Standard library imports
2
2
import argparse
3
3
import os
4
- import sys
5
4
6
5
# Third party imports
7
6
import vtk
@@ -31,6 +30,17 @@ class _Server(vtk_wslink.ServerProtocol):
31
30
authKey = "wslink-secret"
32
31
view = None
33
32
debug = False
33
+ custom_protocols = []
34
+ mesh_protocols = VtkMeshView ()
35
+ model_protocols = VtkModelView ()
36
+ custom_protocols .append (VtkView ())
37
+ custom_protocols .append (VtkViewerView ())
38
+ custom_protocols .append (mesh_protocols )
39
+ custom_protocols .append (VtkMeshPointsView ())
40
+ custom_protocols .append (VtkMeshEdgesView ())
41
+ custom_protocols .append (VtkMeshPolygonsView ())
42
+ custom_protocols .append (model_protocols )
43
+ custom_protocols .append (VtkGenericView (mesh_protocols , model_protocols ))
34
44
35
45
@staticmethod
36
46
def add_arguments (parser ):
@@ -53,16 +63,9 @@ def initialize(self):
53
63
self .setSharedObject ("db" , dict ())
54
64
55
65
# Custom API
56
- mesh_protocols = VtkMeshView ()
57
- model_protocols = VtkModelView ()
58
- self .registerVtkWebProtocol (VtkView ())
59
- self .registerVtkWebProtocol (VtkViewerView ())
60
- self .registerVtkWebProtocol (mesh_protocols )
61
- self .registerVtkWebProtocol (VtkMeshPointsView ())
62
- self .registerVtkWebProtocol (VtkMeshEdgesView ())
63
- self .registerVtkWebProtocol (VtkMeshPolygonsView ())
64
- self .registerVtkWebProtocol (model_protocols )
65
- self .registerVtkWebProtocol (VtkGenericView (mesh_protocols , model_protocols ))
66
+ print ("Nb protocols" , len (_Server .custom_protocols ))
67
+ for protocol in _Server .custom_protocols :
68
+ self .registerVtkWebProtocol (protocol )
66
69
67
70
# tell the C++ web app to use no encoding.
68
71
# ParaViewWebPublishImageDelivery must be set to decode=False to match.
0 commit comments