1313from opengeodeweb_viewer .utils_functions import get_schemas_dict , validate_schema
1414from opengeodeweb_viewer .object .object_methods import VtkObjectView
1515
16- schemas_dir = os .path .join (os .path .dirname (__file__ ), "schemas" )
17- schemas_dict = get_schemas_dict (schemas_dir )
18- prefix = "opengeodeweb_viewer.mesh."
19-
2016class VtkMeshView (VtkObjectView ):
17+ prefix = "opengeodeweb_viewer.mesh."
18+ schemas_dict = get_schemas_dict (os .path .join (os .path .dirname (__file__ ), "schemas" ))
19+
2120 def __init__ (self ):
2221 super ().__init__ ()
23- self .prefix = prefix
24- self .schemas_dict = schemas_dict
2522
2623 @exportRpc (prefix + schemas_dict ["register" ]["rpc" ])
2724 def registerMesh (self , params ):
28- print (schemas_dict ["register" ]["rpc" ], params , flush = True )
29- validate_schema (params , schemas_dict ["register" ])
25+ print (self . schemas_dict ["register" ]["rpc" ], f" { params = } " , flush = True )
26+ validate_schema (params , self . schemas_dict ["register" ])
3027 id = params ["id" ]
3128 file_name = params ["file_name" ]
3229 try :
@@ -41,55 +38,56 @@ def registerMesh(self, params):
4138
4239 @exportRpc (prefix + schemas_dict ["deregister" ]["rpc" ])
4340 def deregisterMesh (self , params ):
44- print (schemas_dict ["deregister" ]["rpc" ], params , flush = True )
45- validate_schema (params , schemas_dict ["deregister" ])
41+ print ("deregisterMesh" )
42+ print (self .schemas_dict ["deregister" ]["rpc" ], f"{ params = } " , flush = True )
43+ validate_schema (params , self .schemas_dict ["deregister" ])
4644 id = params ["id" ]
4745 self .deregisterObject (id )
4846
4947 @exportRpc (prefix + schemas_dict ["set_visibility" ]["rpc" ])
5048 def SetMeshVisibility (self , params ):
51- print (schemas_dict ["set_visibility" ]["rpc" ], params , flush = True )
52- validate_schema (params , schemas_dict ["set_visibility" ])
49+ print (self . schemas_dict ["set_visibility" ]["rpc" ], f" { params = } " , flush = True )
50+ validate_schema (params , self . schemas_dict ["set_visibility" ])
5351 id = params ["id" ]
5452 visibility = bool (params ["visibility" ])
5553 self .SetVisibility (id , visibility )
5654
5755 @exportRpc (prefix + schemas_dict ["set_opacity" ]["rpc" ])
5856 def setMeshOpacity (self , params ):
59- print (schemas_dict ["set_opacity" ]["rpc" ], params , flush = True )
60- validate_schema (params , schemas_dict ["set_opacity" ])
57+ print (self . schemas_dict ["set_opacity" ]["rpc" ], f" { params = } " , flush = True )
58+ validate_schema (params , self . schemas_dict ["set_opacity" ])
6159 id = params ["id" ]
6260 opacity = float (params ["opacity" ])
6361 self .SetOpacity (id , opacity )
6462
6563 @exportRpc (prefix + schemas_dict ["set_edge_visibility" ]["rpc" ])
6664 def setMeshEdgeVisibility (self , params ):
67- print (schemas_dict ["set_edge_visibility" ]["rpc" ], params , flush = True )
68- validate_schema (params , schemas_dict ["set_edge_visibility" ])
65+ print (self . schemas_dict ["set_edge_visibility" ]["rpc" ], f" { params = } " , flush = True )
66+ validate_schema (params , self . schemas_dict ["set_edge_visibility" ])
6967 id = params ["id" ]
7068 visibility = bool (params ["visibility" ])
7169 self .SetEdgeVisibility (id , visibility )
7270
7371 @exportRpc (prefix + schemas_dict ["set_point_visibility" ]["rpc" ])
7472 def setMeshPointVisibility (self , params ):
75- print (schemas_dict ["set_point_visibility" ]["rpc" ], params , flush = True )
76- validate_schema (params , schemas_dict ["set_point_visibility" ])
73+ print (self . schemas_dict ["set_point_visibility" ]["rpc" ], f" { params = } " , flush = True )
74+ validate_schema (params , self . schemas_dict ["set_point_visibility" ])
7775 id = params ["id" ]
7876 visibility = bool (params ["visibility" ])
7977 self .SetVertexVisibility (id , visibility )
8078
8179 @exportRpc (prefix + schemas_dict ["set_point_size" ]["rpc" ])
8280 def setMeshPointSize (self , params ):
83- print (schemas_dict ["set_point_size" ]["rpc" ], params , flush = True )
84- validate_schema (params , schemas_dict ["set_point_size" ])
81+ print (self . schemas_dict ["set_point_size" ]["rpc" ], f" { params = } " , flush = True )
82+ validate_schema (params , self . schemas_dict ["set_point_size" ])
8583 id = params ["id" ]
8684 size = float (params ["size" ])
8785 self .SetPointSize (id , size )
8886
8987 @exportRpc (prefix + schemas_dict ["set_color" ]["rpc" ])
9088 def setMeshColor (self , params ):
91- print (schemas_dict ["set_color" ]["rpc" ], params , flush = True )
92- validate_schema (params , schemas_dict ["set_color" ])
89+ print (self . schemas_dict ["set_color" ]["rpc" ], f" { params = } " , flush = True )
90+ validate_schema (params , self . schemas_dict ["set_color" ])
9391 id = params ["id" ]
9492 red = params ["red" ]
9593 green = params ["green" ]
@@ -98,8 +96,8 @@ def setMeshColor(self, params):
9896
9997 @exportRpc (prefix + schemas_dict ["display_vertex_attribute" ]["rpc" ])
10098 def setVertexAttribute (self , params ):
101- print (schemas_dict ["display_vertex_attribute" ]["rpc" ], params , flush = True )
102- validate_schema (params , schemas_dict ["display_vertex_attribute" ])
99+ print (self . schemas_dict ["display_vertex_attribute" ]["rpc" ], f" { params = } " , flush = True )
100+ validate_schema (params , self . schemas_dict ["display_vertex_attribute" ])
103101 id = params ["id" ]
104102 name = params ["name" ]
105103 reader = self .get_object (id )["reader" ]
@@ -113,8 +111,8 @@ def setVertexAttribute(self, params):
113111
114112 @exportRpc (prefix + schemas_dict ["display_polygon_attribute" ]["rpc" ])
115113 def setPolygonAttribute (self , params ):
116- print (schemas_dict ["display_polygon_attribute" ]["rpc" ], params , flush = True )
117- validate_schema (params , schemas_dict ["display_polygon_attribute" ])
114+ print (self . schemas_dict ["display_polygon_attribute" ]["rpc" ], f" { params = } " , flush = True )
115+ validate_schema (params , self . schemas_dict ["display_polygon_attribute" ])
118116 id = params ["id" ]
119117 name = params ["name" ]
120118 reader = self .get_object (id )["reader" ]
0 commit comments