Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
BRepGraph_LayerHistory Class Reference

History layer for BRepGraph. More...

#include <BRepGraph_LayerHistory.hxx>

Inheritance diagram for BRepGraph_LayerHistory:

Data Structures

struct  Event
 One atomic modification event recorded in the graph's history log. More...

Public Types

enum class  Kind : std::uint8_t { Modified = 0 , Generated = 1 , Deleted = 2 , Replaced = 3 }
 Classification of a history event. More...
typedef void base_type
 Returns a type descriptor about this object.

Public Member Functions

 BRepGraph_LayerHistory ()
 Default constructor.
const Standard_GUID & ID () const override
 Layer type identity.
const TCollection_AsciiString & Name () const override
 Layer display name.
void Record (const TCollection_AsciiString &theOpLabel, const BRepGraph_NodeId theOriginal, const NCollection_Array1< BRepGraph_NodeId > &theReplacements, const BRepGraph_LayerHistory::Kind theKind=BRepGraph_LayerHistory::Kind::Modified)
 Record a modification: theOriginal was replaced by theReplacements.
void RecordBatch (const TCollection_AsciiString &theOpLabel, const NCollection_Array1< BRepGraph_NodeId > &theOriginals, const NCollection_Array1< BRepGraph_NodeId > &theReplacements, const TCollection_AsciiString &theExtraInfo=TCollection_AsciiString(), const BRepGraph_LayerHistory::Kind theKind=BRepGraph_LayerHistory::Kind::Modified)
 Record a batch of 1-to-1 modifications in a single history event. Each original is paired with the replacement at the same logical position. More efficient than calling Record() in a loop: creates one HistoryRecord and updates the per-kind maps with minimal overhead.
void RecordDeleted (const TCollection_AsciiString &theOpLabel, const NCollection_Array1< BRepGraph_NodeId > &theDeleted)
 Record that a collection of inputs has been consumed by the operation and has no image in the result. Each input is appended to the deleted set and emits a single audit record with empty replacements.
void RecordReplaced (const TCollection_AsciiString &theOpLabel, const BRepGraph_NodeId theOriginal, const BRepGraph_NodeId theReplacement)
 Record replacements: each original is logically removed/detached and continued by the corresponding replacement. Replaced records participate in modified-image queries and also mark originals as deleted.
void RecordReplacedBatch (const TCollection_AsciiString &theOpLabel, const NCollection_Array1< BRepGraph_NodeId > &theOriginals, const NCollection_Array1< BRepGraph_NodeId > &theReplacements, const TCollection_AsciiString &theExtraInfo=TCollection_AsciiString())
 Record a batch of 1-to-1 replacements in a single history event.
void RecordUid (const TCollection_AsciiString &theOpLabel, const BRepGraph_UID &theOriginal, const NCollection_Array1< BRepGraph_UID > &theReplacements, const BRepGraph_LayerHistory::Kind theKind=BRepGraph_LayerHistory::Kind::Modified)
 Record a UID-keyed modification/generation event.
void RecordDeletedUid (const TCollection_AsciiString &theOpLabel, const NCollection_Array1< BRepGraph_UID > &theDeleted)
 Record UID-keyed deletions.
void RecordItemUid (const TCollection_AsciiString &theOpLabel, const BRepGraph_ItemUID &theOriginal, const NCollection_Array1< BRepGraph_ItemUID > &theReplacements, const BRepGraph_LayerHistory::Kind theKind=BRepGraph_LayerHistory::Kind::Modified)
 Record an all-domain ItemUID-keyed modification/generation event.
void RecordDeletedItemUid (const TCollection_AsciiString &theOpLabel, const NCollection_Array1< BRepGraph_ItemUID > &theDeleted)
 Record ItemUID-keyed deletions.
void Absorb (const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theInputs, const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theOutputs, const occ::handle< BRepTools_History > &theSource, const TCollection_AsciiString &theOpLabel)
 Import a BRepTools_History into this graph-native history log.
void Absorb (const BRepGraph &theInputGraph, const BRepGraph &theOutputGraph, const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theInputs, const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > &theOutputs, const occ::handle< BRepTools_History > &theSource, const TCollection_AsciiString &theOpLabel)
 Import a BRepTools_History using persistent UIDs from source/result graphs.
BRepGraph_NodeId FindOriginal (const BRepGraph_NodeId theModified) const
 Walk backwards from a modified node to its original. Follows the reverse map recursively until a root is reached.
