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 138 of file APEX_COW.h.

Constructor & Destructor Documentation

apex::ApexGeometry::ApexGeometry ( )
inline

Construct an empty ApexGeometry.

Definition at line 142 of file APEX_COW.h.

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

Construct an ApexGeometry referencing a GU_DetailHandle.

Definition at line 150 of file APEX_COW.h.

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

Construct an ApexGeometry referencing a GU_DetailHandle.

Definition at line 156 of file APEX_COW.h.

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

Definition at line 164 of file APEX_COW.h.

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

Definition at line 179 of file APEX_COW.h.

apex::ApexGeometry::~ApexGeometry ( )
inline

Definition at line 271 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 429 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 420 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 405 of file APEX_COW.h.

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

Access the underlying GU_Detail, ensuring uniqueness.

Definition at line 378 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 393 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 386 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 278 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 284 of file APEX_COW.h.

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

Return a reference to the underlying GU_Detail, ensuring uniqueness.

Definition at line 350 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 356 of file APEX_COW.h.

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

Access the underlying GU_Detail, ensuring uniqueness.

Definition at line 363 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 370 of file APEX_COW.h.

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

Definition at line 194 of file APEX_COW.h.

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

Definition at line 231 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 396 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 399 of file APEX_COW.h.


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