HDK
|
#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, bool verbose=false) | |
UT_PropertyTable (UT_JSONParser &p, const char *filename=nullptr, bool verbose=false) | |
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_StringHolder & | getPropName (int i) const |
const UT_StringHolder & | getPropLabel (int i) const |
const UT_StringHolder & | getPropParm (int i) const |
OptionEntryPtr | getPropDefault (int i) const |
fpreal64 | getMin (int i) const |
fpreal64 | 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_StringHolder & | rclass (int i) const |
Return the class of the rendering property (i.e. "object") More... | |
const UT_StringHolder & | rname (int i) const |
Return the name of the rendering property (i.e. "coving") More... | |
const UT_StringHolder & | hname (int i) const |
Return the name of the houdini parameter (i.e. "vm_coving") More... | |
const UT_StringHolder & | label (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... | |
const UT_JSONValueMap & | jsonMap (int i) const |
Return a raw JSONValueMap representing the property. 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 PropertySubsetList & | getSubset (const UT_StringRef &name) |
const PropertySubsetList & | getSubset (const UT_StringRef names[], exint arraylen) |
template<typename SELECT > | |
SYS_FORCE_INLINE void | select (UT_Array< const UT_JSONValueMap * > &matched, SELECT &predicate) |
template<typename FUNC , typename SELECT > | |
SYS_FORCE_INLINE void | filter (FUNC &func, SELECT &predicate) |
fpreal64 | minValue (int i) const |
fpreal64 | maxValue (int i) const |
template<typename T > | |
SYS_FORCE_INLINE bool | import (int idx, const UT_StringRef &name, T &val) const |
template<typename T > | |
SYS_FORCE_INLINE bool | import (int idx, const UT_StringRef &name, T *val, int size) const |
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:
Definition at line 53 of file UT_PropertyTable.h.
Definition at line 56 of file UT_PropertyTable.h.
UT_PropertyTable::UT_PropertyTable | ( | const char * | table_name, |
bool | verbose = false |
||
) |
UT_PropertyTable::UT_PropertyTable | ( | UT_JSONParser & | p, |
const char * | filename = nullptr , |
||
bool | verbose = false |
||
) |
void UT_PropertyTable::dump | ( | const UT_IntArray * | select = nullptr | ) | const |
|
inline |
Run an operation on a selection of properties from the table. The SELECT method takes a const reference to the UT_JSONValueMap and should return true if the functor should be called.
Definition at line 215 of file UT_PropertyTable.h.
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.
Definition at line 84 of file UT_PropertyTable.h.
Definition at line 82 of file UT_PropertyTable.h.
|
inline |
Definition at line 68 of file UT_PropertyTable.h.
|
inline |
Definition at line 80 of file UT_PropertyTable.h.
|
inline |
Definition at line 70 of file UT_PropertyTable.h.
|
inline |
Definition at line 76 of file UT_PropertyTable.h.
|
inline |
Definition at line 74 of file UT_PropertyTable.h.
|
inline |
Definition at line 78 of file UT_PropertyTable.h.
|
inline |
Definition at line 181 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")
|
inline |
Import a value from a property
Definition at line 121 of file UT_PropertyTable.h.
|
inline |
Import a value from a property
Definition at line 125 of file UT_PropertyTable.h.
|
inline |
Return a raw JSONValueMap representing the property.
Definition at line 115 of file UT_PropertyTable.h.
const UT_StringHolder& UT_PropertyTable::label | ( | int | i | ) | const |
Return the label of the houdini parameter (i.e. "Coving")
|
inline |
Return the load status of the table in the c-tor.
Definition at line 65 of file UT_PropertyTable.h.
For numeric values, return the expected range of the values. These is typically a suggested range.
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.
|
inline |
Function to extract a list of properties as an array of UT_JSONValueMaps The SELECT method takes a const reference to the UT_JSONValueMap and should return true if the map should be added. For example, to find all the karma global rendering properties, you can do something like:
Definition at line 203 of file UT_PropertyTable.h.
Number of properties stored in the table.
Definition at line 96 of file UT_PropertyTable.h.
OptionEntryPtr UT_PropertyTable::value | ( | int | i | ) | const |
Return the default value of the houdini parameter (i.e. 1)