NCollection_LinearVector< BRepGraph_NodeId > FindDerived (const BRepGraph_NodeId theOriginal) const
 Walk forwards from an original node to all derived nodes, including both Modified and Generated descendants. Follows the forward maps recursively, collecting every transitively-reachable descendant (intermediate nodes and leaves alike, but not theOriginal itself).
const NCollection_LinearVector< BRepGraph_NodeId > * FindModified (const BRepGraph_NodeId theOriginal) const
 Direct lookup of the Modified images of theOriginal, non-recursive.
const NCollection_LinearVector< BRepGraph_NodeId > * FindGenerated (const BRepGraph_NodeId theOriginal) const
 Direct lookup of the Generated images of theOriginal, non-recursive.
bool IsDeleted (const BRepGraph_NodeId theOriginal) const
 Test whether theOriginal was deleted by some recorded operation.
const NCollection_FlatMap< BRepGraph_NodeId > & DeletedNodes () const
 Borrowed access to the full deleted set.
const NCollection_LinearVector< BRepGraph_UID > * FindModified (const BRepGraph_UID &theUID) const
 UID-keyed Modified images stored directly in this history.
const NCollection_LinearVector< BRepGraph_NodeId > * FindOriginals (const BRepGraph_NodeId theDerived) const
 Direct lookup of all immediate node origins of theDerived. A derived entity can have more than one parent in reconstructive algorithms.
const NCollection_LinearVector< BRepGraph_UID > * FindGenerated (const BRepGraph_UID &theUID) const
 UID-keyed Generated images stored directly in this history.
bool IsDeleted (const BRepGraph_UID &theUID) const
 UID-keyed deletion test stored directly in this history.
const NCollection_FlatMap< BRepGraph_UID > & DeletedUids () const
 UID-keyed deleted set stored directly in this history.
bool HasKnownInput (const BRepGraph_UID &theUID) const
 Test whether theUID was registered as an operation input.
const NCollection_LinearVector< BRepGraph_ItemUID > * FindModified (const BRepGraph_ItemUID &theUID) const
 ItemUID-keyed Modified images stored directly in this history.
const NCollection_LinearVector< BRepGraph_ItemUID > * FindGenerated (const BRepGraph_ItemUID &theUID) const
 ItemUID-keyed Generated images stored directly in this history.
bool IsDeleted (const BRepGraph_ItemUID &theUID) const
 ItemUID-keyed deletion test stored directly in this history.
const NCollection_FlatMap< BRepGraph_ItemUID > & DeletedItemUids () const
 ItemUID-keyed deleted set stored directly in this history.
bool HasKnownInput (const BRepGraph_ItemUID &theUID) const
 Test whether theUID was registered as an operation input.
NCollection_LinearVector< BRepGraph_UID > FindModified (const BRepGraph &theGraph, const BRepGraph_UID &theUID) const
 UID-keyed convenience: Modified images of the input identified by theUID, resolved against theGraph. Returns an empty vector if the UID cannot be resolved or has no Modified record.
NCollection_LinearVector< BRepGraph_UID > FindGenerated (const BRepGraph &theGraph, const BRepGraph_UID &theUID) const
 UID-keyed convenience: Generated images. See FindModified for the resolution contract.
bool IsDeleted (const BRepGraph &theGraph, const BRepGraph_UID &theUID) const
 UID-keyed convenience: deletion test.
NCollection_LinearVector< BRepGraph_UID > DeletedUids (const BRepGraph &theGraph) const
 UID-keyed convenience: dump the full deleted set as UIDs.
size_t NbRecords () const
 Number of recorded history events.
const Event & Record (const size_t theRecordIdx) const
 Access a record by index (0-based).
void SetEnabled (const bool theVal)
 Enable or disable history recording.
bool IsEnabled () const
 Query whether history recording is enabled.
void Clear () noexcept override
 Clear all records and lookup maps.
void OnNodeRemoved (const BRepGraph_NodeId theNode) noexcept override
 Layer removal callback. Records pure graph deletions when enabled.
void CopyTo (const BRepGraph_CopyRemap &theCopy) const override
 Copy history records whose source items have copied target items.
