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_RESOURCE_EVENTMESSAGE_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_RESOURCE_EVENTMESSAGE_GENERATOR(MACRO)\
62 MACRO(resourceEventMessage, NoEventType, PI_PythonResource::EventMessage::Type::None, "", 0)\
63 MACRO(resourceEventMessage, OnCustomEvent, PI_PythonResource::EventMessage::Type::OnCustomEvent, "", 10)\
64 MACRO(resourceEventMessage, OnEnter, PI_PythonResource::EventMessage::Type::OnEnter, "", 1)\
65 MACRO(resourceEventMessage, OnExit, PI_PythonResource::EventMessage::Type::OnExit, "", 2)\
66 MACRO(resourceEventMessage, OnGenerate, PI_PythonResource::EventMessage::Type::OnGenerate, "", 8)\
67 MACRO(resourceEventMessage, OnInterrupt, PI_PythonResource::EventMessage::Type::OnInterrupt, "", 3)\
68 MACRO(resourceEventMessage, OnPreEnter, PI_PythonResource::EventMessage::Type::OnPreEnter, "", 12)\
69 MACRO(resourceEventMessage, OnPrintMessage, PI_PythonResource::EventMessage::Type::OnPrintMessage, "", 9)\
70 MACRO(resourceEventMessage, OnRegister, PI_PythonResource::EventMessage::Type::OnRegister, "", 5)\
71 MACRO(resourceEventMessage, OnReload, PI_PythonResource::EventMessage::Type::OnReload, "", 11)\
72 MACRO(resourceEventMessage, OnResume, PI_PythonResource::EventMessage::Type::OnResume, "", 4)\
73 MACRO(resourceEventMessage, OnRuntimeError, PI_PythonResource::EventMessage::Type::OnRuntimeError, "", 7)\
74 MACRO(resourceEventMessage, OnUnregister, PI_PythonResource::EventMessage::Type::OnUnregister, "", 6)\
75 MACRO(resourceEventMessage, OnActivate, PI_PythonResource::EventMessage::Type::OnActivate, "", 13)\
76 MACRO(resourceEventMessage, OnDeactivate, PI_PythonResource::EventMessage::Type::OnDeactivate, "", 14)\
77 MACRO(resourceEventMessage, OnLoad, PI_PythonResource::EventMessage::Type::OnLoad, "", 15)\
78 MACRO(resourceEventMessage, OnUnload, PI_PythonResource::EventMessage::Type::OnUnload, "", 16)
79 
80 #define UT_RESOURCE_RESOURCETYPE_GENERATOR(MACRO)\
81 MACRO(resourceType, NoType, PI_PythonResource::ResourceType::NoType, "", 0)\
82 MACRO(resourceType, ViewerState, PI_PythonResource::ResourceType::ViewerState, "", 1)\
83 MACRO(resourceType, ViewerHandle, PI_PythonResource::ResourceType::ViewerHandle, "", 2)\
84 MACRO(resourceType, Package, PI_PythonResource::ResourceType::Package, "", 3)
85 
86 #define UT_SNAP_PRIORITY_GENERATOR(MACRO)\
87 MACRO(snappingPriority, GeoEdge, DM_SnapPriority::GeoEdge, "", 0)\
88 MACRO(snappingPriority, GeoPoint, DM_SnapPriority::GeoPoint, "", 1)\
89 MACRO(snappingPriority, GeoPrim, DM_SnapPriority::Primitive, "", 2)\
90 MACRO(snappingPriority, Midpoint, DM_SnapPriority::Midpoint, "", 3)\
91 MACRO(snappingPriority, Breakpoint, DM_SnapPriority::BreakPoint, "", 4)\
92 MACRO(snappingPriority, GridPoint, DM_SnapPriority::GridPoint, "", 5)\
93 MACRO(snappingPriority, GridEdge, DM_SnapPriority::GridEdge, "", 6)\
94 MACRO(snappingPriority, PrimGuidePoint, DM_SnapPriority::PrimGuidePoint, "", 7)\
95 MACRO(snappingPriority, PrimGuideEdge, DM_SnapPriority::PrimGuideEdge, "", 8)
96 
97 #define UT_TRIGGER_SELECTOR_GENERATOR(MACRO)\
98 MACRO(triggerSelectorAction, Start, PI_PythonState::SelectorAction::Start, "", 0)\
99 MACRO(triggerSelectorAction, Stop, PI_PythonState::SelectorAction::Stop, "", 1)\
100 MACRO(triggerSelectorAction, Toggle, PI_PythonState::SelectorAction::Toggle, "", 2)
101 
102 #define UT_GEOMETRY_DRAWABLE_TYPE_GENERATOR(MACRO)\
103 MACRO(drawableGeometryType, Line, DM_Widget::Widget::HighlighterType::Line, "", 0)\
104 MACRO(drawableGeometryType, Face, DM_Widget::Widget::HighlighterType::Face, "", 1)\
105 MACRO(drawableGeometryType, Point, DM_Widget::Widget::HighlighterType::Point, "", 2)\
106 MACRO(drawableGeometryType, Vector, DM_Widget::Widget::HighlighterType::Vector, "", 3)
107 
108 #define UT_TEXT_DRAWABLE_ORIGIN_GENERATOR(MACRO)\
109 MACRO(drawableTextOrigin, BottomLeft, DM_Widget::ReferencePoint::BOTTOM_LEFT, "", 0)\
110 MACRO(drawableTextOrigin, BottomCenter, DM_Widget::ReferencePoint::BOTTOM_CENTER, "", 1)\
111 MACRO(drawableTextOrigin, BottomRight, DM_Widget::ReferencePoint::BOTTOM_RIGHT, "", 2)\
112 MACRO(drawableTextOrigin, LeftCenter, DM_Widget::ReferencePoint::LEFT_CENTER, "", 3)\
113 MACRO(drawableTextOrigin, RightCenter, DM_Widget::ReferencePoint::RIGHT_CENTER, "", 4)\
114 MACRO(drawableTextOrigin, UpperLeft, DM_Widget::ReferencePoint::UPPER_LEFT, "", 5)\
115 MACRO(drawableTextOrigin, UpperCenter, DM_Widget::ReferencePoint::UPPER_CENTER, "", 6)\
116 MACRO(drawableTextOrigin, UpperRight, DM_Widget::ReferencePoint::UPPER_RIGHT, "", 7)
117 
118 #define UT_GEOMETRY_DRAWABLE_FACESTYLE_GENERATOR(MACRO)\
119 MACRO(drawableGeometryFaceStyle, Plain, DM_Widget::FaceHighlighter::Styles::PLAIN, "", 0)\
120 MACRO(drawableGeometryFaceStyle, Columns, DM_Widget::FaceHighlighter::Styles::COLUMNS,"", 1)\
121 MACRO(drawableGeometryFaceStyle, Rows, DM_Widget::FaceHighlighter::Styles::ROWS, "", 2)\
122 MACRO(drawableGeometryFaceStyle, Checker, DM_Widget::FaceHighlighter::Styles::CHECKER,"", 3)\
123 MACRO(drawableGeometryFaceStyle, Circle, DM_Widget::FaceHighlighter::Styles::CIRCLES,"", 4)
124 
125 #define UT_GEOMETRY_DRAWABLE_LINESTYLE_GENERATOR(MACRO)\
126 MACRO(drawableGeometryLineStyle, Plain, DM_Widget::LineHighlighter::Styles::PLAIN, "", 0)\
127 MACRO(drawableGeometryLineStyle, Dash1, DM_Widget::LineHighlighter::Styles::DASH_1_2, "", 1)\
128 MACRO(drawableGeometryLineStyle, Dash2, DM_Widget::LineHighlighter::Styles::DASH_1_3, "", 2)\
129 MACRO(drawableGeometryLineStyle, Dash3, DM_Widget::LineHighlighter::Styles::DASH_1_4, "", 3)\
130 MACRO(drawableGeometryLineStyle, Dot1, DM_Widget::LineHighlighter::Styles::DOT_1, "", 4)\
131 MACRO(drawableGeometryLineStyle, Dot2, DM_Widget::LineHighlighter::Styles::DOT_1_2, "", 5)\
132 MACRO(drawableGeometryLineStyle, Dot3, DM_Widget::LineHighlighter::Styles::DOT_1_4, "", 6)\
133 MACRO(drawableGeometryLineStyle, Dot4, DM_Widget::LineHighlighter::Styles::DOT_1_8, "", 7)
134 
135 #define UT_GEOMETRY_DRAWABLE_POINTSTYLE_GENERATOR(MACRO)\
136 MACRO(drawableGeometryPointStyle, LinearCircle, DM_Widget::PointHighlighter::Styles::LINEAR_CIRCLE, "", 0)\
137 MACRO(drawableGeometryPointStyle, LinearSquare, DM_Widget::PointHighlighter::Styles::LINEAR_SQUARE, "", 1)\
138 MACRO(drawableGeometryPointStyle, SmoothCircle, DM_Widget::PointHighlighter::Styles::SMOOTH_CIRCLE, "", 2)\
139 MACRO(drawableGeometryPointStyle, SmoothSquare, DM_Widget::PointHighlighter::Styles::SMOOTH_SQUARE, "", 3)\
140 MACRO(drawableGeometryPointStyle, RingsCircle, DM_Widget::PointHighlighter::Styles::RINGS_CIRCLE, "", 4)\
141 MACRO(drawableGeometryPointStyle, RingsSquare, DM_Widget::PointHighlighter::Styles::RINGS_SQUARE, "", 5)
142 
143 #define UT_GEOMETRY_DRAWABLE_RAMPCLAMP_GENERATOR(MACRO)\
144 MACRO(drawableRampClamp, Repeat, RE_TexClampType::RE_CLAMP_REPEAT, "", 0)\
145 MACRO(drawableRampClamp, Border, RE_TexClampType::RE_CLAMP_BORDER, "", 1)\
146 MACRO(drawableRampClamp, Edge, RE_TexClampType::RE_CLAMP_EDGE, "", 2)\
147 MACRO(drawableRampClamp, Mirror, RE_TexClampType::RE_CLAMP_MIRROR, "", 3)
148 
149 #define UT_GEOMETRY_DRAWABLE_HIGHLIGHT_MODE_GENERATOR(MACRO)\
150 MACRO(drawableHighlightMode, Glow, DM_Widget::HighlightMode::GLOW_ONLY, "", 0)\
151 MACRO(drawableHighlightMode, Matte, DM_Widget::HighlightMode::MATTE_ONLY, "", 1)\
152 MACRO(drawableHighlightMode, GlowMinusMatte, DM_Widget::HighlightMode::GLOW_MINUS_MATTE, "", 2)\
153 MACRO(drawableHighlightMode, MatteOverGlow, DM_Widget::HighlightMode::MATTE_OVER_GLOW, "", 3)\
154 MACRO(drawableHighlightMode, Transparent, DM_Widget::HighlightMode::TRANSPARENT_MATTE,"", 4)
155 
156 #define UT_RESOURCE_EVENT_GENERATOR(MACRO)\
157 MACRO(Activate, "")\
158 MACRO(BeginHandleToState, "")\
159 MACRO(Command, "")\
160 MACRO(Create, "")\
161 MACRO(Deactivate, "")\
162 MACRO(DragTest, "")\
163 MACRO(Draw, "")\
164 MACRO(DrawInterrupt, "")\
165 MACRO(DrawSetup, "")\
166 MACRO(DropAccept, "")\
167 MACRO(DropGetOptions, "")\
168 MACRO(EndHandleToState, "")\
169 MACRO(Enter, "")\
170 MACRO(Exit, "")\
171 MACRO(Generate, "")\
172 MACRO(HandleToState, "")\
173 MACRO(HasAttr, "")\
174 MACRO(Init, "")\
175 MACRO(Interrupt, "")\
176 MACRO(Key, "Event")\
177 MACRO(KeyTransit, "Event")\
178 MACRO(MenuAction, "")\
179 MACRO(MenuPreOpen, "")\
180 MACRO(Mouse, "Event")\
181 MACRO(MouseDoubleClick, "Event")\
182 MACRO(MouseIndirect, "Event")\
183 MACRO(MouseWheel, "Event")\
184 MACRO(ParmChange, "Event")\
185 MACRO(Resume, "")\
186 MACRO(Selection, "")\
187 MACRO(StartSelection, "")\
188 MACRO(StopSelection, "")\
189 MACRO(StateToHandle, "")\
190 MACRO(Term, "")
191 
192 #define UT_VIEWERSTATE_EVENT_GENERATOR(MACRO)\
193 MACRO(BeginHandleToState, "")\
194 MACRO(Command, "")\
195 MACRO(Create, "")\
196 MACRO(DropAccept, "")\
197 MACRO(DropGetOptions, "")\
198 MACRO(DragTest, "")\
199 MACRO(Draw, "")\
200 MACRO(DrawInterrupt, "")\
201 MACRO(EndHandleToState, "")\
202 MACRO(Enter, "")\
203 MACRO(Exit, "")\
204 MACRO(Generate, "")\
205 MACRO(HandleToState, "")\
206 MACRO(HasAttr, "")\
207 MACRO(Init, "")\
208 MACRO(Interrupt, "")\
209 MACRO(Key, "Event")\
210 MACRO(KeyTransit, "Event")\
211 MACRO(MenuAction, "")\
212 MACRO(MenuPreOpen, "")\
213 MACRO(Mouse, "Event")\
214 MACRO(MouseDoubleClick, "Event")\
215 MACRO(MouseWheel, "Event")\
216 MACRO(ParmChange, "Event")\
217 MACRO(Resume, "")\
218 MACRO(Selection, "")\
219 MACRO(StartSelection, "")\
220 MACRO(StopSelection, "")\
221 MACRO(StateToHandle, "")\
222 MACRO(Term, "")
223 
224 #define UT_VIEWERHANDLE_EVENT_GENERATOR(MACRO)\
225 MACRO(Create, "")\
226 MACRO(Draw, "")\
227 MACRO(DrawSetup, "")\
228 MACRO(Activate, "")\
229 MACRO(Deactivate, "")\
230 MACRO(HasAttr, "")\
231 MACRO(Init, "")\
232 MACRO(Key, "Event")\
233 MACRO(KeyTransit, "Event")\
234 MACRO(MenuAction, "")\
235 MACRO(MenuPreOpen, "")\
236 MACRO(Mouse, "Event")\
237 MACRO(MouseIndirect, "Event")\
238 MACRO(MouseWheel, "Event")\
239 MACRO(ParmChange, "Event")\
240 MACRO(Term, "")
241 
242 #define UT_SECURE_SELECTION_OPTIONS_GENERATOR(MACRO)\
243 MACRO(secureSelectionOption, Ignore, PI_PythonState::SecureSelectionOption::Ignore, "", 0)\
244 MACRO(secureSelectionOption, Obey, PI_PythonState::SecureSelectionOption::Obey, "", 1)\
245 MACRO(secureSelectionOption, On, PI_PythonState::SecureSelectionOption::On, "", 2)\
246 MACRO(secureSelectionOption, Off, PI_PythonState::SecureSelectionOption::Off, "", 3)
247 
248 #define UT_GEOMETRY_VIEWPORT_EVENT_GENERATOR(MACRO)\
249 MACRO(geometryViewportEvent, CameraSwitched, BM_ViewportEventIDHOM::CAMERA_SWITCHED, "", 0)
250 
251 #define UT_SCENE_VIEWER_EVENT_GENERATOR(MACRO)\
252 MACRO(sceneViewerEvent, BeginResize, BM_ViewerEventIDHOM::BEGIN_RESIZING, "", 0)\
253 MACRO(sceneViewerEvent, EndResize, BM_ViewerEventIDHOM::END_RESIZING, "", 1)\
254 MACRO(sceneViewerEvent, SizeChanged, BM_ViewerEventIDHOM::SIZE_CHANGED, "", 2)\
255 MACRO(sceneViewerEvent, LayoutChanged, BM_ViewerEventIDHOM::LAYOUT_CHANGED, "", 3)\
256 MACRO(sceneViewerEvent, ColorSchemeChanged, BM_ViewerEventIDHOM::COLOR_SCHEME_CHANGED, "", 4)\
257 MACRO(sceneViewerEvent, SelectedViewportChanged, BM_ViewerEventIDHOM::SELECTED_VIEWPORT_CHANGED, "", 5)
258 
259 #define UT_HUDINFO_STATE_GENERATOR(MACRO)\
260 MACRO(hudInfoState, NoState, BM_SceneManager::HUDInfoArgs::State::NoState, "", 0)\
261 MACRO(hudInfoState, Maximize, BM_SceneManager::HUDInfoArgs::State::Maximize, "", 1)\
262 MACRO(hudInfoState, Minimize, BM_SceneManager::HUDInfoArgs::State::Minimize, "", 2)\
263 MACRO(hudInfoState, Toggle, BM_SceneManager::HUDInfoArgs::State::Toggle, "", 3)
264 
265 #endif // UT_EnumMacros_H