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

Registry-owned runtime mesh cache for BRepGraph. More...

#include <BRepGraph_CacheMesh.hxx>

Inheritance diagram for BRepGraph_CacheMesh:

Data Structures

struct  CoEdgeMeshEntry
 Cached mesh entry for a coedge: polygon-in-parametric-space and polygon-on-triangulation. More...
struct  DirtySet
 Dirty topology set requested from a cache driver. More...
class  Driver
 Mesh recomputation driver registered by a meshing toolkit. More...
struct  EdgeMeshEntry
 Cached mesh entry for an edge: polygon-3D. More...
struct  EntryStamp
 Entry stamp against the slot recipe and cache-local generation. More...
struct  FaceMeshEntry
 Cached mesh entry for a face: single triangulation. More...
struct  SlotState
 Runtime state of a cache slot. More...

Public Types

using SlotId = uint32_t
typedef void base_type
 Returns a type descriptor about this object.

Public Member Functions

 BRepGraph_CacheMesh ()
 BRepGraph_CacheMesh (const BRepGraph_CacheMesh &)=delete
BRepGraph_CacheMesh & operator= (const BRepGraph_CacheMesh &)=delete
const Standard_GUID & ID () const override
 Returns the unique cache service GUID.
const TCollection_AsciiString & Name () const override
 Returns the cache service display name.
void Clear () noexcept override
 Clears all cache slots and registered drivers.
void CopyFreshTo (const BRepGraph_CopyRemap &theCopy) const override
 Copy fresh, remappable mesh cache entries into the target graph.
SlotId ActiveDisplaySlot () const
 Get/set the currently active display slot. EffectiveView reads from this slot.
void SetActiveDisplaySlot (SlotId theSlot)
void RegisterDriver (SlotId theSlot, const occ::handle< Driver > &theDriver)
 Register or replace a meshing driver for a cache slot.
void UnregisterDriver (SlotId theSlot)
 Remove a meshing driver from a cache slot and invalidate the slot.
const occ::handle< Driver > & DriverOf (SlotId theSlot) const
 Return driver registered for a slot, or null.
SlotState State (SlotId theSlot=DefaultDisplaySlot) const
 Return current state of a cache slot.
bool Ensure (BRepGraph &theGraph, SlotId theSlot=DefaultDisplaySlot, const Message_ProgressRange &theRange=Message_ProgressRange())
 Recompute stale data in a slot using its registered driver.
bool Ensure (BRepGraph &theGraph, const BRepGraph_NodeId theRoot, SlotId theSlot=DefaultDisplaySlot, const Message_ProgressRange &theRange=Message_ProgressRange())
 Recompute stale data below a topology node using the slot driver.
bool Ensure (BRepGraph &theGraph, const NCollection_Array1< BRepGraph_NodeId > &theNodes, SlotId theSlot=DefaultDisplaySlot, const Message_ProgressRange &theRange=Message_ProgressRange())
 Recompute stale data for requested topology nodes using the slot driver.
bool Needs (BRepGraph &theGraph, BRepGraph_NodeId theRoot, SlotId theSlot=DefaultDisplaySlot) const
 Return true when a cache slot has stale or missing mesh below the topology node. Uses the same actualness rules as Ensure() but does not invoke the driver.
