OCCT3D About OCCT
Open CASCADE Technology Reference Manual 8.0.1
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
BRepGraph_LayerTopoSupplement Class Reference

Runtime-only storage for supplemental TopoDS topology fragments. More...

#include <BRepGraph_LayerTopoSupplement.hxx>

Inheritance diagram for BRepGraph_LayerTopoSupplement:
Inheritance graph
[legend]

Data Structures

struct  Entry
 Stored runtime attachment record. More...
 

Public Types

enum class  AttachmentKind {
  VertexSupplementShape , EdgeInternalVertex , FaceDirectVertex , SolidAuxShape ,
  ShellAuxShape , CompSolidAuxShape , CompoundAuxShape , GenericSupplementShape
}
 Semantic role of one supplemental attachment. More...
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Public Member Functions

const Standard_GUIDID () const override
 Return the runtime type GUID for this layer instance.
 
const TCollection_AsciiStringName () const override
 Return a short stable layer name for diagnostics and registry lookup.
 
const EntryFindByUid (uint64_t theUid) const
 Find one attachment entry by its layer-local uid.
 
const NCollection_LinearVector< uint64_t > & AttachedTo (BRepGraph_NodeId theOwner) const
 Return all attachment uids currently owned by one core node.
 
uint64_t AddAttachment (BRepGraph_NodeId theOwner, AttachmentKind theKind, const TopoDS_Shape &theShape)
 Add one supplemental shape attachment to a supported core owner node. Supported owner kinds are vertex, edge, face, shell, solid, compsolid, and compound.
 
bool AddAttachmentWithUid (BRepGraph_NodeId theOwner, uint64_t theUid, AttachmentKind theKind, const TopoDS_Shape &theShape)
 Add one supplemental shape attachment with an explicitly preserved uid. Supported owner kinds are vertex, edge, face, shell, solid, compsolid, and compound.
 
bool RemoveAttachment (uint64_t theUid)
 Remove one supplemental attachment by uid.
 
void Validate () const
 Validate internal owner/uid bookkeeping invariants.
 
void OnNodeRemoved (const BRepGraph_NodeId theNode) noexcept override
 Drop all attachments owned by a removed node.
 
void OnNodeReplaced (const BRepGraph_NodeId theOldNode, const BRepGraph_NodeId theNewNode) noexcept override
 Migrate attachments from one owner node to another compatible node.
 
void CopyTo (const BRepGraph_CopyRemap &theCopy) const override
 Copy remapped attachments to the target graph.
 
void InvalidateAll () noexcept override
 Invalidate all cached state in the layer.
 
void Clear () noexcept override
 Remove every stored supplemental attachment.
 
- Public Member Functions inherited from BRepGraph_Layer
void OnItemRemoved (const BRepGraph_ItemId theItem) noexcept
 Dispatch a generic item removal to the matching typed removal callback. This is a non-virtual convenience entry point; typed callbacks remain the extension points for derived layers.
 
virtual int SubscribedKinds () const
 Return a bitmask of BRepGraph_NodeId::Kind values this layer subscribes to. Only modification events matching subscribed kinds are dispatched. Default: 0 (no subscription - no modification events received). Override to receive OnNodeModified/OnNodesModified callbacks. The returned value must be constant for the lifetime of the layer.
 
virtual void OnNodeModified (const BRepGraph_NodeId theNode) noexcept
 Called in immediate (non-deferred) mode after a single node is modified. Only dispatched if the node's kind matches SubscribedKinds(). Default: no-op.
 
void OnItemModified (const BRepGraph_ItemId theItem) noexcept
 Dispatch a generic item modification to the matching typed modification callback. This is a non-virtual convenience entry point; typed callbacks remain the extension points for derived layers.
 
virtual void OnNodesModified (const NCollection_Array1< BRepGraph_NodeId > &theModifiedNodes) noexcept
 Called after EndDeferredInvalidation() with all nodes modified during the deferred scope. Only dispatched if at least one modified node's kind matches SubscribedKinds(). The array may contain nodes of kinds not subscribed to - layers should filter internally if needed. Default: no-op.
 
