1313from opengeodeweb_viewer .utils_functions import get_schemas_dict , validate_schema
1414from opengeodeweb_viewer .object .object_methods import VtkObjectView
1515
16-
1716schemas_dir = os .path .join (os .path .dirname (__file__ ), "schemas" )
1817schemas_dict = get_schemas_dict (schemas_dir )
18+ prefix = "opengeodeweb_viewer.mesh."
1919
2020class VtkMeshView (VtkObjectView ):
2121 def __init__ (self ):
2222 super ().__init__ ()
23+ self .prefix = prefix
24+ self .schemas_dict = schemas_dict
2325
24- @exportRpc (schemas_dict ["register" ]["rpc" ])
26+ @exportRpc (prefix + schemas_dict ["register" ]["rpc" ])
2527 def registerMesh (self , params ):
2628 print (schemas_dict ["register" ]["rpc" ], params , flush = True )
2729 validate_schema (params , schemas_dict ["register" ])
@@ -36,54 +38,54 @@ def registerMesh(self, params):
3638 except Exception as e :
3739 print ("error : " , str (e ), flush = True )
3840
39- @exportRpc (schemas_dict ["deregister" ]["rpc" ])
41+ @exportRpc (prefix + schemas_dict ["deregister" ]["rpc" ])
4042 def deregisterMesh (self , params ):
4143 print (schemas_dict ["deregister" ]["rpc" ], params , flush = True )
4244 validate_schema (params , schemas_dict ["deregister" ])
4345 id = params ["id" ]
4446 self .deregister (id )
4547
46- @exportRpc (schemas_dict ["set_visibility" ]["rpc" ])
48+ @exportRpc (prefix + schemas_dict ["set_visibility" ]["rpc" ])
4749 def SetMeshVisibility (self , params ):
4850 print (schemas_dict ["set_visibility" ]["rpc" ], params , flush = True )
4951 validate_schema (params , schemas_dict ["set_visibility" ])
5052 id = params ["id" ]
5153 visibility = bool (params ["visibility" ])
5254 self .SetVisibility (id , visibility )
5355
54- @exportRpc (schemas_dict ["set_opacity" ]["rpc" ])
56+ @exportRpc (prefix + schemas_dict ["set_opacity" ]["rpc" ])
5557 def SetMeshOpacity (self , params ):
5658 print (schemas_dict ["set_opacity" ]["rpc" ], params , flush = True )
5759 validate_schema (params , schemas_dict ["set_opacity" ])
5860 id = params ["id" ]
5961 opacity = float (params ["opacity" ])
6062 self .SetOpacity (id , opacity )
6163
62- @exportRpc (schemas_dict ["set_edge_visibility" ]["rpc" ])
64+ @exportRpc (prefix + schemas_dict ["set_edge_visibility" ]["rpc" ])
6365 def setMeshEdgeVisibility (self , params ):
6466 print (schemas_dict ["set_edge_visibility" ]["rpc" ], params , flush = True )
6567 validate_schema (params , schemas_dict ["set_edge_visibility" ])
6668 id = params ["id" ]
6769 visibility = bool (params ["visibility" ])
6870 self .SetEdgeVisibility (id , visibility )
6971
70- @exportRpc (schemas_dict ["set_point_visibility" ]["rpc" ])
72+ @exportRpc (prefix + schemas_dict ["set_point_visibility" ]["rpc" ])
7173 def setMeshPointVisibility (self , params ):
7274 print (schemas_dict ["set_point_visibility" ]["rpc" ], params , flush = True )
7375 validate_schema (params , schemas_dict ["set_point_visibility" ])
7476 id = params ["id" ]
7577 visibility = bool (params ["visibility" ])
7678 self .SetVertexVisibility (id , visibility )
7779
78- @exportRpc (schemas_dict ["set_point_size" ]["rpc" ])
80+ @exportRpc (prefix + schemas_dict ["set_point_size" ]["rpc" ])
7981 def setMeshPointSize (self , params ):
8082 print (schemas_dict ["set_point_size" ]["rpc" ], params , flush = True )
8183 validate_schema (params , schemas_dict ["set_point_size" ])
8284 id = params ["id" ]
8385 size = float (params ["size" ])
8486 self .SetPointSize (id , size )
8587
86- @exportRpc (schemas_dict ["set_color" ]["rpc" ])
88+ @exportRpc (prefix + schemas_dict ["set_color" ]["rpc" ])
8789 def setMeshColor (self , params ):
8890 print (schemas_dict ["set_color" ]["rpc" ], params , flush = True )
8991 validate_schema (params , schemas_dict ["set_color" ])
@@ -93,7 +95,7 @@ def setMeshColor(self, params):
9395 blue = params ["blue" ]
9496 self .SetColor (id , red , green , blue )
9597
96- @exportRpc (schemas_dict ["display_vertex_attribute" ]["rpc" ])
98+ @exportRpc (prefix + schemas_dict ["display_vertex_attribute" ]["rpc" ])
9799 def setVertexAttribute (self , params ):
98100 print (schemas_dict ["display_vertex_attribute" ]["rpc" ], params , flush = True )
99101 validate_schema (params , schemas_dict ["display_vertex_attribute" ])
@@ -108,7 +110,7 @@ def setVertexAttribute(self, params):
108110 mapper .SetScalarRange (points .GetScalars ().GetRange ())
109111 self .render ()
110112
111- @exportRpc (schemas_dict ["display_polygon_attribute" ]["rpc" ])
113+ @exportRpc (prefix + schemas_dict ["display_polygon_attribute" ]["rpc" ])
112114 def setPolygonAttribute (self , params ):
113115 print (schemas_dict ["display_polygon_attribute" ]["rpc" ], params , flush = True )
114116 validate_schema (params , schemas_dict ["display_polygon_attribute" ])
0 commit comments