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

Base layer for graph-owned parametric generators. More...

#include <BRepGraph_LayerParametric.hxx>

Inheritance diagram for BRepGraph_LayerParametric:

Data Structures

struct  AddResult
 Result of adding a new parametric instance to a graph. More...

Public Types

enum class  GenerationFlag : uint32_t { Topology = 0x01 , Geometry = 0x02 , Mesh = 0x04 }
 Controls which graph artifacts should be created or refreshed. More...
enum class  MeshQuality : uint8_t {
  VeryCoarse , Coarse , Medium , Fine ,
  VeryFine
}
 High-level mesh quality hint shared by parametric generators. More...
typedef void base_type
 Returns a type descriptor about this object.

Static Public Member Functions

static constexpr uint32_t GenerationMask (const GenerationFlag theFlag)
 Convert one generation flag into its bit-mask value.
static constexpr bool HasGenerationFlag (const uint32_t theFlags, const GenerationFlag theFlag)
 Return true when the flag mask contains the requested generation flag.
static constexpr uint32_t MeshQualityValue (const MeshQuality theQuality, const uint32_t theVeryCoarse, const uint32_t theCoarse, const uint32_t theMedium, const uint32_t theFine, const uint32_t theVeryFine)
 Select one integer value from a mesh-quality ladder.
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.

Static Public Attributes

static constexpr uint32_t THE_INVALID_INSTANCE = std::numeric_limits<uint32_t>::max()
 Reserved sentinel used when an operation does not create an instance.
static constexpr uint32_t THE_DEFAULT_GENERATION_FLAGS
 Default generation mode builds topology and analytic geometry only.

Protected Member Functions

BRepGraph * graphForMutation () const
 Return the attached graph and raise if the layer is detached.
occ::handle< BRepGraph_LayerLock > lockLayer (BRepGraph &theGraph) const
 Return the ownership layer used by parametric generators.
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.

Additional Inherited Members

Public Member Functions inherited from BRepGraph_Layer
virtual const Standard_GUID & ID () const =0
 Layer type identity (unique within a graph).
virtual const TCollection_AsciiString & Name () const =0
 Layer identity (unique within a graph).
virtual void OnNodeRemoved (const BRepGraph_NodeId theNode) noexcept
 Called when a node is soft-removed without a replacement.
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 void CopyTo (const BRepGraph_CopyRemap &theCopy) const =0
 Copy this source layer data into another graph. The source graph is the graph this layer is attached to (Graph()).
virtual void InvalidateAll () noexcept=0
 Mark all cached values dirty (bulk invalidation).
virtual void Clear () noexcept=0
 Clear all stored data.
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 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

Base layer for graph-owned parametric generators.

The class defines the common instance identity, generation flags, mesh quality controls, and graph access helpers shared by higher-level parametric layers. Concrete layers such as BRepGraphPrim box, plane, or loft generators build their own parameter schema and manifest storage on top of this base.

Member Enumeration Documentation

◆ GenerationFlag

enum class BRepGraph_LayerParametric::GenerationFlag : uint32_t
strong

Controls which graph artifacts should be created or refreshed.

Enumerator
Topology 

Create or preserve topological nodes and references.

Geometry 

Bind analytic reps; absence keeps generated topology mesh-only.

Mesh 

Create or preserve triangulation representations.

◆ MeshQuality

enum class BRepGraph_LayerParametric::MeshQuality : uint8_t
strong

High-level mesh quality hint shared by parametric generators.

Enumerator
VeryCoarse 

Minimal preview-oriented detail.

Coarse 

Low detail for fast authoring feedback.

Medium 

Balanced default-quality detail.

Fine 

High-quality detail for closer inspection.

VeryFine 

Maximum detail requested by the caller.

Member Function Documentation

◆ GenerationMask()

constexpr uint32_t BRepGraph_LayerParametric::GenerationMask ( const GenerationFlag theFlag)
inlinestaticnodiscardconstexpr

Convert one generation flag into its bit-mask value.

Parameters
[in]theFlaggeneration flag to convert
Returns
bit-mask value for the requested generation flag

◆ graphForMutation()

BRepGraph * BRepGraph_LayerParametric::graphForMutation ( ) const
nodiscardprotected

Return the attached graph and raise if the layer is detached.

Returns
attached graph for mutation operations

◆ HasGenerationFlag()

constexpr bool BRepGraph_LayerParametric::HasGenerationFlag ( const uint32_t theFlags,
const GenerationFlag theFlag )
inlinestaticnodiscardconstexpr

Return true when the flag mask contains the requested generation flag.

Parameters
[in]theFlagsgeneration mask built from GenerationFlag bits
[in]theFlaggeneration flag to test
Returns
true when the flag is present in the mask

◆ lockLayer()

occ::handle< BRepGraph_LayerLock > BRepGraph_LayerParametric::lockLayer ( BRepGraph & theGraph) const
nodiscardprotected

Return the ownership layer used by parametric generators.

Parameters
[in]theGraphgraph whose ownership layer should be returned
Returns
ownership layer handle

◆ MeshQualityValue()

constexpr uint32_t BRepGraph_LayerParametric::MeshQualityValue ( const MeshQuality theQuality,
const uint32_t theVeryCoarse,
const uint32_t theCoarse,
const uint32_t theMedium,
const uint32_t theFine,
const uint32_t theVeryFine )
inlinestaticnodiscardconstexpr

Select one integer value from a mesh-quality ladder.

Parameters
[in]theQualityrequested shared mesh quality
[in]theVeryCoarsevalue for MeshQuality::VeryCoarse
[in]theCoarsevalue for MeshQuality::Coarse
[in]theMediumvalue for MeshQuality::Medium
[in]theFinevalue for MeshQuality::Fine
[in]theVeryFinevalue for MeshQuality::VeryFine
Returns
selected value for the requested quality

Field Documentation

◆ THE_DEFAULT_GENERATION_FLAGS

uint32_t BRepGraph_LayerParametric::THE_DEFAULT_GENERATION_FLAGS
staticconstexpr
Initial value:
=
static_cast<uint32_t>(GenerationFlag::Topology)
| static_cast<uint32_t>(GenerationFlag::Geometry)
@ Topology
Create or preserve topological nodes and references.
Definition BRepGraph_LayerParametric.hxx:37
@ Geometry
Bind analytic reps; absence keeps generated topology mesh-only.
Definition BRepGraph_LayerParametric.hxx:38

Default generation mode builds topology and analytic geometry only.

◆ THE_INVALID_INSTANCE

uint32_t BRepGraph_LayerParametric::THE_INVALID_INSTANCE = std::numeric_limits<uint32_t>::max()
staticconstexpr

Reserved sentinel used when an operation does not create an instance.


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