virtual int SubscribedRefKinds () const
 Return a bitmask of BRepGraph_RefId::Kind values this layer subscribes to. Only modification events matching subscribed ref kinds are dispatched. Default: 0 (no subscription). Must be constant for the layer's lifetime.
 
virtual void OnRefRemoved (const BRepGraph_RefId theRef) noexcept
 Called when a reference is soft-deleted via RemoveRef(). No replacement concept - refs are simply removed (unlike nodes which can have a replacement during sewing or deduplication). Dispatched to all layers regardless of SubscribedRefKinds(). Default: no-op.
 
virtual void OnRefModified (const BRepGraph_RefId theRef) noexcept
 Called in immediate (non-deferred) mode after a single ref is mutated. Only dispatched if the ref's kind matches SubscribedRefKinds(). Default: no-op.
 
virtual void OnRefsModified (const NCollection_Array1< BRepGraph_RefId > &theModifiedRefs) noexcept
 Called after EndDeferredInvalidation() with all refs modified during the deferred scope. Only dispatched if at least one modified ref's kind matches SubscribedRefKinds(). The array may contain refs of kinds not subscribed to - layers should filter internally if needed. Default: no-op.
 
uint64_t Revision () const noexcept
 Monotonic revision counter incremented by touch() on every observable state change. Consumers compare stored revisions to detect staleness in O(1). Derived layers MUST call touch() from their mutators.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Static Public Member Functions

static const Standard_GUIDGetID ()
 Return the fixed layer type GUID.
 
- Static Public Member Functions inherited from BRepGraph_Layer
static int KindBit (const BRepGraph_NodeId::Kind theKind)
 Convenience: return bitmask bit for a given Kind.
 
static int RefKindBit (const BRepGraph_RefId::Kind theKind)
 Convenience: return bitmask bit for a given RefId::Kind.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Additional Inherited Members

- Protected Member Functions inherited from BRepGraph_Layer
 BRepGraph_Layer ()
 
void touch () noexcept
 Bump the revision counter.
 
bool IsAttached () const noexcept
 True while this layer is registered in a live graph registry.
 
const BRepGraphGraph () const
 Attached graph for read-only layer services. Raises Standard_ProgramError if detached.
 
BRepGraphAttachedGraph () const noexcept
 Attached mutable graph for graph-owned service layers. Returns null if detached.
 
virtual void OnAttached () noexcept
 Called after the layer is attached to a graph registry.
 
virtual void OnDetached () noexcept
 Called before the layer is detached from a graph registry.
 
- Static Protected Member Functions inherited from BRepGraph_Layer
template<BRepGraph_NodeId::Kind TheKind>
static BRepGraph_NodeId::Typed< TheKindRemappedItem (const BRepGraph_CopyRemap &theCopy, const BRepGraph_NodeId::Typed< TheKind > theId)
 
template<BRepGraph_RefId::Kind TheKind>
static BRepGraph_RefId::Typed< TheKindRemappedItem (const BRepGraph_CopyRemap &theCopy, const BRepGraph_RefId::Typed< TheKind > theId)
 

Detailed Description

Runtime-only storage for supplemental TopoDS topology fragments.

This layer stores non-core topology extracted from a source shape and attached to supported core graph owners. These attachments are not serialized and are intended only to preserve live TopoDS -> Graph -> TopoDS behavior.

Member Enumeration Documentation

◆ AttachmentKind

Semantic role of one supplemental attachment.

Enumerator
VertexSupplementShape 
EdgeInternalVertex 
FaceDirectVertex 
SolidAuxShape 
ShellAuxShape 
CompSolidAuxShape 
CompoundAuxShape 
GenericSupplementShape 

Member Function Documentation

◆ AddAttachment()

uint64_t BRepGraph_LayerTopoSupplement::AddAttachment ( BRepGraph_NodeId theOwner,
AttachmentKind theKind,
const TopoDS_Shape & theShape )

