36
36
get_point_position_json = json .load (file )
37
37
with open (os .path .join (schemas , "reset.json" ), "r" ) as file :
38
38
reset_json = json .load (file )
39
+ with open (os .path .join (schemas , "set_opacity.json" ), "r" ) as file :
40
+ set_opacity_json = json .load (file )
39
41
with open (os .path .join (schemas , "toggle_edge_visibility.json" ), "r" ) as file :
40
42
toggle_edge_visibility_json = json .load (file )
41
- with open (os .path .join (schemas , "point_size .json" ), "r" ) as file :
42
- point_size_json = json .load (file )
43
+ with open (os .path .join (schemas , "set_point_size .json" ), "r" ) as file :
44
+ set_point_size_json = json .load (file )
43
45
with open (os .path .join (schemas , "toggle_point_visibility.json" ), "r" ) as file :
44
46
toggle_point_visibility_json = json .load (file )
45
47
with open (os .path .join (schemas , "set_color.json" ), "r" ) as file :
@@ -246,11 +248,20 @@ def reset(self, params):
246
248
renderWindow = self .getView ("-1" )
247
249
renderWindow .GetRenderers ().GetFirstRenderer ().RemoveAllViewProps ()
248
250
251
+ @exportRpc (set_opacity_json ["rpc" ])
252
+ def set_opacity (self , params ):
253
+ validate_schemas (params , set_opacity_json )
254
+ id = params ["id" ]
255
+ opacity = float (params ["opacity" ])
256
+ actor = self .get_object (id )["actor" ]
257
+ actor .GetProperty ().SetOpacity (opacity )
258
+ self .render ()
259
+
249
260
@exportRpc (toggle_edge_visibility_json ["rpc" ])
250
261
def setEdgeVisibility (self , params ):
251
262
validate_schemas (params , toggle_edge_visibility_json )
252
263
print (f"{ params = } " , flush = True )
253
- id = params ["id" ]
264
+ id = str ( params ["id" ])
254
265
visibility = bool (params ["visibility" ])
255
266
actor = self .get_object (id )["actor" ]
256
267
actor .GetProperty ().SetEdgeVisibility (visibility )
@@ -265,9 +276,9 @@ def setPointVisibility(self, params):
265
276
actor .GetProperty ().SetVertexVisibility (visibility )
266
277
self .render ()
267
278
268
- @exportRpc (point_size_json ["rpc" ])
279
+ @exportRpc (set_point_size_json ["rpc" ])
269
280
def setPointSize (self , params ):
270
- validate_schemas (params , point_size_json )
281
+ validate_schemas (params , set_point_size_json )
271
282
id = params ["id" ]
272
283
size = float (params ["size" ])
273
284
actor = self .get_object (id )["actor" ]
0 commit comments