bool HasFaceMesh (BRepGraph_FaceId theFace) const
const FaceMeshEntry * FindFaceMesh (BRepGraph_FaceId theFace) const
FaceMeshEntry & ChangeFaceMesh (BRepGraph_FaceId theFace)
void ClearFaceMesh (BRepGraph_FaceId theFace)
bool HasCoEdgeMesh (BRepGraph_CoEdgeId theCoEdge) const
CoEdgeMeshEntry & ChangeCoEdgeMesh (BRepGraph_CoEdgeId theCoEdge)
void ClearCoEdgeMesh (BRepGraph_CoEdgeId theCoEdge)
bool HasEdgeMesh (BRepGraph_EdgeId theEdge) const
const EdgeMeshEntry * FindEdgeMesh (BRepGraph_EdgeId theEdge) const
EdgeMeshEntry & ChangeEdgeMesh (BRepGraph_EdgeId theEdge)
void ClearEdgeMesh (BRepGraph_EdgeId theEdge)
bool HasFaceMesh (SlotId theSlot, BRepGraph_FaceId theFace) const
const FaceMeshEntry * FindFaceMesh (SlotId theSlot, BRepGraph_FaceId theFace) const
FaceMeshEntry & ChangeFaceMesh (SlotId theSlot, BRepGraph_FaceId theFace)
void ClearFaceMesh (SlotId theSlot, BRepGraph_FaceId theFace)
bool HasCoEdgeMesh (SlotId theSlot, BRepGraph_CoEdgeId theCoEdge) const
CoEdgeMeshEntry & ChangeCoEdgeMesh (SlotId theSlot, BRepGraph_CoEdgeId theCoEdge)
void ClearCoEdgeMesh (SlotId theSlot, BRepGraph_CoEdgeId theCoEdge)
bool HasEdgeMesh (SlotId theSlot, BRepGraph_EdgeId theEdge) const
const EdgeMeshEntry * FindEdgeMesh (SlotId theSlot, BRepGraph_EdgeId theEdge) const
EdgeMeshEntry & ChangeEdgeMesh (SlotId theSlot, BRepGraph_EdgeId theEdge)
void ClearEdgeMesh (SlotId theSlot, BRepGraph_EdgeId theEdge)
void BindFresh (FaceMeshEntry &theEntry, BRepGraph_FaceId theFace) const
 Stamp a freshly written default-slot entry.
void BindFresh (CoEdgeMeshEntry &theEntry, BRepGraph_CoEdgeId theCoEdge) const
void BindFresh (EdgeMeshEntry &theEntry, BRepGraph_EdgeId theEdge) const
void BumpFaceMeshGeneration (BRepGraph_FaceId theFace, SlotId theSlot=DefaultDisplaySlot)
 Bump face mesh generation after cached content changed. This is the ONLY mutator for MeshGeneration. ClearRepresentation() does not bump. Creates the face entry if it doesn't exist yet (via ensureSize).
const FaceMeshEntry * findFaceEntryRaw (SlotId theSlot, BRepGraph_FaceId theFace) const
 Raw face entry access (no freshness filtering). For internal use.
const CoEdgeMeshEntry * findCoEdgeEntryRaw (SlotId theSlot, BRepGraph_CoEdgeId theCoEdge) const
 Raw coedge entry access (no freshness/generation filtering). Returns nullptr if the slot is absent or the entry has no representation. For internal use.
const CoEdgeMeshEntry * FindCoEdgePolygon2D (SlotId theSlot, BRepGraph_CoEdgeId theCoEdge) const
 Return coedge entry if Polygon2D is fresh, nullptr otherwise.
const CoEdgeMeshEntry * FindCoEdgePolygonOnTri (SlotId theSlot, BRepGraph_CoEdgeId theCoEdge) const
 Return coedge entry if PolygonsOnTri is fresh, nullptr otherwise.
const CoEdgeMeshEntry * FindCoEdgePolygon2D (BRepGraph_CoEdgeId theCoEdge) const
 Return coedge entry if Polygon2D is fresh (default slot), nullptr otherwise.
const CoEdgeMeshEntry * FindCoEdgePolygonOnTri (BRepGraph_CoEdgeId theCoEdge) const
 Return coedge entry if PolygonsOnTri is fresh (default slot), nullptr otherwise.
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 ()
 Returns the unique cache service GUID.
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.

Static Public Attributes

static constexpr SlotId DefaultDisplaySlot = 0

Additional Inherited Members

Protected Member Functions inherited from BRepGraph_Cache
 BRepGraph_Cache ()
bool IsAttached () const noexcept
 True while this cache is registered in a live graph registry.
const BRepGraph & Graph () const
 Attached graph for read-only cache services. Raises Standard_ProgramError if detached.
BRepGraph * AttachedGraph () const noexcept
 Attached mutable graph for graph-owned cache services. Returns null if detached.
virtual void OnAttached () noexcept
 Called after the cache is attached to a graph registry.
virtual void OnDetached () noexcept
 Called before the cache is detached from a graph registry.
bool NodeSubtreeGen (const BRepGraph_NodeId theNode, uint32_t &theGen) const noexcept
 Return current SubtreeGen for an active node.
bool NodeOwnGen (const BRepGraph_NodeId theNode, uint32_t &theGen) const noexcept
 Return current OwnGen for an active node.
