HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Utils.h
Go to the documentation of this file.
1 /*
2 * PROPRIETARY INFORMATION. This software is proprietary to
3 * Side Effects Software Inc., and is not to be reproduced,
4 * transmitted, or disclosed in any way without written permission.
5 *
6 * COMMENTS:
7 */
8 
9 #ifndef __HOM_Utils_h__
10 #define __HOM_Utils_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_EnumValue.h"
15 #include <UT/UT_Options.h>
16 #include <hboost/any.hpp>
17 #include <map>
18 
19 //----------------------------------------------------------------------------
20 // UT_Options
21 
22 // Returns the UT_OptionType for a hou.fieldType enum value.
24  HOM_EnumValue &enum_value);
25 
26 // Returns the hou.fieldType enum value given a UT_OptionType.
28  UT_OptionType optiontype);
29 
30 // Sets an option from a HOM_UTOptionAny value. The type hint is used only
31 // when the value type is ambiguous (ex: HOM_Vector2 can be mapped to either
32 // UT_OPTION_VECTOR2 or UT_OPTION_UV).
34  UT_Options &options, const char *name, const HOM_UTOptionAny &value,
36 
37 // Sets up an options from a map of anys.
39  UT_Options &options,
40  const std::map<std::string, hboost::any> &map);
41 
42 // Converts an option any into a hboost::any
44  const UT_OptionEntry &option_entry);
45 
46 // Converts a UT_Options into a map of hboost::any.
47 HOM_API std::map<std::string, hboost::any> HOMoptionsToStdMap(
48  const UT_Options &options);
49 
50 #endif
HOM_API hboost::any HOMoptionEntryToBoostAny(const UT_OptionEntry &option_entry)
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
UT_OptionType
Definition: UT_Options.h:44
HOM_API std::map< std::string, hboost::any > HOMoptionsToStdMap(const UT_Options &options)
HOM_API UT_OptionType HOMoptionTypeForEnumValue(HOM_EnumValue &enum_value)
bool any(const vbool4 &v)
Definition: simd.h:3468
#define HOM_API
Definition: HOM_API.h:13
GLuint const GLchar * name
Definition: glcorearb.h:786
A map of string to various well defined value types.
Definition: UT_Options.h:84
HOM_API void HOMsetOptionsFromStdMap(UT_Options &options, const std::map< std::string, hboost::any > &map)
HOM_API bool HOMsetOptionFromUTOptionAny(UT_Options &options, const char *name, const HOM_UTOptionAny &value, UT_OptionType hint=UT_OPTION_INVALID)
Definition: core.h:1131
HOM_API HOM_EnumValue & HOMoptionTypeToEnumValue(UT_OptionType optiontype)