Skip to content

Commit e787fb5

Browse files
committed
clear some com
1 parent 4ff52a9 commit e787fb5

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/opengeodeweb_viewer/object/object_methods.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,10 @@ def SetBlocksVisibility(
162162
mapper = pipeline.mapper
163163
if not isinstance(mapper, vtkCompositePolyDataMapper):
164164
raise Exception("Mapper is not a vtkCompositePolyDataMapper")
165-
# Update block visibility attributes on the main mapper
166165
blocks = pipeline.blockDataSets
167166
visibility_attributes = mapper.GetCompositeDataDisplayAttributes()
168167
for block_id in block_ids:
169168
visibility_attributes.SetBlockVisibility(blocks[block_id], visibility)
170-
# Extract output dataset from filter or reader
171169
dataset = (pipeline.filter or pipeline.reader).GetOutputDataObject(0)
172170
if not isinstance(dataset, vtkMultiBlockDataSet):
173171
return

src/opengeodeweb_viewer/rpc/viewer/viewer_protocols.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,26 +343,26 @@ def setHighlight(
343343
)
344344
params = schemas.Highlight.from_dict(rpc_params)
345345

346-
# 1. Clear previous highlights
346+
# Clear previous highlights
347347
self.clear_highlights(params.ids)
348348
picker = vtkCellPicker(tolerance=0.005)
349349

350-
# 2. Perform pick operation to identify clicked pipeline and primitive ID
350+
# Perform pick operation to identify clicked pipeline and primitive ID
351351
data_id, id_to_select = self.pick_cell_or_point(
352352
params.ids, params.x, params.y, params.field_type.value, picker
353353
)
354354
if not data_id or id_to_select == -1:
355355
self.render(-1)
356356
return {}
357357

358-
# 3. Retrieve picked composite block information and check block visibility
358+
# Retrieve picked composite block information and check block visibility
359359
pipeline = self.get_vtk_pipeline(data_id)
360360
dataset, geode_id, is_visible = self.get_composite_block_info(pipeline, picker)
361361
if not is_visible:
362362
self.render(-1)
363363
return {}
364364

365-
# 4. Update highlight visibility and extract attributes from the picked element
365+
# Update highlight visibility and extract attributes from the picked element
366366
self.update_highlight(pipeline, id_to_select, params.field_type.value, dataset)
367367
self.render(-1)
368368
data_attributes = self.extract_picked_attributes(

src/opengeodeweb_viewer/vtk_protocol.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,10 @@ def pick_cell_or_point(
213213
field_type: str,
214214
picker: vtkCellPicker,
215215
) -> tuple[str | None, int]:
216-
# Temporarily swap to pick mappers to prevent picking hidden blocks
217216
self.swap_pick_mappers(data_ids, use_pick_mapper=True)
218217
try:
219218
picker.Pick(x, y, 0, self.get_renderer())
220219
finally:
221-
# Swap back to normal mappers
222220
self.swap_pick_mappers(data_ids, use_pick_mapper=False)
223221

224222
actor = picker.GetActor()
@@ -239,21 +237,18 @@ def pick_cell_or_point(
239237
def pick_actors_under_coordinate(
240238
self, data_ids: list[str], x: float, y: float, picker: vtkCellPicker
241239
) -> tuple[list[vtkActor], int]:
242-
# Swap mappers to ensure picking respects block visibility
243240
renderer = self.get_renderer()
244241
self.swap_pick_mappers(data_ids, use_pick_mapper=True)
245242
actors = []
246243
viewer_id = -1
247244
try:
248245
picker.Pick(x, y, 0, renderer)
249246
viewer_id = picker.GetFlatBlockIndex()
250-
# Iteratively pick overlapping actors by temporarily hiding them
251247
while actor := picker.GetActor():
252248
actors.append(actor)
253249
actor.SetPickable(False)
254250
picker.Pick(x, y, 0, renderer)
255251
finally:
256-
# Revert pickability and swap back to normal mappers
257252
for actor in actors:
258253
actor.SetPickable(True)
259254
self.swap_pick_mappers(data_ids, use_pick_mapper=False)

0 commit comments

Comments
 (0)