bool RefOwnGen (const BRepGraph_RefId theRef, uint32_t &theGen) const noexcept
 Return current OwnGen for an active reference.
bool ItemOwnGen (const BRepGraph_ItemId theItem, uint32_t &theGen) const noexcept
 Return current OwnGen for an active graph item.
bool ResolveActiveRefChild (const BRepGraph_RefId theRef, BRepGraph_NodeId &theNode) const noexcept
 Resolve an active reference to its active child node.
bool ResolveActiveFaceRef (const BRepGraph_FaceRefId theRef, BRepGraph_FaceId &theFace) const noexcept
 Resolve an active face reference to its active face node.

Detailed Description

Registry-owned runtime mesh cache for BRepGraph.

CacheMesh stores transient triangulations and polygons produced by meshing drivers. It is not copied, transformed, or serialized. Persistent mesh representations remain in topology definitions and are filled only by import, authored primitive creation, or explicit promotion.

Member Typedef Documentation

◆ SlotId

using BRepGraph_CacheMesh::SlotId = uint32_t

Constructor & Destructor Documentation

◆ BRepGraph_CacheMesh() [1/2]

BRepGraph_CacheMesh::BRepGraph_CacheMesh ( )

◆ BRepGraph_CacheMesh() [2/2]

BRepGraph_CacheMesh::BRepGraph_CacheMesh ( const BRepGraph_CacheMesh & )
delete

Member Function Documentation

◆ ActiveDisplaySlot()

SlotId BRepGraph_CacheMesh::ActiveDisplaySlot ( ) const
inlinenodiscard

Get/set the currently active display slot. EffectiveView reads from this slot.

◆ BindFresh() [1/3]

void BRepGraph_CacheMesh::BindFresh ( CoEdgeMeshEntry & theEntry,
BRepGraph_CoEdgeId theCoEdge ) const

◆ BindFresh() [2/3]

void BRepGraph_CacheMesh::BindFresh ( EdgeMeshEntry & theEntry,
BRepGraph_EdgeId theEdge ) const

◆ BindFresh() [3/3]

void BRepGraph_CacheMesh::BindFresh ( FaceMeshEntry & theEntry,
BRepGraph_FaceId theFace ) const

Stamp a freshly written default-slot entry.

◆ BumpFaceMeshGeneration()

void BRepGraph_CacheMesh::BumpFaceMeshGeneration ( BRepGraph_FaceId theFace,
SlotId theSlot = DefaultDisplaySlot )

Bump face mesh generation after cached content changed. This is the ONLY mutator for MeshGeneration. ClearRepresentation() does not bump. Creates the face entry if it doesn't exist yet (via ensureSize).

◆ ChangeCoEdgeMesh() [1/2]

CoEdgeMeshEntry & BRepGraph_CacheMesh::ChangeCoEdgeMesh ( BRepGraph_CoEdgeId theCoEdge)
nodiscard

◆ ChangeCoEdgeMesh() [2/2]

CoEdgeMeshEntry & BRepGraph_CacheMesh::ChangeCoEdgeMesh ( SlotId theSlot,
BRepGraph_CoEdgeId theCoEdge )
nodiscard

◆ ChangeEdgeMesh() [1/2]

EdgeMeshEntry & BRepGraph_CacheMesh::ChangeEdgeMesh ( BRepGraph_EdgeId theEdge)
nodiscard

◆ ChangeEdgeMesh() [2/2]

EdgeMeshEntry & BRepGraph_CacheMesh::ChangeEdgeMesh ( SlotId theSlot,
BRepGraph_EdgeId theEdge )
nodiscard

◆ ChangeFaceMesh() [1/2]

FaceMeshEntry & BRepGraph_CacheMesh::ChangeFaceMesh ( BRepGraph_FaceId theFace)
nodiscard

◆ ChangeFaceMesh() [2/2]

FaceMeshEntry & BRepGraph_CacheMesh::ChangeFaceMesh ( SlotId theSlot,
BRepGraph_FaceId theFace )
nodiscard

◆ Clear()

void BRepGraph_CacheMesh::Clear ( )
overridevirtualnoexcept

Clears all cache slots and registered drivers.

Reimplemented from BRepGraph_Cache.

◆ ClearCoEdgeMesh() [1/2]

