OpenVDB  1.1.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CombineArgs< ValueType > Class Template Reference

This struct collects both input and output arguments to "grid combiner" functors used with the tree::TypedGrid::combineExtended() and combine2Extended() methods. ValueType is the value type of the two grids being combined. More...

#include <Types.h>

Public Types

typedef ValueType ValueT

Public Member Functions

 CombineArgs ()
 CombineArgs (const ValueType &a, const ValueType &b, ValueType &result, bool aOn=false, bool bOn=false)
 Use this constructor when the result value is stored externally.
 CombineArgs (const ValueType &a, const ValueType &b, bool aOn=false, bool bOn=false)
 Use this constructor when the result value should be stored in this struct.
const ValueType & a () const
 Get the A input value.
const ValueType & b () const
 Get the B input value.
CombineArgssetResult (const ValueType &val)
 Set the output value.
CombineArgssetARef (const ValueType &a)
 Redirect the A value to a new external source.
CombineArgssetBRef (const ValueType &b)
 Redirect the B value to a new external source.
CombineArgssetResultRef (ValueType &val)
 Redirect the result value to a new external destination.
bool aIsActive () const
bool bIsActive () const
bool resultIsActive () const
CombineArgssetAIsActive (bool b)
 Set the active state of the A value.
CombineArgssetBIsActive (bool b)
 Set the active state of the B value.
CombineArgssetResultIsActive (bool b)
 Set the active state of the output value.
const ValueType & result () const
 Get the output value.
ValueType & result ()
 Get the output value.

Protected Member Functions

void updateResultActive ()

Protected Attributes

const ValueType * mAValPtr
const ValueType * mBValPtr
ValueType mResultVal
ValueType * mResultValPtr
bool mAIsActive
bool mBIsActive
bool mResultIsActive

Detailed Description

template<typename ValueType>
class openvdb::v1_1_0::CombineArgs< ValueType >

This struct collects both input and output arguments to "grid combiner" functors used with the tree::TypedGrid::combineExtended() and combine2Extended() methods. ValueType is the value type of the two grids being combined.

See Also
openvdb/tree/Tree.h for usage information.

Setter methods return references to this object, to facilitate the following usage:

CombineArgs<float> args;
myCombineOp(args.setARef(aVal).setBRef(bVal).setAIsActive(true).setBIsActive(false));

Member Typedef Documentation

typedef ValueType ValueT

Constructor & Destructor Documentation

CombineArgs ( )
inline
CombineArgs ( const ValueType &  a,
const ValueType &  b,
ValueType &  result,
bool  aOn = false,
bool  bOn = false 
)
inline

Use this constructor when the result value is stored externally.

CombineArgs ( const ValueType &  a,
const ValueType &  b,
bool  aOn = false,
bool  bOn = false 
)
inline

Use this constructor when the result value should be stored in this struct.

Member Function Documentation

const ValueType& a ( ) const
inline

Get the A input value.

bool aIsActive ( ) const
inline
Returns
true if the A value is active
const ValueType& b ( ) const
inline

Get the B input value.

bool bIsActive ( ) const
inline
Returns
true if the B value is active
const ValueType& result ( ) const
inline

Get the output value.

ValueType& result ( )
inline

Get the output value.

bool resultIsActive ( ) const
inline
Returns
true if the output value is active
CombineArgs& setAIsActive ( bool  b)
inline

Set the active state of the A value.

CombineArgs& setARef ( const ValueType &  a)
inline

Redirect the A value to a new external source.

CombineArgs& setBIsActive ( bool  b)
inline

Set the active state of the B value.

CombineArgs& setBRef ( const ValueType &  b)
inline

Redirect the B value to a new external source.

CombineArgs& setResult ( const ValueType &  val)
inline

Set the output value.

CombineArgs& setResultIsActive ( bool  b)
inline

Set the active state of the output value.

CombineArgs& setResultRef ( ValueType &  val)
inline

Redirect the result value to a new external destination.

void updateResultActive ( )
inlineprotected

By default, the result value is active if either of the input values is active, but this behavior can be overridden by calling setResultIsActive().

Member Data Documentation

bool mAIsActive
protected
const ValueType* mAValPtr
protected
bool mBIsActive
protected
const ValueType* mBValPtr
protected
bool mResultIsActive
protected
ValueType mResultVal
protected
ValueType* mResultValPtr
protected

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