FnUsdEngineLib 0.6.0
All Classes Functions Variables Pages
usg::GeomStateTarget Class Reference

#include <GeomStateTarget.h>

Public Member Functions

 GeomStateTarget (const usg::Token &identifier)
 
const usg::Token & identifier () const
 Identifier string.
 
std::string fullPath () const
 Return the full path of this target and all its parents.
 
void setParent (GeomStateTarget &parent)
 Connect this target to larger group.
 
GeomStateTargetparent () const
 Return the parent target if there is one.
 
const usg::Token & parentId () const
 Return the parent target id if there is one, otherwise an empty token.
 
GeomStateTargetroot ()
 Top parent target, walks up graph.
 
void getParents (GeomStateTargetPtrList &parents) const
 
const GeomStateTargetPtrSet & children () const
 Child targets. All child hashes are included in this target's total hash.
 
void clearConnections ()
 
fdk::Hash hash () const
 
const fdk::Hash & localHash () const
 Current local hash of target without inclusion of parents.
 
void setLocalHash (const fdk::Hash &h)
 Set the target's local hash to a specific value.
 
void appendLocalHash (const fdk::Hash &h)
 Append a hash to the target's local hash.
 
void resetLocalHash ()
 Resets (sets to default value) the local hash.
 
fdk::Hash versionHash () const
 Total version hash including all children. Built the same way as hash().
 
fdk::Hash localVersionHash () const
 Current version hash of the local hash.
 
void setLocalVersionHash (const fdk::Hash &h)
 Set the target's local version hash to a specific value.
 
void appendLocalVersionHash (const fdk::Hash &h)
 Append a hash to the target's local version hash.
 
void resetLocalVersionHash ()
 Resets (sets to default value) the local version hash.
 
bool isAnimating () const
 Is this target or any of the contributing children animating?
 
bool isLocalHashAnimating () const
 Is the local hash expected to animate over time?
 
void setIsLocalHashAnimating (bool isAnimating)
 Set the local animation indicator to a specific state.
 
void enableVaryingOutputHash ()
 Enable the local animation indicator.
 
void resetAll ()
 Resets the local hash and animation state, and all child targets recursively.
 

Protected Attributes

usg::Token _identifier
 Should be unique so that shared target identifiers can be used.
 
fdk::Hash _localHash
 Target's local hash contribution.
 
fdk::Hash _localVersionHash
 Local version number hash.
 
bool _animating
 Is the target's local hash expected to change over time.
 
GeomStateTarget_parent
 If a child of another target.
 
GeomStateTargetPtrSet _children
 Child targets contributing to this target's hash.
 

Detailed Description

A named 'target' that values are contributing to.

A 'target' can be abstractly thought of as something that a GeomEngine affects or will process, and its dirty/clean state is changed by arbitrary local values, input values, input GeomEngine, etc.

Examples of named targets could be 'define-geometry', 'modify-attribute', 'prim-xform', 'image-size', 'blur-channel', 'image-position', etc.

Interconnected targets form a group hierachy and all the targets inside a group contribute to the groups's hash and thus form a simple dependency graph.

Some example target paths: define-geometry define-geometry:define-mesh define-geometry:define-mesh:define-points define-geometry:define-mesh:define-texcoords define-geometry:import-layer modify-values:modify-points modify-values:modify-texcoords

The total hash result is not cached in this class as caching the result would mean keeping track of the hierarchy state somehow. It is assumed that this object will be managed by GeomEngines or some other state tracking mechanism that can call reset(), or resetAll() to clear the state.

Member Function Documentation

◆ getParents()

void usg::GeomStateTarget::getParents ( GeomStateTargetPtrList &  parents) const

Returns a list of this target and its parents, where the root target is entry 0 and the last entry is this target.

◆ clearConnections()

void usg::GeomStateTarget::clearConnections ( )

Removes child targets and their associated connections in parent/child targets. Does not affect local hash.

◆ hash()

fdk::Hash usg::GeomStateTarget::hash ( ) const

Total hash of target including all children. This recursively calls all the child hash() methods and the final result is returned but not cached in this class. It's assumed to be cached and dirty-managed elsewhere.

Warning, no recursion or loop testing is performed!



©2025 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk