HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
apex::ApexGeometry Class Reference

#include <APEX_COW.h>

Public Member Functions

 ApexGeometry ()
 Construct an empty ApexGeometry. More...
 
 ApexGeometry (const GU_DetailHandle &gdh)
 Construct an ApexGeometry referencing a GU_DetailHandle. More...
 
 ApexGeometry (GU_DetailHandle &&gdh)
 Construct an ApexGeometry referencing a GU_DetailHandle. More...
 
 ApexGeometry (const ApexGeometry &other)
 
 ApexGeometry (ApexGeometry &&other) noexcept
 
ApexGeometryoperator= (const ApexGeometry &other)
 
ApexGeometryoperator= (ApexGeometry &&other) noexcept
 
 ~ApexGeometry ()
 
bool isUnique () const
 Returns whether the geometry is unique - if so, asUnsafeHandle can be used safely. More...
 
void makeUnique (bool for_overwrite=false)
 
GU_Detailoperator* ()
 Return a reference to the underlying GU_Detail, ensuring uniqueness. More...
 
const GU_Detailoperator* () const
 Return a const reference to the underlying GU_Detail, without ensuring uniqueness. More...
 
GU_Detailoperator-> ()
 Access the underlying GU_Detail, ensuring uniqueness. More...
 
const GU_Detailoperator-> () const
 Access the underlying const GU_Detail, without ensuring uniqueness. More...
 
GU_Detailgdp ()
 Access the underlying GU_Detail, ensuring uniqueness. More...
 
GU_DetailgdpForOverwrite ()
 
const GU_Detailgdp () const
 Access the underlying const GU_Detail, without ensuring uniqueness. More...
 
const GU_Detailpeek () const
 Access the underlying const GU_Detail, without ensuring uniqueness. More...
 
const GU_DetailpeekPtr () const
 Access the underlying const GU_Detail *, without ensuring uniqueness. More...
 
GU_DetailHandleasUnsafeHandle (bool for_overwrite=false)
 
GU_DetailHandleasSafeHandle ()
 Access the underlying GU_DetailHandle while first ensuring it is unique. More...
 
GU_ConstDetailHandle asConstHandle (bool force_copy=false, GA_DataIdStrategy explicit_strategy=GA_DATA_ID_CLONE) const
 

Static Public Member Functions

static APEX_API const
ApexGeometry
getStaticEmptyGeometry ()
 

Detailed Description

APEX wrapper for geometry via GU_DetailHandle. Keeps a much stronger COW guarantee than a raw GU_DetailHandle by using preserve requests to track active APEX-side references to geo. Additionally, it lazily clears geo when reset to its default state via operator= to keep operations like replaceWith and stashAll fast.

Examples:
APEX/apex_external_test.C.

Definition at line 148 of file APEX_COW.h.

Constructor & Destructor Documentation

apex::ApexGeometry::ApexGeometry ( )
inline

Construct an empty ApexGeometry.

Definition at line 152 of file APEX_COW.h.

apex::ApexGeometry::ApexGeometry ( const GU_DetailHandle gdh)
inline

Construct an ApexGeometry referencing a GU_DetailHandle.

Definition at line 160 of file APEX_COW.h.

apex::ApexGeometry::ApexGeometry ( GU_DetailHandle &&  gdh)
inline

Construct an ApexGeometry referencing a GU_DetailHandle.

Definition at line 175 of file APEX_COW.h.

apex::ApexGeometry::ApexGeometry ( const ApexGeometry other)
inline

Definition at line 192 of file APEX_COW.h.

apex::ApexGeometry::ApexGeometry ( ApexGeometry &&  other)
inlinenoexcept

Definition at line 207 of file APEX_COW.h.

apex::ApexGeometry::~ApexGeometry ( )
inline

Definition at line 299 of file APEX_COW.h.

Member Function Documentation

GU_ConstDetailHandle apex::ApexGeometry::asConstHandle ( bool  force_copy = false,
GA_DataIdStrategy  explicit_strategy = GA_DATA_ID_CLONE 
) const
inline

Create a GU_ConstDetailHandle aliasing the current handle; if the calling code will cast away the const, force_copy can be set to call duplicateGeometry first (with the default clone data ID strategy).

Definition at line 457 of file APEX_COW.h.

GU_DetailHandle& apex::ApexGeometry::asSafeHandle ( )
inline

Access the underlying GU_DetailHandle while first ensuring it is unique.

Definition at line 448 of file APEX_COW.h.

GU_DetailHandle& apex::ApexGeometry::asUnsafeHandle ( bool  for_overwrite = false)
inline

Access the underlying detail handle, while only ensuring it is valid (i.e. without ensuring there are no other APEX references to it). Calling code should respect the rule that >1 preserveRequest means that other ApexGeometry objects are expecting the geo not to change.

Definition at line 433 of file APEX_COW.h.

GU_Detail* apex::ApexGeometry::gdp ( )
inline

Access the underlying GU_Detail, ensuring uniqueness.

Definition at line 406 of file APEX_COW.h.

const GU_Detail* apex::ApexGeometry::gdp ( ) const
inline

Access the underlying const GU_Detail, without ensuring uniqueness.

Definition at line 421 of file APEX_COW.h.

GU_Detail* apex::ApexGeometry::gdpForOverwrite ( )
inline

Access the underlying GU_Detail. If the geometry is currently stashed, this can return the old stale geometry so long as it is unique. Otherwise, in any case where the normal access logic would perform a copy, this will return an empty geometry object instead - only returning the actual current data for an unstashed geometry if it is already unique.

This is useful for operations that will completely overwrite the contained geometry.

Definition at line 414 of file APEX_COW.h.

static APEX_API const ApexGeometry& apex::ApexGeometry::getStaticEmptyGeometry ( )
static
bool apex::ApexGeometry::isUnique ( ) const
inline

Returns whether the geometry is unique - if so, asUnsafeHandle can be used safely.

Definition at line 306 of file APEX_COW.h.

void apex::ApexGeometry::makeUnique ( bool  for_overwrite = false)
inline

Ensures the underlying GU_DetailHandle is not being aliased. If for_overwrite is passed, the caller does not care about the actual contents of the geometry - it can be cleared if that would be faster than performing a copy, and stale data should be kept if doing so would not cause aliasing.

Definition at line 312 of file APEX_COW.h.

GU_Detail& apex::ApexGeometry::operator* ( )
inline

Return a reference to the underlying GU_Detail, ensuring uniqueness.

Definition at line 378 of file APEX_COW.h.

const GU_Detail& apex::ApexGeometry::operator* ( ) const
inline

Return a const reference to the underlying GU_Detail, without ensuring uniqueness.

Definition at line 384 of file APEX_COW.h.

GU_Detail* apex::ApexGeometry::operator-> ( )
inline

Access the underlying GU_Detail, ensuring uniqueness.

Definition at line 391 of file APEX_COW.h.

const GU_Detail* apex::ApexGeometry::operator-> ( ) const
inline

Access the underlying const GU_Detail, without ensuring uniqueness.

Definition at line 398 of file APEX_COW.h.

ApexGeometry& apex::ApexGeometry::operator= ( const ApexGeometry other)
inline

Definition at line 222 of file APEX_COW.h.

ApexGeometry& apex::ApexGeometry::operator= ( ApexGeometry &&  other)
inlinenoexcept

Definition at line 259 of file APEX_COW.h.

const GU_Detail& apex::ApexGeometry::peek ( ) const
inline

Access the underlying const GU_Detail, without ensuring uniqueness.

Definition at line 424 of file APEX_COW.h.

const GU_Detail* apex::ApexGeometry::peekPtr ( ) const
inline

Access the underlying const GU_Detail *, without ensuring uniqueness.

Definition at line 427 of file APEX_COW.h.


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