Modeling Data - BRepGraph iterators, ref caching, mutation APIs, and layer events (#1190)

- Add RelatedIterator, CacheKindIterator, LayerIterator, RefTransientCache
- Add Builder::AppendFull, BuilderView::RemoveRef with orphan pruning
- Add SetCoEdgePCurve, ClearFaceMesh, ClearEdgePolygon3D, ValidateMutationBoundary
- Rename CoEdgeDef::Sense to Orientation, FreeChildRefIds to AuxChildRefIds
- Propagate ref-modification events through LayerRegistry (deferred/immediate)
- Extend DefsIterator/RefsIterator with filtered-kind iteration
- Add CreateAutoProduct option to BRepGraphInc_Populate::Options
- Update BRepGraph and BRepGraphInc READMEs
This commit is contained in:
Pasukhin Dmitry
2026-04-05 17:12:48 +01:00
committed by GitHub
parent a56f2394ce
commit 0af2ccac59
62 changed files with 4328 additions and 573 deletions
@@ -35,6 +35,7 @@ int BRepGraph_LayerRegistry::RegisterLayer(const occ::handle<BRepGraph_Layer>& t
myLayers.Append(theLayer);
myGuidToSlot.Bind(aGUID, aNewSlot);
mySubscribedKindsMask |= theLayer->SubscribedKinds();
mySubscribedRefKindsMask |= theLayer->SubscribedRefKinds();
return aNewSlot;
}
@@ -160,11 +161,54 @@ void BRepGraph_LayerRegistry::InvalidateAll() noexcept
//=================================================================================================
void BRepGraph_LayerRegistry::DispatchOnRefRemoved(const BRepGraph_RefId theRef) noexcept
{
for (const occ::handle<BRepGraph_Layer>& aLayer : myLayers)
{
aLayer->OnRefRemoved(theRef);
}
}
//=================================================================================================
void BRepGraph_LayerRegistry::DispatchRefModified(const BRepGraph_RefId theRef) noexcept
{
if (!HasRefModificationSubscribers())
return;
const int aRefKindBit = BRepGraph_Layer::RefKindBit(theRef.RefKind);
for (const occ::handle<BRepGraph_Layer>& aLayer : myLayers)
{
if ((aLayer->SubscribedRefKinds() & aRefKindBit) != 0)
aLayer->OnRefModified(theRef);
}
}
//=================================================================================================
void BRepGraph_LayerRegistry::DispatchRefsModified(
const NCollection_Vector<BRepGraph_RefId>& theModifiedRefs,
const int theModifiedRefKindsMask) noexcept
{
if (!HasRefModificationSubscribers() || theModifiedRefKindsMask == 0)
return;
for (const occ::handle<BRepGraph_Layer>& aLayer : myLayers)
{
if ((aLayer->SubscribedRefKinds() & theModifiedRefKindsMask) != 0)
aLayer->OnRefsModified(theModifiedRefs, theModifiedRefKindsMask);
}
}
//=================================================================================================
void BRepGraph_LayerRegistry::recomputeSubscribedKindsMask()
{
mySubscribedKindsMask = 0;
mySubscribedKindsMask = 0;
mySubscribedRefKindsMask = 0;
for (const occ::handle<BRepGraph_Layer>& aLayer : myLayers)
{
mySubscribedKindsMask |= aLayer->SubscribedKinds();
mySubscribedRefKindsMask |= aLayer->SubscribedRefKinds();
}
}