Add one supplemental shape attachment to a supported core owner node. Supported owner kinds are vertex, edge, face, shell, solid, compsolid, and compound.

Parameters
[in]theOwneractive core topology owner
[in]theKindsemantic attachment kind
[in]theShapeattached supplemental shape
Returns
non-zero layer-local uid on success, 0 on rejection

◆ AddAttachmentWithUid()

bool BRepGraph_LayerTopoSupplement::AddAttachmentWithUid ( BRepGraph_NodeId theOwner,
uint64_t theUid,
AttachmentKind theKind,
const TopoDS_Shape & theShape )

Add one supplemental shape attachment with an explicitly preserved uid. Supported owner kinds are vertex, edge, face, shell, solid, compsolid, and compound.

Parameters
[in]theOwneractive core topology owner
[in]theUidlayer-local attachment uid to preserve
[in]theKindsemantic attachment kind
[in]theShapeattached supplemental shape
Returns
true on success, false when the uid or input is rejected

◆ AttachedTo()

const NCollection_LinearVector< uint64_t > & BRepGraph_LayerTopoSupplement::AttachedTo ( BRepGraph_NodeId theOwner) const

Return all attachment uids currently owned by one core node.

Parameters
[in]theOwnercore topology owner node
Returns
owner-local insertion-ordered list of attachment uids

◆ Clear()

void BRepGraph_LayerTopoSupplement::Clear ( )
overridevirtualnoexcept

Remove every stored supplemental attachment.

Implements BRepGraph_Layer.

◆ CopyTo()

void BRepGraph_LayerTopoSupplement::CopyTo ( const BRepGraph_CopyRemap & theCopy) const
overridevirtual

Copy remapped attachments to the target graph.

Implements BRepGraph_Layer.

◆ FindByUid()

const Entry * BRepGraph_LayerTopoSupplement::FindByUid ( uint64_t theUid) const

Find one attachment entry by its layer-local uid.

Parameters
[in]theUidlayer-local attachment uid
Returns
pointer to the entry, or nullptr when not found

◆ GetID()

static const Standard_GUID & BRepGraph_LayerTopoSupplement::GetID ( )
static

Return the fixed layer type GUID.

◆ ID()

const Standard_GUID & BRepGraph_LayerTopoSupplement::ID ( ) const
overridevirtual

Return the runtime type GUID for this layer instance.

Implements BRepGraph_Layer.

◆ InvalidateAll()

void BRepGraph_LayerTopoSupplement::InvalidateAll ( )
overridevirtualnoexcept

Invalidate all cached state in the layer.

Implements BRepGraph_Layer.

◆ Name()

const TCollection_AsciiString & BRepGraph_LayerTopoSupplement::Name ( ) const
overridevirtual

Return a short stable layer name for diagnostics and registry lookup.

Implements BRepGraph_Layer.

◆ OnNodeRemoved()

void BRepGraph_LayerTopoSupplement::OnNodeRemoved ( const BRepGraph_NodeId theNode)
overridevirtualnoexcept

Drop all attachments owned by a removed node.

Parameters
[in]theNoderemoved core node

Reimplemented from BRepGraph_Layer.

◆ OnNodeReplaced()

void BRepGraph_LayerTopoSupplement::OnNodeReplaced ( const BRepGraph_NodeId theOldNode,
const BRepGraph_NodeId theNewNode )
overridevirtualnoexcept

Migrate attachments from one owner node to another compatible node.

Parameters
[in]theOldNodeprevious owner node
[in]theNewNodereplacement owner node

Reimplemented from BRepGraph_Layer.

◆ RemoveAttachment()

bool BRepGraph_LayerTopoSupplement::RemoveAttachment ( uint64_t theUid)

Remove one supplemental attachment by uid.

Parameters
[in]theUidlayer-local attachment uid
Returns
true when the attachment existed and was removed

◆ Validate()

void BRepGraph_LayerTopoSupplement::Validate ( ) const

Validate internal owner/uid bookkeeping invariants.

Exceptions
Standard_ProgramErroron inconsistent internal state

The documentation for this class was generated from the following file: