mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-08-29 22:38:28 +08:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user