#include <UT_Options.h>

Public Member Functions | |
| UT_Options () | |
| UT_Options (const UT_Options &src) | |
| virtual | ~UT_Options () |
| void | clear () |
| bool | load (const char *filename) |
| bool | save (const char *filename) const |
| bool | load (const char *filename, UT_IStream &is) |
| bool | save (const char *filename, ostream &os) const |
| bool | saveAsJSON (const char *filename) const |
| bool | saveAsJSON (const char *filename, ostream &os) const |
| void | removeOption (const char *name) |
| void | getOptionString (const char *name, UT_WorkBuffer &result) const |
| void | getOptionString (const char *name, UT_String &result) const |
| bool | appendPyDictionary (UT_WorkBuffer &result) const |
| bool | getPyOptionString (const char *name, UT_WorkBuffer &result) const |
| bool | getPyOptionString (const char *name, UT_String &result) const |
| bool | save (UT_JSONWriter &w) const |
| Save a UT_Options to JSON format using UT_JSONWriter. | |
| bool | load (UT_JSONParser &parser, bool clear_self, UT_JSONIStream *is=0) |
| bool | load (UT_JSONParser &parser, bool clear_self, UT_IStream *is) |
| Convenience method to parse with a UT_IStream. | |
| bool | hasOption (const char *name) const |
| UT_OptionType | getOptionType (const char *name) const |
| const UT_OptionEntry * | getOptionEntry (const char *name) const |
| int | getNumOptions () const |
| const char * | getOptionName (int optionnum) const |
| UT_OptionType | getOptionType (int optionnum) const |
| const UT_OptionEntry * | getOptionEntry (int optionnum) const |
| int64 | getOptionI (const char *name) const |
| bool | getOptionB (const char *name) const |
| fpreal64 | getOptionF (const char *name) const |
| const UT_Vector2D | getOptionV2 (const char *name) const |
| const UT_Vector3D | getOptionV3 (const char *name) const |
| const UT_Vector4D | getOptionV4 (const char *name) const |
| const UT_QuaternionD | getOptionQ (const char *name) const |
| const UT_Matrix3D | getOptionM3 (const char *name) const |
| const UT_Matrix4D | getOptionM4 (const char *name) const |
| const UT_Vector2D | getOptionUV (const char *name) const |
| const UT_Vector3D | getOptionUVW (const char *name) const |
| std::string | getOptionS (const char *name) const |
| void | getOptionS (const char *name, std::string &value) const |
| void | getOptionS (const char *name, UT_String &value) const |
| void | getOptionS (const char *name, UT_WorkBuffer &value) const |
| fpreal64 | getOptionNum (const char *name) const |
| bool | importOption (const char *name, int &value) const |
| bool | importOption (const char *name, int64 &value) const |
| bool | importOption (const char *name, bool &value) const |
| bool | importOption (const char *name, fpreal32 &value) const |
| bool | importOption (const char *name, fpreal64 &value) const |
| bool | importOption (const char *name, std::string &value) const |
| bool | importOption (const char *name, UT_String &value) const |
| bool | importOption (const char *name, UT_Vector2F &value) const |
| bool | importOption (const char *name, UT_Vector3F &value) const |
| bool | importOption (const char *name, UT_Vector4F &value) const |
| bool | importOption (const char *name, UT_QuaternionF &value) const |
| bool | importOption (const char *name, UT_Matrix3F &value) const |
| bool | importOption (const char *name, UT_Matrix4F &value) const |
| bool | importOption (const char *name, UT_Vector2D &value) const |
| bool | importOption (const char *name, UT_Vector3D &value) const |
| bool | importOption (const char *name, UT_Vector4D &value) const |
| bool | importOption (const char *name, UT_QuaternionD &value) const |
| bool | importOption (const char *name, UT_Matrix3D &value) const |
| bool | importOption (const char *name, UT_Matrix4D &value) const |
| bool | importOption (const char *name, UT_IntArray &value) const |
| bool | importOption (const char *name, UT_FloatArray &value) const |
| void | setOptionI (const char *name, int64 value) |
| void | setOptionB (const char *name, bool value) |
| void | setOptionF (const char *name, fpreal64 value) |
| void | setOptionS (const char *name, const char *value, int64 size=-1) |
| void | setOptionS (const char *name, const std::string &value) |
| void | setOptionSRaw (const char *name, const char *value, int64 size=-1) |
| void | setOptionSRaw (const char *name, const std::string &value) |
| void | setOptionV2 (const char *name, const UT_Vector2F &value) |
| void | setOptionV2 (const char *name, const UT_Vector2D &value) |
| void | setOptionV2 (const char *name, fpreal64 x, fpreal64 y) |
| void | setOptionV3 (const char *name, const UT_Vector3F &value) |
| void | setOptionV3 (const char *name, const UT_Vector3D &value) |
| void | setOptionV3 (const char *name, fpreal64 x, fpreal64 y, fpreal64 z) |
| void | setOptionV4 (const char *name, const UT_Vector4F &value) |
| void | setOptionV4 (const char *name, const UT_Vector4D &value) |
| void | setOptionV4 (const char *name, fpreal64 x, fpreal64 y, fpreal64 z, fpreal64 w) |
| void | setOptionQ (const char *name, const UT_QuaternionF &value) |
| void | setOptionQ (const char *name, const UT_QuaternionD &value) |
| void | setOptionM3 (const char *name, const UT_Matrix3F &value) |
| void | setOptionM3 (const char *name, const UT_Matrix3D &value) |
| void | setOptionM4 (const char *name, const UT_Matrix4F &value) |
| void | setOptionM4 (const char *name, const UT_Matrix4D &value) |
| void | setOptionUV (const char *name, const UT_Vector2F &value) |
| void | setOptionUV (const char *name, const UT_Vector2D &value) |
| void | setOptionUVW (const char *name, const UT_Vector3F &value) |
| void | setOptionUVW (const char *name, const UT_Vector3D &value) |
| unsigned | hash () const |
| Get a hash code for the options. | |
| bool | operator== (const UT_Options &src) const |
| Comparison operator. | |
| bool | operator!= (const UT_Options &src) const |
| const UT_Options & | operator= (const UT_Options &src) |
| Assignment operator. | |
| void | merge (const UT_Options &src) |
| int64 | getMemoryUsage () const |
Static Public Member Functions | |
| static void | getOptionString (const UT_OptionEntry *option, UT_WorkBuffer &result) |
| static void | getOptionString (const UT_OptionEntry *option, UT_String &result) |
| static bool | getPyOptionString (const UT_OptionEntry *option, UT_WorkBuffer &result) |
| static bool | getPyOptionString (const UT_OptionEntry *option, UT_String &result) |
| static UT_OptionType | getOptionTypeFromString (const char *optiontypestr) |
| static const char * | getStringFromOptionType (UT_OptionType optiontype) |
Protected Member Functions | |
| const std::string * | findOptionS (const char *name) const |
| void | addError (const char *filename, int linecount, const char *error_str) const |
| void | setOption (const char *name, UT_OptionEntry *value) |
| virtual void | optionChanged (const char *name) |
Static Protected Member Functions | |
| static int | compareStrings (const char *const *str1, const char *const *str2) |
| static const char * | getStringReference (const char *symbol) |
| static bool | saveJSON (UT_JSONWriter &w, const UT_OptionEntry *opt) |
| static unsigned | hash (const UT_OptionEntry *option) |
| Compute hash/equivalence for a given option entry. | |
| static unsigned | isEqual (const UT_OptionEntry *o1, const UT_OptionEntry *o2, fpreal64 tolerance=0) |
Protected Attributes | |
| UT_PtrArraySorted< const char * > | myOptionNames |
| UT_PtrArray< UT_OptionEntry * > | myOptionValues |
| bool | mySendOptionChanges |
Definition at line 66 of file UT_Options.h.
| UT_Options::UT_Options | ( | ) |
| UT_Options::UT_Options | ( | const UT_Options & | src | ) |
| virtual UT_Options::~UT_Options | ( | ) | [virtual] |
| void UT_Options::addError | ( | const char * | filename, | |
| int | linecount, | |||
| const char * | error_str | |||
| ) | const [protected] |
| bool UT_Options::appendPyDictionary | ( | UT_WorkBuffer & | result | ) | const |
| void UT_Options::clear | ( | ) |
| static int UT_Options::compareStrings | ( | const char *const * | str1, | |
| const char *const * | str2 | |||
| ) | [static, protected] |
| const std::string* UT_Options::findOptionS | ( | const char * | name | ) | const [protected] |
| int64 UT_Options::getMemoryUsage | ( | ) | const |
| int UT_Options::getNumOptions | ( | ) | const |
| bool UT_Options::getOptionB | ( | const char * | name | ) | const |
| const UT_OptionEntry* UT_Options::getOptionEntry | ( | int | optionnum | ) | const |
| const UT_OptionEntry* UT_Options::getOptionEntry | ( | const char * | name | ) | const |
| fpreal64 UT_Options::getOptionF | ( | const char * | name | ) | const |
| int64 UT_Options::getOptionI | ( | const char * | name | ) | const |
| const UT_Matrix3D UT_Options::getOptionM3 | ( | const char * | name | ) | const |
| const UT_Matrix4D UT_Options::getOptionM4 | ( | const char * | name | ) | const |
| const char* UT_Options::getOptionName | ( | int | optionnum | ) | const |
| fpreal64 UT_Options::getOptionNum | ( | const char * | name | ) | const |
| const UT_QuaternionD UT_Options::getOptionQ | ( | const char * | name | ) | const |
| void UT_Options::getOptionS | ( | const char * | name, | |
| UT_WorkBuffer & | value | |||
| ) | const |
| void UT_Options::getOptionS | ( | const char * | name, | |
| UT_String & | value | |||
| ) | const |
| void UT_Options::getOptionS | ( | const char * | name, | |
| std::string & | value | |||
| ) | const |
| std::string UT_Options::getOptionS | ( | const char * | name | ) | const |
| static void UT_Options::getOptionString | ( | const UT_OptionEntry * | option, | |
| UT_String & | result | |||
| ) | [static] |
| static void UT_Options::getOptionString | ( | const UT_OptionEntry * | option, | |
| UT_WorkBuffer & | result | |||
| ) | [static] |
| void UT_Options::getOptionString | ( | const char * | name, | |
| UT_String & | result | |||
| ) | const |
| void UT_Options::getOptionString | ( | const char * | name, | |
| UT_WorkBuffer & | result | |||
| ) | const |
| UT_OptionType UT_Options::getOptionType | ( | int | optionnum | ) | const |
| UT_OptionType UT_Options::getOptionType | ( | const char * | name | ) | const |
| static UT_OptionType UT_Options::getOptionTypeFromString | ( | const char * | optiontypestr | ) | [static] |
| const UT_Vector2D UT_Options::getOptionUV | ( | const char * | name | ) | const |
| const UT_Vector3D UT_Options::getOptionUVW | ( | const char * | name | ) | const |
| const UT_Vector2D UT_Options::getOptionV2 | ( | const char * | name | ) | const |
| const UT_Vector3D UT_Options::getOptionV3 | ( | const char * | name | ) | const |
| const UT_Vector4D UT_Options::getOptionV4 | ( | const char * | name | ) | const |
| static bool UT_Options::getPyOptionString | ( | const UT_OptionEntry * | option, | |
| UT_String & | result | |||
| ) | [static] |
| static bool UT_Options::getPyOptionString | ( | const UT_OptionEntry * | option, | |
| UT_WorkBuffer & | result | |||
| ) | [static] |
| bool UT_Options::getPyOptionString | ( | const char * | name, | |
| UT_String & | result | |||
| ) | const |
| bool UT_Options::getPyOptionString | ( | const char * | name, | |
| UT_WorkBuffer & | result | |||
| ) | const |
| static const char* UT_Options::getStringFromOptionType | ( | UT_OptionType | optiontype | ) | [static] |
| static const char* UT_Options::getStringReference | ( | const char * | symbol | ) | [static, protected] |
| static unsigned UT_Options::hash | ( | const UT_OptionEntry * | option | ) | [static, protected] |
Compute hash/equivalence for a given option entry.
| unsigned UT_Options::hash | ( | ) | const |
Get a hash code for the options.
| bool UT_Options::hasOption | ( | const char * | name | ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_FloatArray & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_IntArray & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Matrix4D & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Matrix3D & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_QuaternionD & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Vector4D & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Vector3D & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Vector2D & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Matrix4F & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Matrix3F & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_QuaternionF & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Vector4F & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Vector3F & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_Vector2F & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| UT_String & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| std::string & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| fpreal64 & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| fpreal32 & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| bool & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| int64 & | value | |||
| ) | const |
| bool UT_Options::importOption | ( | const char * | name, | |
| int & | value | |||
| ) | const |
| static unsigned UT_Options::isEqual | ( | const UT_OptionEntry * | o1, | |
| const UT_OptionEntry * | o2, | |||
| fpreal64 | tolerance = 0 | |||
| ) | [static, protected] |
| bool UT_Options::load | ( | UT_JSONParser & | parser, | |
| bool | clear_self, | |||
| UT_IStream * | is | |||
| ) |
Convenience method to parse with a UT_IStream.
| bool UT_Options::load | ( | UT_JSONParser & | parser, | |
| bool | clear_self, | |||
| UT_JSONIStream * | is = 0 | |||
| ) |
Load a UT_Options from a JSON parser.
| parser | Parser | |
| clear_self | Clear existing map before loading If true and the first object in the JSON stream is not a map object, then the parser will fail (with an error). Otherwise a warning will be added and the object will be skipped. | |
| is | If this is specified, then data will be read from that stream rather than the stream associated with the parser. |
| bool UT_Options::load | ( | const char * | filename, | |
| UT_IStream & | is | |||
| ) |
| bool UT_Options::load | ( | const char * | filename | ) |
| void UT_Options::merge | ( | const UT_Options & | src | ) |
| bool UT_Options::operator!= | ( | const UT_Options & | src | ) | const [inline] |
Definition at line 267 of file UT_Options.h.
| const UT_Options& UT_Options::operator= | ( | const UT_Options & | src | ) |
| bool UT_Options::operator== | ( | const UT_Options & | src | ) | const |
Comparison operator.
| virtual void UT_Options::optionChanged | ( | const char * | name | ) | [protected, virtual] |
Reimplemented in OP_Options, and SIM_Options.
| void UT_Options::removeOption | ( | const char * | name | ) |
| bool UT_Options::save | ( | UT_JSONWriter & | w | ) | const |
Save a UT_Options to JSON format using UT_JSONWriter.
| bool UT_Options::save | ( | const char * | filename, | |
| ostream & | os | |||
| ) | const |
| bool UT_Options::save | ( | const char * | filename | ) | const |
| bool UT_Options::saveAsJSON | ( | const char * | filename, | |
| ostream & | os | |||
| ) | const |
| bool UT_Options::saveAsJSON | ( | const char * | filename | ) | const |
| static bool UT_Options::saveJSON | ( | UT_JSONWriter & | w, | |
| const UT_OptionEntry * | opt | |||
| ) | [static, protected] |
Save a single option to a JSON stream. This is saved with the schema
{
"name":"UT_OptionEntry",
"type":"object",
"properties": {
"type":{
"type":"string",
"enum":{ UT_Options::getStringFromOptionType() },
},
"value":{
"type":["bool", "integer", "float", "string", "array"],
"items":{"type":"float"},
"description":"Basic type or an array.
Arrays must be 2,3,4,9 or 16 floats.
Data should match given type",
},
},
}
| void UT_Options::setOption | ( | const char * | name, | |
| UT_OptionEntry * | value | |||
| ) | [protected] |
| void UT_Options::setOptionB | ( | const char * | name, | |
| bool | value | |||
| ) |
| void UT_Options::setOptionF | ( | const char * | name, | |
| fpreal64 | value | |||
| ) |
| void UT_Options::setOptionI | ( | const char * | name, | |
| int64 | value | |||
| ) |
| void UT_Options::setOptionM3 | ( | const char * | name, | |
| const UT_Matrix3D & | value | |||
| ) |
| void UT_Options::setOptionM3 | ( | const char * | name, | |
| const UT_Matrix3F & | value | |||
| ) |
| void UT_Options::setOptionM4 | ( | const char * | name, | |
| const UT_Matrix4D & | value | |||
| ) |
| void UT_Options::setOptionM4 | ( | const char * | name, | |
| const UT_Matrix4F & | value | |||
| ) |
| void UT_Options::setOptionQ | ( | const char * | name, | |
| const UT_QuaternionD & | value | |||
| ) |
| void UT_Options::setOptionQ | ( | const char * | name, | |
| const UT_QuaternionF & | value | |||
| ) |
| void UT_Options::setOptionS | ( | const char * | name, | |
| const std::string & | value | |||
| ) |
| void UT_Options::setOptionS | ( | const char * | name, | |
| const char * | value, | |||
| int64 | size = -1 | |||
| ) |
| void UT_Options::setOptionSRaw | ( | const char * | name, | |
| const std::string & | value | |||
| ) |
| void UT_Options::setOptionSRaw | ( | const char * | name, | |
| const char * | value, | |||
| int64 | size = -1 | |||
| ) |
| void UT_Options::setOptionUV | ( | const char * | name, | |
| const UT_Vector2D & | value | |||
| ) |
| void UT_Options::setOptionUV | ( | const char * | name, | |
| const UT_Vector2F & | value | |||
| ) |
| void UT_Options::setOptionUVW | ( | const char * | name, | |
| const UT_Vector3D & | value | |||
| ) |
| void UT_Options::setOptionUVW | ( | const char * | name, | |
| const UT_Vector3F & | value | |||
| ) |
| void UT_Options::setOptionV2 | ( | const char * | name, | |
| const UT_Vector2D & | value | |||
| ) |
| void UT_Options::setOptionV2 | ( | const char * | name, | |
| const UT_Vector2F & | value | |||
| ) |
| void UT_Options::setOptionV3 | ( | const char * | name, | |
| const UT_Vector3D & | value | |||
| ) |
| void UT_Options::setOptionV3 | ( | const char * | name, | |
| const UT_Vector3F & | value | |||
| ) |
| void UT_Options::setOptionV4 | ( | const char * | name, | |
| const UT_Vector4D & | value | |||
| ) |
| void UT_Options::setOptionV4 | ( | const char * | name, | |
| const UT_Vector4F & | value | |||
| ) |
UT_PtrArraySorted<const char *> UT_Options::myOptionNames [protected] |
Definition at line 317 of file UT_Options.h.
UT_PtrArray<UT_OptionEntry *> UT_Options::myOptionValues [protected] |
Definition at line 318 of file UT_Options.h.
bool UT_Options::mySendOptionChanges [protected] |
Definition at line 319 of file UT_Options.h.
1.5.9