Skip to content

Commit bf1652a

Browse files
committed
update visibility
1 parent 4877be8 commit bf1652a

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.pytest_cache
2-
dist
2+
dist
3+
env/
4+
venv/
5+
.vscode/
6+
__pycache__/
7+
data/

vtk_protocol.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,31 @@ def reset(self):
155155
renderWindow.GetRenderers().GetFirstRenderer().RemoveAllViewProps()
156156
print("reset")
157157

158+
@exportRpc("toggle_edge_visibility")
159+
def setEdgeVisibility(self, params):
160+
print(f"{params=}", flush=True)
161+
id = params["id"]
162+
visibility = bool(params["visibility"])
163+
actor = self.get_object(id)["actor"]
164+
actor.GetProperty().SetEdgeVisibility(visibility)
165+
self.render()
166+
167+
@exportRpc("toggle_point_visibility")
168+
def setPointVisibility(self, params):
169+
id = params["id"]
170+
visibility = bool(params["visibility"])
171+
actor = self.get_object(id)["actor"]
172+
actor.GetProperty().SetVertexVisibility(visibility)
173+
self.render()
174+
175+
@exportRpc("point_size")
176+
def setPointSize(self, params):
177+
id = params["id"]
178+
size = float(params["size"])
179+
actor = self.get_object(id)["actor"]
180+
actor.GetProperty().SetPointSize(size)
181+
self.render()
182+
158183
def getProtocol(self, name):
159184
for p in self.coreServer.getLinkProtocols():
160185
if type(p).__name__ == name:

0 commit comments

Comments
 (0)