mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-30 14:58:49 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user