HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_EnumMacros.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  * Macros for generating base enum code.
8  */
9 
10 #ifndef UT_EnumMacros_H
11 #define UT_EnumMacros_H
12 
13 #define UT_TO_STRING(name) #name
14 #define UT_STRING(name) UT_TO_STRING(name)
15 #define UT_CAT2(a, b) a ## b
16 #define UT_CAT(a,b) UT_CAT2(a,b)
17 
18 // Helper to convert enum to HOM expression.
19 // e.g.
20 // UT_StringHolder str_status;
21 // switch (status)
22 // {
23 // UT_VIEWERSTATE_EVENTMESSAGE_CODE_GENERATOR( UT_SWITCH_CASE_TO_HOM_EXPR )
24 // }
25 #define UT_SWITCH_CASE_TO_HOM_EXPR(ENUM, EVALUE, CPPEVALUE, UNUSED, UNUSED2)\
26  case CPPEVALUE: {str_status = "hou." UT_STRING(ENUM) "." UT_STRING(EVALUE); break;}
27 
28 // These macros generates enum base code
29 // MACRO should take the following parameters:
30 // enum_module: enum module name
31 // enum_elem: enum element name
32 // ienum_elem: internal enum element
33 // ienum_elem_name: internal enum element name
34 // enum_value: enum value
35 
36 #define UT_UIEVENT_REASON_CODE_GENERATOR(MACRO)\
37 MACRO(uiEventReason, NoReason, UI_NO_REASON, "", 0)\
38 MACRO(uiEventReason, Changed, UI_VALUE_CHANGED, "", 1)\
39 MACRO(uiEventReason, Active, UI_VALUE_ACTIVE, "", 2)\
40 MACRO(uiEventReason, Start, UI_VALUE_START, "", 3)\
41 MACRO(uiEventReason, New, UI_VALUE_NEW, "", 4)\
42 MACRO(uiEventReason, RangeChanged, UI_VALUE_RANGE_CHANGED, "", 5)\
43 MACRO(uiEventReason, Picked, UI_VALUE_PICKED, "", 6)\
44 MACRO(uiEventReason, Located, UI_VALUE_LOCATED, "", 7)\
45 MACRO(uiEventReason, ItemsChanged, UI_VALUE_ITEMS_CHANGED, "", 8)
46 
47 #define UT_UIEVENT_VALUE_CODE_GENERATOR(MACRO)\
48 MACRO(uiEventValueType, Float, UI_VALUE_FLOAT, "", 0)\
49 MACRO(uiEventValueType, Integer, UI_VALUE_INTEGER, "", 1)\
50 MACRO(uiEventValueType, String, UI_VALUE_STRING, "", 2)\
51 MACRO(uiEventValueType, FloatArray, UI_VALUE_FLOAT_ARRAY, "", 3)\
52 MACRO(uiEventValueType, IntArray, UI_VALUE_INT_ARRAY, "", 4)\
53 MACRO(uiEventValueType, StringArray,UI_VALUE_STRING_ARRAY, "", 5)\
54 MACRO(uiEventValueType, NoType, UI_VALUE_POINTER, "", 6)
55 
56 #define UT_DRAWABLE_PRIMITIVE_CODE_GENERATOR(MACRO)\
57 MACRO(drawablePrimitive, Circle, DM_DrawablePrimitive::Circle, "", 1)\
58 MACRO(drawablePrimitive, Sphere, DM_DrawablePrimitive::Sphere, "", 0)\
59 MACRO(drawablePrimitive, Tube, DM_DrawablePrimitive::Tube, "", 2)
60 
61 #define UT_VIEWERSTATE_EVENTMESSAGE_CODE_GENERATOR(MACRO)\
62 MACRO(viewerStateEventMessage, NoEventType, PI_PythonState::EventMessage::Type::None, "", 0)\
63 MACRO(viewerStateEventMessage, OnCustomEvent, PI_PythonState::EventMessage::Type::OnCustomEvent, "", 10)\
64 MACRO(viewerStateEventMessage, OnEnter, PI_PythonState::EventMessage::Type::OnEnter, "", 1)\
65 MACRO(viewerStateEventMessage, OnExit, PI_PythonState::EventMessage::Type::OnExit, "", 2)\
66 MACRO(viewerStateEventMessage, OnGenerate, PI_PythonState::EventMessage::Type::OnGenerate, "", 8)\
67 MACRO(viewerStateEventMessage, OnInterrupt, PI_PythonState::EventMessage::Type::OnInterrupt, "", 3)\
68 MACRO(viewerStateEventMessage, OnPreEnter, PI_PythonState::EventMessage::Type::OnPreEnter, "", 12)\
69 MACRO(viewerStateEventMessage, OnPrintMessage, PI_PythonState::EventMessage::Type::OnPrintMessage, "", 9)\
70 MACRO(viewerStateEventMessage, OnRegister, PI_PythonState::EventMessage::Type::OnRegister, "", 5)\
71 MACRO(viewerStateEventMessage, OnReload, PI_PythonState::EventMessage::Type::OnReload, "", 11)\
72 MACRO(viewerStateEventMessage, OnResume, PI_PythonState::EventMessage::Type::OnResume, "", 4)\
73 MACRO(viewerStateEventMessage, OnRuntimeError, PI_PythonState::EventMessage::Type::OnRuntimeError, "", 7)\
74 MACRO(viewerStateEventMessage, OnUnregister, PI_PythonState::EventMessage::Type::OnUnregister, "", 6)
75 
76 #define UT_SNAP_PRIORITY_GENERATOR(MACRO)\
77 MACRO(snappingPriority, GeoEdge, DM_SnapPriority::GeoEdge, "", 0)\
78 MACRO(snappingPriority, GeoPoint, DM_SnapPriority::GeoPoint, "", 1)\
79 MACRO(snappingPriority, GeoPrim, DM_SnapPriority::Primitive, "", 2)\
80 MACRO(snappingPriority, Midpoint, DM_SnapPriority::Midpoint, "", 3)\
81 MACRO(snappingPriority, Breakpoint, DM_SnapPriority::BreakPoint, "", 4)\
82 MACRO(snappingPriority, GridPoint, DM_SnapPriority::GridPoint, "", 5)\
83 MACRO(snappingPriority, GridEdge, DM_SnapPriority::GridEdge, "", 6)\
84 MACRO(snappingPriority, PrimGuidePoint, DM_SnapPriority::PrimGuidePoint, "", 7)\
85 MACRO(snappingPriority, PrimGuideEdge, DM_SnapPriority::PrimGuideEdge, "", 8)
86 
87 #define UT_TRIGGER_SELECTOR_GENERATOR(MACRO)\
88 MACRO(triggerSelectorAction, Start, PI_PythonState::SelectorAction::Start, "", 0)\
89 MACRO(triggerSelectorAction, Stop, PI_PythonState::SelectorAction::Stop, "", 1)\
90 MACRO(triggerSelectorAction, Toggle, PI_PythonState::SelectorAction::Toggle, "", 2)
91 
92 #define UT_GEOMETRY_DRAWABLE_TYPE_GENERATOR(MACRO)\
93 MACRO(drawableGeometryType, Line, HOM_AdvancedDrawable::HighlighterType::Line, "", 0)\
94 MACRO(drawableGeometryType, Face, HOM_AdvancedDrawable::HighlighterType::Face, "", 1)\
95 MACRO(drawableGeometryType, Point, HOM_AdvancedDrawable::HighlighterType::Point, "", 2)\
96 MACRO(drawableGeometryType, Vector, HOM_AdvancedDrawable::HighlighterType::Vector, "", 3)
97 
98 #define UT_TEXT_DRAWABLE_ORIGIN_GENERATOR(MACRO)\
99 MACRO(drawableTextOrigin, BottomLeft, DM_Widget::ReferencePoint::BOTTOM_LEFT, "", 0)\
100 MACRO(drawableTextOrigin, BottomCenter, DM_Widget::ReferencePoint::BOTTOM_CENTER, "", 1)\
101 MACRO(drawableTextOrigin, BottomRight, DM_Widget::ReferencePoint::BOTTOM_RIGHT, "", 2)\
102 MACRO(drawableTextOrigin, LeftCenter, DM_Widget::ReferencePoint::LEFT_CENTER, "", 3)\
103 MACRO(drawableTextOrigin, RightCenter, DM_Widget::ReferencePoint::RIGHT_CENTER, "", 4)\
104 MACRO(drawableTextOrigin, UpperLeft, DM_Widget::ReferencePoint::UPPER_LEFT, "", 5)\
105 MACRO(drawableTextOrigin, UpperCenter, DM_Widget::ReferencePoint::UPPER_CENTER, "", 6)\
106 MACRO(drawableTextOrigin, UpperRight, DM_Widget::ReferencePoint::UPPER_RIGHT, "", 7)
107 
108 #define UT_GEOMETRY_DRAWABLE_FACESTYLE_GENERATOR(MACRO)\
109 MACRO(drawableGeometryFaceStyle, Plain, DM_Widget::FaceHighlighter::Styles::PLAIN, "", 0)\
110 MACRO(drawableGeometryFaceStyle, Columns, DM_Widget::FaceHighlighter::Styles::COLUMNS,"", 1)\
111 MACRO(drawableGeometryFaceStyle, Rows, DM_Widget::FaceHighlighter::Styles::ROWS, "", 2)\
112 MACRO(drawableGeometryFaceStyle, Checker, DM_Widget::FaceHighlighter::Styles::CHECKER,"", 3)\
113 MACRO(drawableGeometryFaceStyle, Circle, DM_Widget::FaceHighlighter::Styles::CIRCLES,"", 4)
114 
115 #define UT_GEOMETRY_DRAWABLE_LINESTYLE_GENERATOR(MACRO)\
116 MACRO(drawableGeometryLineStyle, Plain, DM_Widget::LineHighlighter::Styles::PLAIN, "", 0)\
117 MACRO(drawableGeometryLineStyle, Dash1, DM_Widget::LineHighlighter::Styles::DASH_1_2, "", 1)\
118 MACRO(drawableGeometryLineStyle, Dash2, DM_Widget::LineHighlighter::Styles::DASH_1_3, "", 2)\
119 MACRO(drawableGeometryLineStyle, Dash3, DM_Widget::LineHighlighter::Styles::DASH_1_4, "", 3)\
120 MACRO(drawableGeometryLineStyle, Dot1, DM_Widget::LineHighlighter::Styles::DOT_1, "", 4)\
121 MACRO(drawableGeometryLineStyle, Dot2, DM_Widget::LineHighlighter::Styles::DOT_1_2, "", 5)\
122 MACRO(drawableGeometryLineStyle, Dot3, DM_Widget::LineHighlighter::Styles::DOT_1_4, "", 6)\
123 MACRO(drawableGeometryLineStyle, Dot4, DM_Widget::LineHighlighter::Styles::DOT_1_8, "", 7)
124 
125 #define UT_GEOMETRY_DRAWABLE_POINTSTYLE_GENERATOR(MACRO)\
126 MACRO(drawableGeometryPointStyle, LinearCircle, DM_Widget::PointHighlighter::Styles::LINEAR_CIRCLE, "", 0)\
127 MACRO(drawableGeometryPointStyle, LinearSquare, DM_Widget::PointHighlighter::Styles::LINEAR_SQUARE, "", 1)\
128 MACRO(drawableGeometryPointStyle, SmoothCircle, DM_Widget::PointHighlighter::Styles::SMOOTH_CIRCLE, "", 2)\
129 MACRO(drawableGeometryPointStyle, SmoothSquare, DM_Widget::PointHighlighter::Styles::SMOOTH_SQUARE, "", 3)\
130 MACRO(drawableGeometryPointStyle, RingsCircle, DM_Widget::PointHighlighter::Styles::RINGS_CIRCLE, "", 4)\
131 MACRO(drawableGeometryPointStyle, RingsSquare, DM_Widget::PointHighlighter::Styles::RINGS_SQUARE, "", 5)
132 
133 #define UT_GEOMETRY_DRAWABLE_RAMPCLAMP_GENERATOR(MACRO)\
134 MACRO(drawableRampClamp, Repeat, RE_TexClampType::RE_CLAMP_REPEAT, "", 0)\
135 MACRO(drawableRampClamp, Border, RE_TexClampType::RE_CLAMP_BORDER, "", 1)\
136 MACRO(drawableRampClamp, Edge, RE_TexClampType::RE_CLAMP_EDGE, "", 2)\
137 MACRO(drawableRampClamp, Mirror, RE_TexClampType::RE_CLAMP_MIRROR, "", 3)
138 
139 #define UT_GEOMETRY_DRAWABLE_HIGHLIGHT_MODE_GENERATOR(MACRO)\
140 MACRO(drawableHighlightMode, Glow, DM_Widget::HighlightMode::GLOW_ONLY, "", 0)\
141 MACRO(drawableHighlightMode, Matte, DM_Widget::HighlightMode::MATTE_ONLY, "", 1)\
142 MACRO(drawableHighlightMode, GlowMinusMatte, DM_Widget::HighlightMode::GLOW_MINUS_MATTE, "", 2)\
143 MACRO(drawableHighlightMode, MatteOverGlow, DM_Widget::HighlightMode::MATTE_OVER_GLOW, "", 3)
144 
145 #define UT_PYTHONSTATE_EVENT_GENERATOR(MACRO)\
146 MACRO(BeginHandleToState, "")\
147 MACRO(Command, "")\
148 MACRO(Create, "")\
149 MACRO(DropAccept, "")\
150 MACRO(DropGetOptions, "")\
151 MACRO(DragTest, "")\
152 MACRO(Draw, "")\
153 MACRO(DrawInterrupt, "")\
154 MACRO(EndHandleToState, "")\
155 MACRO(Enter, "")\
156 MACRO(Exit, "")\
157 MACRO(Generate, "")\
158 MACRO(HandleToState, "")\
159 MACRO(HasAttr, "")\
160 MACRO(Init, "")\
161 MACRO(Interrupt, "")\
162 MACRO(Key, "Event")\
163 MACRO(KeyTransit, "Event")\
164 MACRO(MenuAction, "")\
165 MACRO(MenuPreOpen, "")\
166 MACRO(Mouse, "Event")\
167 MACRO(MouseWheel, "Event")\
168 MACRO(ParmChange, "Event")\
169 MACRO(Resume, "")\
170 MACRO(Selection, "")\
171 MACRO(StartSelection, "")\
172 MACRO(StopSelection, "")\
173 MACRO(StateToHandle, "")\
174 MACRO(Term, "")
175 
176 #define UT_SECURE_SELECTION_OPTIONS_GENERATOR(MACRO)\
177 MACRO(secureSelectionOption, Ignore, PI_PythonState::SecureSelectionOption::Ignore, "", 0)\
178 MACRO(secureSelectionOption, Obey, PI_PythonState::SecureSelectionOption::Obey, "", 1)\
179 MACRO(secureSelectionOption, On, PI_PythonState::SecureSelectionOption::On, "", 2)\
180 MACRO(secureSelectionOption, Off, PI_PythonState::SecureSelectionOption::Off, "", 3)
181 
182 #endif // UT_EnumMacros_H