HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GABC_NAMESPACE::GABC_Util::Walker Class Referenceabstract

#include <GABC_Util.h>

+ Inheritance diagram for GABC_NAMESPACE::GABC_Util::Walker:

Public Member Functions

 Walker ()
 
virtual ~Walker ()
 
virtual bool preProcess (const GABC_IObject &node)
 
virtual bool process (const GABC_IObject &node)=0
 
virtual bool interrupted () const
 Allow for interruption of walk. More...
 
bool walkChildren (const GABC_IObject &node)
 
void computeTimeRange (const GABC_IObject &obj)
 
bool computedValidTimeRange () const
 Returns true if a valid time range has been computed during the walk. More...
 
fpreal getStartTime () const
 Get global start and end times, computed when walking the archive. More...
 
fpreal getEndTime () const
 
bool badArchive () const
 Return whether the walking error was caused by a bad Alembic archive. More...
 
const std::vector< std::string > & filenames () const
 
void setFilenames (const std::vector< std::string > &f)
 

Friends

class GABC_Util
 

Detailed Description

Class used in traversal of Alembic trees

For standard walking of the tree, you'd likely have a process() method like this:

bool process(const GABC_IObject &node)
{
doSomething(node);
return true; // Process other nodes
}

However, if you have to pass information to the child nodes, you might want to do something like:

bool process(const GABC_IObject &node)
{
doSomething(node); // Process this node
pushState(); // Set information for kids
walkChildren(node);
popState(); // Restore parent's state
return false; // Don't let parent walk kids
}

Definition at line 94 of file GABC_Util.h.

Constructor & Destructor Documentation

GABC_NAMESPACE::GABC_Util::Walker::Walker ( )
inline

Definition at line 97 of file GABC_Util.h.

virtual GABC_NAMESPACE::GABC_Util::Walker::~Walker ( )
inlinevirtual

Definition at line 104 of file GABC_Util.h.

Member Function Documentation

bool GABC_NAMESPACE::GABC_Util::Walker::badArchive ( ) const
inline

Return whether the walking error was caused by a bad Alembic archive.

Definition at line 144 of file GABC_Util.h.

bool GABC_NAMESPACE::GABC_Util::Walker::computedValidTimeRange ( ) const
inline

Returns true if a valid time range has been computed during the walk.

Definition at line 128 of file GABC_Util.h.

void GABC_NAMESPACE::GABC_Util::Walker::computeTimeRange ( const GABC_IObject obj)

Recomputes the time range of the archive given a new object during a walk.

const std::vector<std::string>& GABC_NAMESPACE::GABC_Util::Walker::filenames ( ) const
inline

Access the current filenames

Definition at line 138 of file GABC_Util.h.

fpreal GABC_NAMESPACE::GABC_Util::Walker::getEndTime ( ) const
inline

Definition at line 134 of file GABC_Util.h.

fpreal GABC_NAMESPACE::GABC_Util::Walker::getStartTime ( ) const
inline

Get global start and end times, computed when walking the archive.

Definition at line 132 of file GABC_Util.h.

virtual bool GABC_NAMESPACE::GABC_Util::Walker::interrupted ( ) const
inlinevirtual

Allow for interruption of walk.

Reimplemented in GABC_NAMESPACE::GABC_GEOWalker.

Definition at line 117 of file GABC_Util.h.

virtual bool GABC_NAMESPACE::GABC_Util::Walker::preProcess ( const GABC_IObject node)
inlinevirtual

preProcess() is called on the "root" of the walk. The root may not be the root of the Alembic file (i.e. when walking lists of objects). The preProcess() method will be called one time only.

Reimplemented in GABC_NAMESPACE::GABC_GEOWalker.

Definition at line 109 of file GABC_Util.h.

virtual bool GABC_NAMESPACE::GABC_Util::Walker::process ( const GABC_IObject node)
pure virtual

Return true to continue traveral and process the children of the given node. Returning false will process the next sibling. Use interrupted() to perform an early termination.

Implemented in GABC_NAMESPACE::GABC_GEOWalker.

void GABC_NAMESPACE::GABC_Util::Walker::setFilenames ( const std::vector< std::string > &  f)
inline

Access the current filenames

Definition at line 139 of file GABC_Util.h.

bool GABC_NAMESPACE::GABC_Util::Walker::walkChildren ( const GABC_IObject node)

Manually walk children of the given node. Returns false if the walk was interrupted, true if the walk was completed.

Friends And Related Function Documentation

friend class GABC_Util
friend

Definition at line 153 of file GABC_Util.h.


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