Archived issue #0022855

Strange result type of IVtkTools_ShapePicker method

Open CASCADEOCCT:VISclosed4 public notes

Search issues

Description

The following method of IVtkTools_ShapePicker has strange return type:

  NCollection_Set<vtkIdType> GetPickedSubShapesIds (const IVtk_IdType id, bool all = false) const;

Internally, IVtk_ShapeIdList is used but the picker converts it to NCollection_Set - for what reason?

I would use IVtk_ShapeIdList where a collection of (sub-)shapes is expected, unless some specific condition is applied.

Public activity

4 archived notes

Participants are labeled by their role within this record.

01Commenter 1
The set is returned for usage with SubPolyDataFilter.Add() method for multiselection. Union operation of sets of ids is applied for that.
02Commenter 2
In any case the returned set is copied, so there is no advantage in returning a set and copying it with respect to returning a list and converting it to a set where necessary.

But the public API looks more consistent if all its related methods have similar return types.

And usage of a set in one particular internal case should not be reflected by public API, unless there are some strong technical reasons for that.
03Commenter 3
The result type of selected subshapes ids has been changed to IVtk_ShapeIdList.
New overloaded methods SetData and AddData are added to IVtkTools_SubPolyDataFilter to send IVtk_ShapeIdList as a parameter.
04Commenter 4
The issues was created during development of VIS component for development needs only.
The issue has been corrected and should be closed, no testing is required.

Related records