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

#include <UT_PropertyTable.h>

Classes

class  PropertySubsetList
 Relatively lightweight representation of a subset of a UT_PropertyList. More...
 

Public Types

using OptionEntryPtr = UT_SharedPtr< UT_OptionEntry >
 

Public Member Functions

 UT_PropertyTable (const char *table_name)
 
 UT_PropertyTable (UT_JSONParser &p, const char *filename=nullptr)
 
 ~UT_PropertyTable ()
 
bool loadStatus () const
 Return the load status of the table in the c-tor. More...
 
int getNumProps () const
 
int getPropIndex (const UT_StringRef &name)
 
const UT_StringHoldergetPropName (int i) const
 
const UT_StringHoldergetPropLabel (int i) const
 
const UT_StringHoldergetPropParm (int i) const
 
OptionEntryPtr getPropDefault (int i) const
 
fpreal getMin (int i) const
 
fpreal getMax (int i) const
 
int findRName (const UT_StringRef &name) const
 
int findHName (const UT_StringRef &name) const
 
exint size () const
 Number of properties stored in the table. More...
 
const UT_StringHolderrclass (int i) const
 Return the class of the rendering property (i.e. "object") More...
 
const UT_StringHolderrname (int i) const
 Return the name of the rendering property (i.e. "coving") More...
 
const UT_StringHolderhname (int i) const
 Return the name of the houdini parameter (i.e. "vm_coving") More...
 
const UT_StringHolderlabel (int i) const
 Return the label of the houdini parameter (i.e. "Coving") More...
 
OptionEntryPtr value (int i) const
 Return the default value of the houdini parameter (i.e. 1) More...
 
bool save (UT_JSONWriter &w, const UT_IntArray *select=nullptr) const
 Debug the settings. More...
 
void dump (const UT_IntArray *select=nullptr) const
 
const PropertySubsetListgetSubset (const UT_StringRef &name)
 
const PropertySubsetListgetSubset (const UT_StringRef names[], exint arraylen)
 
fpreal minValue (int i) const
 
fpreal maxValue (int i) const
 

Detailed Description

This class represents a table of (mantra) properties. A property consists of a name (the name used by mantra), a parm name (the name of the houdini parameter that corresponds to the mantra property), the data type of the property, and the default value of the property.

This information is somewhat scattered right now, with the parameter definition in the $HH/properties/soho/IFDmantra.ds file, the translation from houdini to mantra names in $HH/soho/base/IFDmantra.py, and the defaults as mantra understands them (which should but may not match the defaults in the parameter definitions) in $RAY/RAY_Settings.C. At some point all references to render properties should be through this class.

The property table is loaded from a JSON array where each item in the array is a dictionary defining a property. The items to define the property are:

  • "string class" (required): Specifies the rendering class of the property (i.e. "renderer", "object" or "option")
  • "string name" (required): The renderer name for the property
  • "string hname" (required): The name of the Houdini parameter
  • "<type> default" (required): The default value. This may be one of:
    • bool
    • number
    • string
    • array of numbers
    • array of strings
  • "string label" (optional): The label of the Houdini parameter
  • "float min" (optional): Suggested minimum value for numeric types
  • "float max" (optional): Suggested maximum value for numeric types

Definition at line 49 of file UT_PropertyTable.h.

Member Typedef Documentation

Constructor & Destructor Documentation

UT_PropertyTable::UT_PropertyTable ( const char *  table_name)
UT_PropertyTable::UT_PropertyTable ( UT_JSONParser p,
const char *  filename = nullptr 
)
UT_PropertyTable::~UT_PropertyTable ( )

Member Function Documentation

void UT_PropertyTable::dump ( const UT_IntArray select = nullptr) const
int UT_PropertyTable::findHName ( const UT_StringRef name) const

Find property by the Houdini parameter name The method returns -1 if the parameter isn't found.

int UT_PropertyTable::findRName ( const UT_StringRef name) const

Find a property by the renderer property name. This will find names like "global:lod", but also "lod". The first usage (with class specifier) avoids name aliasing between different rendering classes. The method returns -1 if the property isn't found.

fpreal UT_PropertyTable::getMax ( int  i) const
inline

Definition at line 79 of file UT_PropertyTable.h.

fpreal UT_PropertyTable::getMin ( int  i) const
inline

Definition at line 77 of file UT_PropertyTable.h.

int UT_PropertyTable::getNumProps ( ) const
inline

Definition at line 63 of file UT_PropertyTable.h.

OptionEntryPtr UT_PropertyTable::getPropDefault ( int  i) const
inline

Definition at line 75 of file UT_PropertyTable.h.

int UT_PropertyTable::getPropIndex ( const UT_StringRef name)
inline

Definition at line 65 of file UT_PropertyTable.h.

const UT_StringHolder& UT_PropertyTable::getPropLabel ( int  i) const
inline

Definition at line 71 of file UT_PropertyTable.h.

const UT_StringHolder& UT_PropertyTable::getPropName ( int  i) const
inline

Definition at line 69 of file UT_PropertyTable.h.

const UT_StringHolder& UT_PropertyTable::getPropParm ( int  i) const
inline

Definition at line 73 of file UT_PropertyTable.h.

const PropertySubsetList& UT_PropertyTable::getSubset ( const UT_StringRef name)
inline

Definition at line 162 of file UT_PropertyTable.h.

const PropertySubsetList& UT_PropertyTable::getSubset ( const UT_StringRef  names[],
exint  arraylen 
)
const UT_StringHolder& UT_PropertyTable::hname ( int  i) const

Return the name of the houdini parameter (i.e. "vm_coving")

const UT_StringHolder& UT_PropertyTable::label ( int  i) const

Return the label of the houdini parameter (i.e. "Coving")

bool UT_PropertyTable::loadStatus ( ) const
inline

Return the load status of the table in the c-tor.

Definition at line 60 of file UT_PropertyTable.h.

fpreal UT_PropertyTable::maxValue ( int  i) const

For numeric values, return the expected range of the values. These is typically a suggested range.

fpreal UT_PropertyTable::minValue ( int  i) const

For numeric values, return the expected range of the values. These is typically a suggested range.

const UT_StringHolder& UT_PropertyTable::rclass ( int  i) const

Return the class of the rendering property (i.e. "object")

const UT_StringHolder& UT_PropertyTable::rname ( int  i) const

Return the name of the rendering property (i.e. "coving")

bool UT_PropertyTable::save ( UT_JSONWriter w,
const UT_IntArray select = nullptr 
) const

Debug the settings.

exint UT_PropertyTable::size ( void  ) const
inline

Number of properties stored in the table.

Definition at line 91 of file UT_PropertyTable.h.

OptionEntryPtr UT_PropertyTable::value ( int  i) const

Return the default value of the houdini parameter (i.e. 1)


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