Skip to content

Commit

Permalink
update visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
BotellaA committed Aug 30, 2023
1 parent 4877be8 commit bf1652a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.pytest_cache
dist
dist
env/
venv/
.vscode/
__pycache__/
data/
25 changes: 25 additions & 0 deletions vtk_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,31 @@ def reset(self):
renderWindow.GetRenderers().GetFirstRenderer().RemoveAllViewProps()
print("reset")

@exportRpc("toggle_edge_visibility")
def setEdgeVisibility(self, params):
print(f"{params=}", flush=True)
id = params["id"]
visibility = bool(params["visibility"])
actor = self.get_object(id)["actor"]
actor.GetProperty().SetEdgeVisibility(visibility)
self.render()

@exportRpc("toggle_point_visibility")
def setPointVisibility(self, params):
id = params["id"]
visibility = bool(params["visibility"])
actor = self.get_object(id)["actor"]
actor.GetProperty().SetVertexVisibility(visibility)
self.render()

@exportRpc("point_size")
def setPointSize(self, params):
id = params["id"]
size = float(params["size"])
actor = self.get_object(id)["actor"]
actor.GetProperty().SetPointSize(size)
self.render()

def getProtocol(self, name):
for p in self.coreServer.getLinkProtocols():
if type(p).__name__ == name:
Expand Down

0 comments on commit bf1652a

Please sign in to comment.