![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Extracted history subsystem for BRepGraph. More...
#include <BRepGraph_History.hxx>
Public Member Functions | |
| void | Record (const TCollection_AsciiString &theOpLabel, const BRepGraph_NodeId theOriginal, const NCollection_DynamicArray< BRepGraph_NodeId > &theReplacements) |
| Record a modification: theOriginal was replaced by theReplacements. | |
| void | RecordBatch (const TCollection_AsciiString &theOpLabel, const NCollection_DynamicArray< BRepGraph_NodeId > &theOriginals, const NCollection_DynamicArray< BRepGraph_NodeId > &theReplacements, const TCollection_AsciiString &theExtraInfo=TCollection_AsciiString()) |
| Record a batch of 1-to-1 modifications in a single history event. theOriginals[i] was replaced by theReplacements[i]. More efficient than calling Record() in a loop: creates one HistoryRecord and updates the bidirectional maps with minimal overhead. | |
| 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_DynamicArray< BRepGraph_NodeId > | FindDerived (const BRepGraph_NodeId theOriginal) const |
| Walk forwards from an original node to all derived nodes. Follows the forward map recursively, collecting all leaves. | |
| size_t | NbRecords () const |
| Number of recorded history events. | |
| const BRepGraph_HistoryRecord & | 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 () |
| Clear all records and lookup maps. | |
| void | SetAllocator (const occ::handle< NCollection_BaseAllocator > &theAlloc) |
| Set the allocator for internal containers. Must be called before any Record/RecordBatch calls. | |
Extracted history subsystem for BRepGraph.
BRepGraph_History maintains an append-only log of modification events and bidirectional lookup maps (original <-> derived) for efficient history queries. Recording can be toggled on/off at runtime.
| void BRepGraph_History::Clear | ( | ) |
Clear all records and lookup maps.
| NCollection_DynamicArray< BRepGraph_NodeId > BRepGraph_History::FindDerived | ( | const BRepGraph_NodeId | theOriginal | ) | const |
Walk forwards from an original node to all derived nodes. Follows the forward map recursively, collecting all leaves.
| [in] | theOriginal | node id to trace forward |
| BRepGraph_NodeId BRepGraph_History::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.
| [in] | theModified | node id to trace back |
| bool BRepGraph_History::IsEnabled | ( | ) | const |
Query whether history recording is enabled.
| size_t BRepGraph_History::NbRecords | ( | ) | const |
Number of recorded history events.
| const BRepGraph_HistoryRecord & BRepGraph_History::Record | ( | const size_t | theRecordIdx | ) | const |
Access a record by index (0-based).
| [in] | theRecordIdx | zero-based index into the records vector |
| void BRepGraph_History::Record | ( | const TCollection_AsciiString & | theOpLabel, |
| const BRepGraph_NodeId | theOriginal, | ||
| const NCollection_DynamicArray< BRepGraph_NodeId > & | theReplacements ) |
Record a modification: theOriginal was replaced by theReplacements.
| [in] | theOpLabel | human-readable operation name |
| [in] | theOriginal | node id before the operation |
| [in] | theReplacements | node ids after the operation |
| void BRepGraph_History::RecordBatch | ( | const TCollection_AsciiString & | theOpLabel, |
| const NCollection_DynamicArray< BRepGraph_NodeId > & | theOriginals, | ||
| const NCollection_DynamicArray< BRepGraph_NodeId > & | theReplacements, | ||
| const TCollection_AsciiString & | theExtraInfo = TCollection_AsciiString() ) |
Record a batch of 1-to-1 modifications in a single history event. theOriginals[i] was replaced by theReplacements[i]. More efficient than calling Record() in a loop: creates one HistoryRecord and updates the bidirectional maps with minimal overhead.
| [in] | theOpLabel | human-readable operation name |
| [in] | theOriginals | node ids before the operation |
| [in] | theReplacements | node ids after the operation (same length) |
| [in] | theExtraInfo | optional diagnostic info stored on the record |
| void BRepGraph_History::SetAllocator | ( | const occ::handle< NCollection_BaseAllocator > & | theAlloc | ) |
Set the allocator for internal containers. Must be called before any Record/RecordBatch calls.
| [in] | theAlloc | allocator to use for internal maps |
Enable or disable history recording.
| [in] | theVal | true to enable, false to disable |