Modeling - Refactor BRepGraph for uint32_t ids (#1229)

- Migrated node/ref/rep ID types and many count-returning APIs from `int` to `uint32_t`/`size_t` (history indices), updating iterators and bounds checks accordingly.
- Reworked numerous loops from raw integer indexing to typed-id iteration (`Start()`, `IsValid()`, range-for) across core code and tests.
- Expanded compaction test coverage (incl. bounding-box preservation assertion), plus clearer assertions/messages.
This commit is contained in:
Pasukhin Dmitry
2026-04-23 22:09:31 +01:00
committed by GitHub
parent 48e84c53a9
commit 7eb211cc2e
55 changed files with 1934 additions and 1878 deletions
@@ -103,16 +103,11 @@ static TopoDS_Shape reconstructProductLocal(BRepGraph_ReconstructionContext& the
TopoDS_Shape aResult;
BRepGraph_NodeId aShapeRootNode;
TopLoc_Location aRootLocation;
for (int i = 0; i < aProduct.OccurrenceRefIds.Length(); ++i)
for (BRepGraph_RefsOccurrenceOfProduct anOccIt(*theContext.Graph, theProduct); anOccIt.More();
anOccIt.Next())
{
const BRepGraphInc::OccurrenceRef& aRef = aStorage.OccurrenceRef(aProduct.OccurrenceRefIds(i));
if (aRef.IsRemoved)
continue;
if (!aRef.OccurrenceDefId.IsValid(aStorage.NbOccurrences()))
continue;
const BRepGraphInc::OccurrenceRef& aRef = aStorage.OccurrenceRef(anOccIt.CurrentId());
const BRepGraphInc::OccurrenceDef& aDef = aStorage.Occurrence(aRef.OccurrenceDefId);
if (aDef.IsRemoved)
continue;
if (aDef.ChildDefId.IsValid() && aDef.ChildDefId.NodeKind != BRepGraph_NodeId::Kind::Product)
{
aShapeRootNode = aDef.ChildDefId;