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

#include <BRAY_Interface.h>

Public Member Functions

 OptionSet ()
 
 OptionSet (const OptionSet &src)
 
 OptionSet (const VPRM_OptionSetPtr &o)
 
 ~OptionSet ()
 
OptionSetoperator= (const OptionSet &o)
 
OptionSet duplicate () const
 
bool canErase (int token) const
 
void erase (const UT_Set< int > &tokens)
 Erase properties. More...
 
SYS_SAFE_BOOL operator bool () const
 
exint numProperties () const
 Return the number of pre-defined properties in the option set. More...
 
const UT_StringHoldername (int token) const
 Return the name associated with a given option (i.e. dicingquality) More...
 
UT_StringHolder fullName (int token) const
 Return the fully qualified name (i.e. karma::object::dicingquality) More...
 
int find (const UT_StringRef &name) const
 Return the token associated with a given name (or -1 if invalid) More...
 
template<typename T >
const T * import (int token, T *val, size_t n) const
 
template<typename T >
bool set (int token, const T *value, exint tuple_size)
 
template<typename T >
SYS_FORCE_INLINE bool set (int token, const T &value)
 Simple interface to set a scalar property. More...
 
template<typename T >
bool isEqual (int token, const T *value, exint tuple_size) const
 Test whether a value is the same as the current property. More...
 
template<typename T >
SYS_FORCE_INLINE bool isEqual (int token, const T &value) const
 Simple interface for equality of a scalar value. More...
 
bool isVariadic (int token) const
 Test whether an option has variadic arguments. More...
 
exint size (int token) const
 Return the size of an option. This can be used for variadics. More...
 
GT_Storage storage (int token) const
 
bool isValid () const
 
VPRM_OptionSetPtroptions ()
 
const VPRM_OptionSetPtroptions () const
 
const bool * bval (int token) const
 
const int64ival (int token) const
 
const fpreal64fval (int token) const
 
const UT_StringHoldersval (int token) const
 

Detailed Description

The OptionSet acts as a pointer to an underlying set of options for various different object types.

Definition at line 108 of file BRAY_Interface.h.

Constructor & Destructor Documentation

BRAY::OptionSet::OptionSet ( )
BRAY::OptionSet::OptionSet ( const OptionSet src)

The copy c-tor will copy the underlying pointer, but refer to the same underlying object.

BRAY::OptionSet::OptionSet ( const VPRM_OptionSetPtr o)
explicit
BRAY::OptionSet::~OptionSet ( )

Member Function Documentation

const bool* BRAY::OptionSet::bval ( int  token) const

Direct access to internal option data. There are no checks on these methods

bool BRAY::OptionSet::canErase ( int  token) const

Returns true if property can be erased to revert back to default value. If the options aren't inherited (i.e. offline render), it cannot be erased.

OptionSet BRAY::OptionSet::duplicate ( ) const

This will create a new OptionSet, inheriting state information from the this option set. Note that changing values in the this set may result in unexpected changes in the new option set.

void BRAY::OptionSet::erase ( const UT_Set< int > &  tokens)

Erase properties.

int BRAY::OptionSet::find ( const UT_StringRef name) const

Return the token associated with a given name (or -1 if invalid)

UT_StringHolder BRAY::OptionSet::fullName ( int  token) const

Return the fully qualified name (i.e. karma::object::dicingquality)

const fpreal64* BRAY::OptionSet::fval ( int  token) const

Direct access to internal option data. There are no checks on these methods

template<typename T >
const T* BRAY::OptionSet::import ( int  token,
T *  val,
size_t  n 
) const

Import a property value. Method is specialized for T in:

template<typename T >
bool BRAY::OptionSet::isEqual ( int  token,
const T *  value,
exint  tuple_size 
) const

Test whether a value is the same as the current property.

template<typename T >
SYS_FORCE_INLINE bool BRAY::OptionSet::isEqual ( int  token,
const T &  value 
) const
inline

Simple interface for equality of a scalar value.

Definition at line 187 of file BRAY_Interface.h.

bool BRAY::OptionSet::isValid ( ) const
inline

Private access

Definition at line 137 of file BRAY_Interface.h.

bool BRAY::OptionSet::isVariadic ( int  token) const

Test whether an option has variadic arguments.

const int64* BRAY::OptionSet::ival ( int  token) const

Direct access to internal option data. There are no checks on these methods

const UT_StringHolder& BRAY::OptionSet::name ( int  token) const

Return the name associated with a given option (i.e. dicingquality)

exint BRAY::OptionSet::numProperties ( ) const

Return the number of pre-defined properties in the option set.

SYS_SAFE_BOOL BRAY::OptionSet::operator bool ( ) const
inline

Bool operator to test validity of pointer

Definition at line 142 of file BRAY_Interface.h.

OptionSet& BRAY::OptionSet::operator= ( const OptionSet o)

The assignment operator will change the pointer to the underlying object. Both OptionSets will point to the same underlying object.

VPRM_OptionSetPtr& BRAY::OptionSet::options ( )
inline

Private access

Definition at line 138 of file BRAY_Interface.h.

const VPRM_OptionSetPtr& BRAY::OptionSet::options ( ) const
inline

Private access

Definition at line 139 of file BRAY_Interface.h.

template<typename T >
bool BRAY::OptionSet::set ( int  token,
const T *  value,
exint  tuple_size 
)

Interface to set an property. This template class is specialized for:

template<typename T >
SYS_FORCE_INLINE bool BRAY::OptionSet::set ( int  token,
const T &  value 
)
inline

Simple interface to set a scalar property.

Definition at line 176 of file BRAY_Interface.h.

exint BRAY::OptionSet::size ( int  token) const

Return the size of an option. This can be used for variadics.

GT_Storage BRAY::OptionSet::storage ( int  token) const

Return the storage of an option. This will only be one of:

  • GT_STORE_INVALID
  • GT_STORE_UINT8 (for bool storage)
  • GT_STORE_INT64
  • GT_STORE_REAL64
  • GT_STORE_STRING
const UT_StringHolder* BRAY::OptionSet::sval ( int  token) const

Direct access to internal option data. There are no checks on these methods


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