void BRepGraph_CacheMesh::ClearCoEdgeMesh ( BRepGraph_CoEdgeId theCoEdge)

◆ ClearCoEdgeMesh() [2/2]

void BRepGraph_CacheMesh::ClearCoEdgeMesh ( SlotId theSlot,
BRepGraph_CoEdgeId theCoEdge )

◆ ClearEdgeMesh() [1/2]

void BRepGraph_CacheMesh::ClearEdgeMesh ( BRepGraph_EdgeId theEdge)

◆ ClearEdgeMesh() [2/2]

void BRepGraph_CacheMesh::ClearEdgeMesh ( SlotId theSlot,
BRepGraph_EdgeId theEdge )

◆ ClearFaceMesh() [1/2]

void BRepGraph_CacheMesh::ClearFaceMesh ( BRepGraph_FaceId theFace)

◆ ClearFaceMesh() [2/2]

void BRepGraph_CacheMesh::ClearFaceMesh ( SlotId theSlot,
BRepGraph_FaceId theFace )

◆ CopyFreshTo()

void BRepGraph_CacheMesh::CopyFreshTo ( const BRepGraph_CopyRemap & theCopy) const
overridevirtual

Copy fresh, remappable mesh cache entries into the target graph.

Reimplemented from BRepGraph_Cache.

◆ DriverOf()

const occ::handle< Driver > & BRepGraph_CacheMesh::DriverOf ( SlotId theSlot) const
nodiscard

Return driver registered for a slot, or null.

◆ Ensure() [1/3]

bool BRepGraph_CacheMesh::Ensure ( BRepGraph & theGraph,
const BRepGraph_NodeId theRoot,
SlotId theSlot = DefaultDisplaySlot,
const Message_ProgressRange & theRange = Message_ProgressRange() )
nodiscard

Recompute stale data below a topology node using the slot driver.

◆ Ensure() [2/3]

bool BRepGraph_CacheMesh::Ensure ( BRepGraph & theGraph,
const NCollection_Array1< BRepGraph_NodeId > & theNodes,
SlotId theSlot = DefaultDisplaySlot,
const Message_ProgressRange & theRange = Message_ProgressRange() )
nodiscard

Recompute stale data for requested topology nodes using the slot driver.

◆ Ensure() [3/3]

bool BRepGraph_CacheMesh::Ensure ( BRepGraph & theGraph,
SlotId theSlot = DefaultDisplaySlot,
const Message_ProgressRange & theRange = Message_ProgressRange() )
nodiscard

Recompute stale data in a slot using its registered driver.

◆ findCoEdgeEntryRaw()

const CoEdgeMeshEntry * BRepGraph_CacheMesh::findCoEdgeEntryRaw ( SlotId theSlot,
BRepGraph_CoEdgeId theCoEdge ) const
nodiscard

Raw coedge entry access (no freshness/generation filtering). Returns nullptr if the slot is absent or the entry has no representation. For internal use.

◆ FindCoEdgePolygon2D() [1/2]

const CoEdgeMeshEntry * BRepGraph_CacheMesh::FindCoEdgePolygon2D ( BRepGraph_CoEdgeId theCoEdge) const
nodiscard

Return coedge entry if Polygon2D is fresh (default slot), nullptr otherwise.

◆ FindCoEdgePolygon2D() [2/2]

const CoEdgeMeshEntry * BRepGraph_CacheMesh::FindCoEdgePolygon2D ( SlotId theSlot,
BRepGraph_CoEdgeId theCoEdge ) const
nodiscard

Return coedge entry if Polygon2D is fresh, nullptr otherwise.

◆ FindCoEdgePolygonOnTri() [1/2]

const CoEdgeMeshEntry * BRepGraph_CacheMesh::FindCoEdgePolygonOnTri ( BRepGraph_CoEdgeId theCoEdge) const
nodiscard

Return coedge entry if PolygonsOnTri is fresh (default slot), nullptr otherwise.

◆ FindCoEdgePolygonOnTri() [2/2]

const CoEdgeMeshEntry * BRepGraph_CacheMesh::FindCoEdgePolygonOnTri ( SlotId theSlot,
BRepGraph_CoEdgeId theCoEdge ) const
nodiscard

