Foundation Classes - Refactor TColStd_PackedMapOfInteger and related classes#1023
Merged
dpasukhi merged 7 commits intoOpen-Cascade-SAS:IRfrom Jan 22, 2026
Merged
Conversation
Member
dpasukhi
commented
Jan 21, 2026
- Removed TColStd_HPackedMapOfInteger and its associated methods.
- Updated TColStd_PackedMapOfInteger to be a typedef for NCollection_PackedMapOfInteger.
- Replaced all instances of TColStd_MapIteratorOfPackedMapOfInteger with the new iterator from TColStd_PackedMapOfInteger.
- Adjusted related files in the Visualization and ModelingAlgorithms directories to reflect the changes in the map and iterator usage.
…classes - Removed TColStd_HPackedMapOfInteger and its associated methods. - Updated TColStd_PackedMapOfInteger to be a typedef for NCollection_PackedMapOfInteger. - Replaced all instances of TColStd_MapIteratorOfPackedMapOfInteger with the new iterator from TColStd_PackedMapOfInteger. - Adjusted related files in the Visualization and ModelingAlgorithms directories to reflect the changes in the map and iterator usage.
- Removed the NCollection_PackedMapOfInteger class, consolidating its functionality into TColStd_PackedMapOfInteger. - Updated TColStd_HPackedMapOfInteger to use TColStd_PackedMapOfInteger instead of NCollection_PackedMapOfInteger. - Changed the typedef for TColStd_PackedMapOfInteger to use NCollection_PackedMap<int> for better type consistency. - Marked the previous classes as deprecated to guide users towards the new implementation.
- Introduced a new header file NCollection_PackedMapAlgo.hxx containing template functions for boolean operations on packed maps, including union, intersection, subtraction, and symmetric difference. - Updated various source files in the visualization module to utilize the new NCollection_PackedMapAlgo functions for operations on packed maps, enhancing code clarity and performance. - Replaced direct method calls on packed maps with corresponding functions from NCollection_PackedMapAlgo in MeshVS_ElementalColorPrsBuilder, MeshVS_Mesh, MeshVS_MeshOwner, MeshVS_MeshPrsBuilder, MeshVS_NodalColorPrsBuilder, MeshVS_TextPrsBuilder, MeshVS_VectorPrsBuilder, and Select3D_SensitivePrimitiveArray.
There was a problem hiding this comment.
Pull request overview
This PR refactors the TColStd_PackedMapOfInteger class and its related components by modernizing the implementation and moving it to a more generic template-based design. The refactoring eliminates the separate TColStd_HPackedMapOfInteger wrapper implementation and replaces the old iterator with a modern type alias.
Changes:
- Replaced
TColStd_PackedMapOfIntegerimplementation with a typedef toNCollection_PackedMap<int> - Introduced new
NCollection_PackedMaptemplate class andNCollection_PackedMapAlgonamespace with standalone boolean operation functions - Removed
TColStd_HPackedMapOfIntegerimplementation files, keeping only the header as a deprecated wrapper - Updated all iterator references from
TColStd_MapIteratorOfPackedMapOfIntegertoTColStd_PackedMapOfInteger::Iterator - Replaced direct map method calls (Unite, Subtract, etc.) with standalone algorithm functions from
NCollection_PackedMapAlgo
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
NCollection_PackedMap.hxx |
New template implementation of packed map for various integer types |
NCollection_PackedMapAlgo.hxx |
New namespace with standalone boolean operations for packed maps |
TColStd_PackedMapOfInteger.hxx |
Converted to typedef for NCollection_PackedMap<int> |
TColStd_HPackedMapOfInteger.hxx |
Converted to thin wrapper with inline methods, marked as deprecated |
Multiple .cxx files |
Updated to use new iterator type and NCollection_PackedMapAlgo functions |
NCollection_PackedMap_Test.cxx |
Comprehensive test suite for the new implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.