void InvalidateAll () noexcept override
 Clear derived caches by dropping collected history.
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 void OnNodeReplaced (const BRepGraph_NodeId theOldNode, const BRepGraph_NodeId theNewNode) noexcept
 Called when a node is soft-removed and replaced by another node.
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_Transient & operator= (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_Transient * This () 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_GUID & GetID ()
 Stable layer 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 constexpr const char * get_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 BRepGraph & Graph () const
 Attached graph for read-only layer services. Raises Standard_ProgramError if detached.
BRepGraph * AttachedGraph () 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< TheKind > RemappedItem (const BRepGraph_CopyRemap &theCopy, const BRepGraph_NodeId::Typed< TheKind > theId)
template<BRepGraph_RefId::Kind TheKind>
static BRepGraph_RefId::Typed< TheKind > RemappedItem (const BRepGraph_CopyRemap &theCopy, const BRepGraph_RefId::Typed< TheKind > theId)

Detailed Description

History layer for BRepGraph.

BRepGraph_LayerHistory maintains an append-only log of modification events and per-kind lookup maps for efficient queries. Four event kinds are tracked (see BRepGraph_LayerHistory::Kind):

  • Modified: input -> { modified images } (default).
  • Generated: input -> { generated images } (new entities born from the input but not sharing its identity).
  • Deleted: input has been consumed and has no image in the result.
  • Replaced: input was structurally detached and replaced by another node; this maps as Modified and also marks the input as deleted.

Recording can be toggled on/off at runtime. Graph-owned history is registered as a layer and accessed through #Ensure / #Find; algorithms wrapping OCCT's BRepTools_History can import results through Absorb.

Member Enumeration Documentation

◆ Kind

enum class BRepGraph_LayerHistory::Kind : std::uint8_t
strong

Classification of a history event.

Enumerator
Modified 

Default; input persists into the result(s).

Generated 

Output entity is freshly produced from the input.

Deleted 

Input has no image in the result.

Replaced 

Input was detached and continued by replacement(s).

Constructor & Destructor Documentation

◆ BRepGraph_LayerHistory()

BRepGraph_LayerHistory::BRepGraph_LayerHistory ( )

Default constructor.

Member Function Documentation

◆ Absorb() [1/2]

void BRepGraph_LayerHistory::Absorb ( const BRepGraph & theInputGraph,
const BRepGraph & theOutputGraph,
const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theInputs,
const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theOutputs,
const occ::handle< BRepTools_History > & theSource,
const TCollection_AsciiString & theOpLabel )

Import a BRepTools_History using persistent UIDs from source/result graphs.

This overload is the canonical bridge for cross-graph algorithms: input shapes are resolved in theInputGraph, output shapes are resolved in theOutputGraph, and the resulting history is stored by UID.

◆ Absorb() [2/2]

void BRepGraph_LayerHistory::Absorb ( const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theInputs,
const NCollection_DataMap< TopoDS_Shape, BRepGraph_NodeId, TopTools_ShapeMapHasher > & theOutputs,
const occ::handle< BRepTools_History > & theSource,
const TCollection_AsciiString & theOpLabel )

Import a BRepTools_History into this graph-native history log.

Iterates theInputs, queries theSource for Modified / Generated / IsRemoved, translates each TopoDS_Shape image to a NodeId via theOutputs, and emits the corresponding records.

Semantics:

  • For every input shape whose Modified() list is non-empty: emit a Modified record.
  • For every input shape whose Generated() list is non-empty: emit a Generated record.
  • For every input shape with IsRemoved() == true: accumulate into a single Deleted record (IsRemoved takes precedence over Modified/Generated to handle a known OCCT bug where a shape can appear in both the removed set and the generated map).

Output TopoDS_Shapes that do not appear in theOutputs are silently dropped (expected for subshapes merged into a parent compound whose identity is preserved at a higher level).

Parameters
[in]theInputsTopoDS_Shape -> NodeId for every input subshape that should be tracked
[in]theOutputsTopoDS_Shape -> NodeId for every subshape added to the graph by this operation (typically from BRepGraph::ShapesView::Add with TrackAddedNodes)
[in]theSourceBRepTools_History from the OCCT algorithm. Null is accepted (no-op).
[in]theOpLabelrecord label written into every emitted record

◆ Clear()

void BRepGraph_LayerHistory::Clear ( )
overridevirtualnoexcept

Clear all records and lookup maps.

Implements BRepGraph_Layer.

◆ CopyTo()

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

Copy history records whose source items have copied target items.

Implements BRepGraph_Layer.

◆ DeletedItemUids()

const NCollection_FlatMap< BRepGraph_ItemUID > & BRepGraph_LayerHistory::DeletedItemUids ( ) const
nodiscard

ItemUID-keyed deleted set stored directly in this history.

◆ DeletedNodes()

const NCollection_FlatMap< BRepGraph_NodeId > & BRepGraph_LayerHistory::DeletedNodes ( ) const
nodiscard

Borrowed access to the full deleted set.

Returns
reference to the deleted-node set

◆ DeletedUids() [1/2]

const NCollection_FlatMap< BRepGraph_UID > & BRepGraph_LayerHistory::DeletedUids ( ) const
nodiscard

UID-keyed deleted set stored directly in this history.

◆ DeletedUids() [2/2]

NCollection_LinearVector< BRepGraph_UID > BRepGraph_LayerHistory::DeletedUids ( const BRepGraph & theGraph) const
nodiscard

UID-keyed convenience: dump the full deleted set as UIDs.

Parameters
[in]theGraphgraph used to translate NodeId -> UID
Returns
UIDs of all deleted entities (insertion order is not stable)

◆ FindDerived()

NCollection_LinearVector< BRepGraph_NodeId > BRepGraph_LayerHistory::FindDerived ( const BRepGraph_NodeId theOriginal) const
nodiscard

Walk forwards from an original node to all derived nodes, including both Modified and Generated descendants. Follows the forward maps recursively, collecting every transitively-reachable descendant (intermediate nodes and leaves alike, but not theOriginal itself).

Parameters
[in]theOriginalnode id to trace forward
Returns
all transitively derived node ids in breadth-first order

◆ FindGenerated() [1/4]

NCollection_LinearVector< BRepGraph_UID > BRepGraph_LayerHistory::FindGenerated ( const BRepGraph & theGraph,
const BRepGraph_UID & theUID ) const
nodiscard

UID-keyed convenience: Generated images. See FindModified for the resolution contract.

Parameters
[in]theGraphgraph used to translate UID <-> NodeId
[in]theUIDUID of the input entity
Returns
UIDs of the generated images (in record-insertion order)

◆ FindGenerated() [2/4]

const NCollection_LinearVector< BRepGraph_ItemUID > * BRepGraph_LayerHistory::FindGenerated ( const BRepGraph_ItemUID & theUID) const
nodiscard

ItemUID-keyed Generated images stored directly in this history.

◆ FindGenerated() [3/4]

const NCollection_LinearVector< BRepGraph_NodeId > * BRepGraph_LayerHistory::FindGenerated ( const BRepGraph_NodeId theOriginal) const
nodiscard

Direct lookup of the Generated images of theOriginal, non-recursive.

Parameters
[in]theOriginalnode id to query
Returns
pointer to the stored vector, or nullptr if theOriginal has no Generated record.

◆ FindGenerated() [4/4]

const NCollection_LinearVector< BRepGraph_UID > * BRepGraph_LayerHistory::FindGenerated ( const BRepGraph_UID & theUID) const
nodiscard

UID-keyed Generated images stored directly in this history.

◆ FindModified() [1/4]

NCollection_LinearVector< BRepGraph_UID > BRepGraph_LayerHistory::FindModified ( const BRepGraph & theGraph,
const BRepGraph_UID & theUID ) const
nodiscard

UID-keyed convenience: Modified images of the input identified by theUID, resolved against theGraph. Returns an empty vector if the UID cannot be resolved or has no Modified record.

Parameters
[in]theGraphgraph used to translate UID <-> NodeId
[in]theUIDUID of the input entity
Returns
UIDs of the modified images (in record-insertion order)

◆ FindModified() [2/4]

const NCollection_LinearVector< BRepGraph_ItemUID > * BRepGraph_LayerHistory::FindModified ( const BRepGraph_ItemUID & theUID) const
nodiscard

ItemUID-keyed Modified images stored directly in this history.

◆ FindModified() [3/4]

const NCollection_LinearVector< BRepGraph_NodeId > * BRepGraph_LayerHistory::FindModified ( const BRepGraph_NodeId theOriginal) const
nodiscard

Direct lookup of the Modified images of theOriginal, non-recursive.

Parameters
[in]theOriginalnode id to query
Returns
pointer to the stored vector, or nullptr if theOriginal has no Modified record (note: nullptr does not imply IsDeleted).

◆ FindModified() [4/4]

const NCollection_LinearVector< BRepGraph_UID > * BRepGraph_LayerHistory::FindModified ( const BRepGraph_UID & theUID) const
nodiscard

UID-keyed Modified images stored directly in this history.

◆ FindOriginal()

BRepGraph_NodeId BRepGraph_LayerHistory::FindOriginal ( const BRepGraph_NodeId theModified) const
nodiscard

Walk backwards from a modified node to its original. Follows the reverse map recursively until a root is reached.

Parameters
[in]theModifiednode id to trace back
Returns
the root original node id, or theModified itself if not found

◆ FindOriginals()

const NCollection_LinearVector< BRepGraph_NodeId > * BRepGraph_LayerHistory::FindOriginals ( const BRepGraph_NodeId theDerived) const
nodiscard

Direct lookup of all immediate node origins of theDerived. A derived entity can have more than one parent in reconstructive algorithms.

◆ GetID()

const Standard_GUID & BRepGraph_LayerHistory::GetID ( )
static

Stable layer GUID.

◆ HasKnownInput() [1/2]

bool BRepGraph_LayerHistory::HasKnownInput ( const BRepGraph_ItemUID & theUID) const
nodiscard

Test whether theUID was registered as an operation input.

◆ HasKnownInput() [2/2]

bool BRepGraph_LayerHistory::HasKnownInput ( const BRepGraph_UID & theUID) const
nodiscard

Test whether theUID was registered as an operation input.

◆ ID()

const Standard_GUID & BRepGraph_LayerHistory::ID ( ) const
nodiscardoverridevirtual

Layer type identity.

Implements BRepGraph_Layer.

◆ InvalidateAll()

void BRepGraph_LayerHistory::InvalidateAll ( )
overridevirtualnoexcept

Clear derived caches by dropping collected history.

Implements BRepGraph_Layer.

◆ IsDeleted() [1/4]

bool BRepGraph_LayerHistory::IsDeleted ( const BRepGraph & theGraph,
const BRepGraph_UID & theUID ) const
nodiscard

UID-keyed convenience: deletion test.

Parameters
[in]theGraphgraph used to resolve the UID
[in]theUIDUID of the input entity
Returns
true if the resolved NodeId is in the deleted set

◆ IsDeleted() [2/4]

bool BRepGraph_LayerHistory::IsDeleted ( const BRepGraph_ItemUID & theUID) const
nodiscard

ItemUID-keyed deletion test stored directly in this history.

◆ IsDeleted() [3/4]

bool BRepGraph_LayerHistory::IsDeleted ( const BRepGraph_NodeId theOriginal) const
nodiscard

Test whether theOriginal was deleted by some recorded operation.

Parameters
[in]theOriginalnode id to query
Returns
true if theOriginal is in the deleted set

◆ IsDeleted() [4/4]

bool BRepGraph_LayerHistory::IsDeleted ( const BRepGraph_UID & theUID) const
nodiscard

UID-keyed deletion test stored directly in this history.

◆ IsEnabled()

bool BRepGraph_LayerHistory::IsEnabled ( ) const
nodiscard

Query whether history recording is enabled.

Returns
true if recording is active

◆ Name()

const TCollection_AsciiString & BRepGraph_LayerHistory::Name ( ) const
nodiscardoverridevirtual

Layer display name.

Implements BRepGraph_Layer.

◆ NbRecords()

size_t BRepGraph_LayerHistory::NbRecords ( ) const
nodiscard

Number of recorded history events.

Returns
record count

◆ OnNodeRemoved()

void BRepGraph_LayerHistory::OnNodeRemoved ( const BRepGraph_NodeId theNode)
overridevirtualnoexcept

Layer removal callback. Records pure graph deletions when enabled.

Reimplemented from BRepGraph_Layer.

◆ Record() [1/2]

const Event & BRepGraph_LayerHistory::Record ( const size_t theRecordIdx) const
nodiscard

Access a record by index (0-based).

Parameters
[in]theRecordIdxzero-based index into the records vector
Returns
the history record at the given index

◆ Record() [2/2]

void BRepGraph_LayerHistory::Record ( const TCollection_AsciiString & theOpLabel,
const BRepGraph_NodeId theOriginal,
const NCollection_Array1< BRepGraph_NodeId > & theReplacements,
const BRepGraph_LayerHistory::Kind theKind = BRepGraph_LayerHistory::Kind::Modified )

Record a modification: theOriginal was replaced by theReplacements.

Note
When theReplacements is empty the record is auto-downgraded to Kind::Deleted and theOriginal is added to the deleted set, regardless of theKind. Use RecordDeleted directly for the deletion case to avoid relying on this implicit conversion.
Parameters
[in]theOpLabelhuman-readable operation name
[in]theOriginalnode id before the operation
[in]theReplacementsnode ids after the operation
[in]theKindclassification of this record (default Modified)

◆ RecordBatch()

void BRepGraph_LayerHistory::RecordBatch ( const TCollection_AsciiString & theOpLabel,
const NCollection_Array1< BRepGraph_NodeId > & theOriginals,
const NCollection_Array1< BRepGraph_NodeId > & theReplacements,
const TCollection_AsciiString & theExtraInfo = TCollection_AsciiString(),
const BRepGraph_LayerHistory::Kind theKind = BRepGraph_LayerHistory::Kind::Modified )

Record a batch of 1-to-1 modifications in a single history event. Each original is paired with the replacement at the same logical position. More efficient than calling Record() in a loop: creates one HistoryRecord and updates the per-kind maps with minimal overhead.

Parameters
[in]theOpLabelhuman-readable operation name
[in]theOriginalsnode ids before the operation
[in]theReplacementsnode ids after the operation (same length)
[in]theExtraInfooptional diagnostic info stored on the record
[in]theKindclassification of this record (default Modified)

◆ RecordDeleted()

void BRepGraph_LayerHistory::RecordDeleted ( const TCollection_AsciiString & theOpLabel,
const NCollection_Array1< BRepGraph_NodeId > & theDeleted )

Record that a collection of inputs has been consumed by the operation and has no image in the result. Each input is appended to the deleted set and emits a single audit record with empty replacements.

Parameters
[in]theOpLabelhuman-readable operation name
[in]theDeletednode ids that have been removed

◆ RecordDeletedItemUid()

void BRepGraph_LayerHistory::RecordDeletedItemUid ( const TCollection_AsciiString & theOpLabel,
const NCollection_Array1< BRepGraph_ItemUID > & theDeleted )

Record ItemUID-keyed deletions.

◆ RecordDeletedUid()

void BRepGraph_LayerHistory::RecordDeletedUid ( const TCollection_AsciiString & theOpLabel,
const NCollection_Array1< BRepGraph_UID > & theDeleted )

Record UID-keyed deletions.

◆ RecordItemUid()

void BRepGraph_LayerHistory::RecordItemUid ( const TCollection_AsciiString & theOpLabel,
const BRepGraph_ItemUID & theOriginal,
const NCollection_Array1< BRepGraph_ItemUID > & theReplacements,
const BRepGraph_LayerHistory::Kind theKind = BRepGraph_LayerHistory::Kind::Modified )

Record an all-domain ItemUID-keyed modification/generation event.

◆ RecordReplaced()

void BRepGraph_LayerHistory::RecordReplaced ( const TCollection_AsciiString & theOpLabel,
const BRepGraph_NodeId theOriginal,
const BRepGraph_NodeId theReplacement )

Record replacements: each original is logically removed/detached and continued by the corresponding replacement. Replaced records participate in modified-image queries and also mark originals as deleted.

◆ RecordReplacedBatch()

void BRepGraph_LayerHistory::RecordReplacedBatch ( const TCollection_AsciiString & theOpLabel,
const NCollection_Array1< BRepGraph_NodeId > & theOriginals,
const NCollection_Array1< BRepGraph_NodeId > & theReplacements,
const TCollection_AsciiString & theExtraInfo = TCollection_AsciiString() )

Record a batch of 1-to-1 replacements in a single history event.

◆ RecordUid()

void BRepGraph_LayerHistory::RecordUid ( const TCollection_AsciiString & theOpLabel,
const BRepGraph_UID & theOriginal,
const NCollection_Array1< BRepGraph_UID > & theReplacements,
const BRepGraph_LayerHistory::Kind theKind = BRepGraph_LayerHistory::Kind::Modified )

Record a UID-keyed modification/generation event.

This is the durable-history path for operations whose source and result identities may live in different BRepGraph instances. Existing NodeId records remain available for in-graph algorithms; UID records are queried directly by cross-graph consumers.

◆ SetEnabled()

void BRepGraph_LayerHistory::SetEnabled ( const bool theVal)

Enable or disable history recording.

Parameters
[in]theValtrue to enable, false to disable

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