Return coedge entry if PolygonsOnTri is fresh, nullptr otherwise.

◆ FindEdgeMesh() [1/2]

const EdgeMeshEntry * BRepGraph_CacheMesh::FindEdgeMesh ( BRepGraph_EdgeId theEdge) const
nodiscard

◆ FindEdgeMesh() [2/2]

const EdgeMeshEntry * BRepGraph_CacheMesh::FindEdgeMesh ( SlotId theSlot,
BRepGraph_EdgeId theEdge ) const
nodiscard

◆ findFaceEntryRaw()

const FaceMeshEntry * BRepGraph_CacheMesh::findFaceEntryRaw ( SlotId theSlot,
BRepGraph_FaceId theFace ) const
nodiscard

Raw face entry access (no freshness filtering). For internal use.

◆ FindFaceMesh() [1/2]

const FaceMeshEntry * BRepGraph_CacheMesh::FindFaceMesh ( BRepGraph_FaceId theFace) const
nodiscard

◆ FindFaceMesh() [2/2]

const FaceMeshEntry * BRepGraph_CacheMesh::FindFaceMesh ( SlotId theSlot,
BRepGraph_FaceId theFace ) const
nodiscard

◆ GetID()

const Standard_GUID & BRepGraph_CacheMesh::GetID ( )
staticnodiscard

Returns the unique cache service GUID.

◆ HasCoEdgeMesh() [1/2]

bool BRepGraph_CacheMesh::HasCoEdgeMesh ( BRepGraph_CoEdgeId theCoEdge) const
nodiscard

◆ HasCoEdgeMesh() [2/2]

bool BRepGraph_CacheMesh::HasCoEdgeMesh ( SlotId theSlot,
BRepGraph_CoEdgeId theCoEdge ) const
nodiscard

◆ HasEdgeMesh() [1/2]

bool BRepGraph_CacheMesh::HasEdgeMesh ( BRepGraph_EdgeId theEdge) const
nodiscard

◆ HasEdgeMesh() [2/2]

bool BRepGraph_CacheMesh::HasEdgeMesh ( SlotId theSlot,
BRepGraph_EdgeId theEdge ) const
nodiscard

◆ HasFaceMesh() [1/2]

bool BRepGraph_CacheMesh::HasFaceMesh ( BRepGraph_FaceId theFace) const
nodiscard

◆ HasFaceMesh() [2/2]

bool BRepGraph_CacheMesh::HasFaceMesh ( SlotId theSlot,
BRepGraph_FaceId theFace ) const
nodiscard

◆ ID()

const Standard_GUID & BRepGraph_CacheMesh::ID ( ) const
nodiscardoverridevirtual

Returns the unique cache service GUID.

Implements BRepGraph_Cache.

◆ Name()

const TCollection_AsciiString & BRepGraph_CacheMesh::Name ( ) const
nodiscardoverridevirtual

Returns the cache service display name.

Implements BRepGraph_Cache.

◆ Needs()

bool BRepGraph_CacheMesh::Needs ( BRepGraph & theGraph,
BRepGraph_NodeId theRoot,
SlotId theSlot = DefaultDisplaySlot ) const
nodiscard

Return true when a cache slot has stale or missing mesh below the topology node. Uses the same actualness rules as Ensure() but does not invoke the driver.

◆ operator=()

BRepGraph_CacheMesh & BRepGraph_CacheMesh::operator= ( const BRepGraph_CacheMesh & )
delete

◆ RegisterDriver()

void BRepGraph_CacheMesh::RegisterDriver ( SlotId theSlot,
const occ::handle< Driver > & theDriver )

Register or replace a meshing driver for a cache slot.

◆ SetActiveDisplaySlot()

void BRepGraph_CacheMesh::SetActiveDisplaySlot ( SlotId theSlot)
inline

◆ State()

SlotState BRepGraph_CacheMesh::State ( SlotId theSlot = DefaultDisplaySlot) const
nodiscard

Return current state of a cache slot.

◆ UnregisterDriver()

void BRepGraph_CacheMesh::UnregisterDriver ( SlotId theSlot)

Remove a meshing driver from a cache slot and invalidate the slot.

Field Documentation

◆ DefaultDisplaySlot

SlotId BRepGraph_CacheMesh::DefaultDisplaySlot = 0
staticconstexpr

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