HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Defines.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_Defines_h__
10 #define __HOM_Defines_h__
11 
12 #include <UT/UT_Assert.h>
13 
14 // Unfortunately, we can't compare against UT_ASSERT_LEVEL_PARANOID here,
15 // otherwise the comparison sometimes succeeds under swig when it shouldn't.
16 // So, we instead compare against the numeric value itself.
17 #if UT_ASSERT_LEVEL >= 2
18 #define HOM_DEBUG
19 #endif
20 
21 #ifdef SWIG
22 #define SWIGOUT(x) x
23 #else
24 #define SWIGOUT(x)
25 #endif
26 
27 #if defined(SWIG) && defined(SWIGPYTHON)
28 #define SWIGPYTHONOUT(x) x
29 #else
30 #define SWIGPYTHONOUT(x)
31 #endif
32 
33 // Define a synonym for hboost::any to customize a typemap for arguments that
34 // are to hold values to be inserted into a UT_Options object. SWIG allows
35 // typemaps to be defined for each typename independently.
36 #include <hboost/any.hpp>
38 
39 // Define a synonym for hboost::any to customize a typemap for arguments that
40 // are to return drag-n-drop source data. SWIG allows typemaps to be defined
41 // for each typename independently.
43 
44 // The following define should go in SYS_Math.h when we are ready to
45 // add equivalent defines for MAX_DOUBLE, MAX_INT, MIN_INT etc.
46 #define HOM_MIN_NEGATIVE_DOUBLE -1 * std::numeric_limits<double>::max()
47 
48 #ifdef SWIG
49 
50 //----------------------------------------------------------------------------
51 
52 // Since there's no way for a C++ function to have varying return types,
53 // we need to add special methods and functions that are only known
54 // to swig. For python, there's a typemap for PyObject* so that when
55 // swig encounters a function returning that type it won't try to wrap
56 // the return value, and will instead send it directly to the interpreter.
57 // We create a typemap for this type so our code can use it instead of
58 // PyObject* directly so it's easier to use more than just python in the
59 // future.
60 
61 // The swig code we output directly to the swig wrapper below (using %{%})
62 // uses InterpreterObject, so we need to say what it is.
63 %{
64 #ifdef SWIGPYTHON
65 typedef PyObject *InterpreterObject;
66 
67 PyObject *HOMincRef(PyObject *object)
68 {
69  if (!object)
70  object = Py_None;
71  Py_INCREF(object);
72  return object;
73 }
74 #endif
75 %}
76 
77 // We need to tell swig what InterpreterObject is so it applies the PyObject*
78 // typemap properly.
79 typedef PyObject *InterpreterObject;
80 
81 //----------------------------------------------------------------------------
82 
83 %{
84 
85 #include <UT/UT_StdUtil.h>
86 #include <HOM/HOM_ErrorUtil.h>
87 
88 // These helper functions convert from C++ objects to corresponding
89 // interpreter objects (PyObject*'s in python). They're roughly the same
90 // as swig::from(), but swig::from() does a slow lookup on the name of the
91 // type. These functions know the type at compile-time so they're faster.
92 // Unfortunately, we need to explicitly specialize all the types supported by
93 // the functions. Specifically, since HOM_IterableList calls these functions,
94 // objects that can be inside HOM_IterableList need to be specialized below.
95 
96 // The general case is left unimplemented so we get compiler errors if
97 // we call the function with an unspecialized type.
98 template <typename T> InterpreterObject
99 HOMconvertValueForInterpreter(const T &value, int own);
100 
101 // These functions specialize the native data types.
102 template <> InterpreterObject
103 HOMconvertValueForInterpreter<int>(const int& value, int /*own*/)
104 { return SWIG_From_int(value); }
105 
106 template <> InterpreterObject
107 HOMconvertValueForInterpreter<float>(const float& value, int /*own*/)
108 { return SWIG_From_float(value); }
109 
110 template <> InterpreterObject
111 HOMconvertValueForInterpreter<double>(const double& value, int /*own*/)
112 { return SWIG_From_double(value); }
113 
114 template <> InterpreterObject
115 HOMconvertValueForInterpreter<std::string>(
116  const std::string& value, int /*own*/)
117 { return SWIG_From_std_string(value); }
118 
119 // These functions specialize base classes to return interpreter instances
120 // of the proper subclass.
121 template <> InterpreterObject
122 HOMconvertValueForInterpreter<HOM_Node*>(HOM_Node *const &node, int own)
123 {
124  OP_OpTypeId optypeid;
125  HOM_NodeType *nodetype = nullptr;
126  bool isnetwork = false;
127 
128  if (!node)
129  return SWIG_NewPointerObj(node, SWIGTYPE_p_HOM_Node, own);
130 
131  optypeid = (OP_OpTypeId)node->opTypeIdAsInt();
132  switch (optypeid)
133  {
134  case OBJ_OPTYPE_ID:
135  // Because of multiple inheritance, it's extremely important that
136  // we explicitly cast the pointer to a HOM_ObjNode so we
137  // pass the right address to SWIG_NewPointerObject, since it takes
138  // a void*.
139  return SWIG_NewPointerObj(
140  (void*)dynamic_cast<const HOM_ObjNode* const>(node),
141  SWIGTYPE_p_HOM_ObjNode, own);
142 
143  case SOP_OPTYPE_ID:
144  // Because of multiple inheritance, it's extremely important that
145  // we explicitly cast the pointer to a HOM_SopNode so we
146  // pass the right address to SWIG_NewPointerObject, since it takes
147  // a void*.
148  return SWIG_NewPointerObj(
149  (void*)dynamic_cast<const HOM_SopNode* const>(node),
150  SWIGTYPE_p_HOM_SopNode, own);
151 
152  case CHOP_OPTYPE_ID:
153  // Because of multiple inheritance, it's extremely important that
154  // we explicitly cast the pointer to a HOM_ChopNode so we
155  // pass the right address to SWIG_NewPointerObject, since it takes
156  // a void*.
157  return SWIG_NewPointerObj(
158  (void*)dynamic_cast<const HOM_ChopNode* const>(node),
159  SWIGTYPE_p_HOM_ChopNode, own);
160 
161  case COP2_OPTYPE_ID:
162  // Because of multiple inheritance, it's extremely important that
163  // we explicitly cast the pointer to a HOM_CopNode so we
164  // pass the right address to SWIG_NewPointerObject, since it takes
165  // a void*.
166  return SWIG_NewPointerObj(
167  (void*)dynamic_cast<const HOM_CopNode* const>(node),
168  SWIGTYPE_p_HOM_CopNode, own);
169 
170  case DOP_OPTYPE_ID:
171  // Because of multiple inheritance, it's extremely important that
172  // we explicitly cast the pointer to a HOM_DopNode so we
173  // pass the right address to SWIG_NewPointerObject, since it takes
174  // a void*.
175  return SWIG_NewPointerObj(
176  (void*)dynamic_cast<const HOM_DopNode* const>(node),
177  SWIGTYPE_p_HOM_DopNode, own);
178 
179  case SHOP_OPTYPE_ID:
180  // Because of multiple inheritance, it's extremely important that
181  // we explicitly cast the pointer to a HOM_ShopNode so we
182  // pass the right address to SWIG_NewPointerObject, since it takes
183  // a void*.
184  return SWIG_NewPointerObj(
185  (void*)dynamic_cast<const HOM_ShopNode* const>(node),
186  SWIGTYPE_p_HOM_ShopNode, own);
187 
188  case VOPNET_OPTYPE_ID:
189  // Because of multiple inheritance, it's extremely important that
190  // we explicitly cast the pointer to a HOM_VopNetNode so we
191  // pass the right address to SWIG_NewPointerObject, since it takes
192  // a void*.
193  return SWIG_NewPointerObj(
194  (void*)dynamic_cast<const HOM_VopNetNode* const>(node),
195  SWIGTYPE_p_HOM_VopNetNode, own);
196 
197  case ROP_OPTYPE_ID:
198  // Because of multiple inheritance, it's extremely important that
199  // we explicitly cast the pointer to a HOM_RopNode so we
200  // pass the right address to SWIG_NewPointerObject, since it takes
201  // a void*.
202  return SWIG_NewPointerObj(
203  (void*)dynamic_cast<const HOM_RopNode* const>(node),
204  SWIGTYPE_p_HOM_RopNode, own);
205 
206  case VOP_OPTYPE_ID:
207  // Because of multiple inheritance, it's extremely important that
208  // we explicitly cast the pointer to a HOM_VopNode so we
209  // pass the right address to SWIG_NewPointerObject, since it takes
210  // a void*.
211  return SWIG_NewPointerObj(
212  (void*)dynamic_cast<const HOM_VopNode* const>(node),
213  SWIGTYPE_p_HOM_VopNode, own);
214 
215  case TOP_OPTYPE_ID:
216  // Because of multiple inheritance, it's extremely important that
217  // we explicitly cast the pointer to a HOM_TopNode so we
218  // pass the right address to SWIG_NewPointerObject, since it takes
219  // a void*.
220  return SWIG_NewPointerObj(
221  (void*)dynamic_cast<const HOM_TopNode* const>(node),
222  SWIGTYPE_p_HOM_TopNode, own);
223 
224  case LOP_OPTYPE_ID:
225  // Because of multiple inheritance, it's extremely important that
226  // we explicitly cast the pointer to a HOM_LopNode so we
227  // pass the right address to SWIG_NewPointerObject, since it takes
228  // a void*.
229  //
230  // Special test for LOP Network management nodes, since LOP_Networks
231  // have their own HOM data type.
232  nodetype = node->type();
233  isnetwork = (nodetype && nodetype->isManager(true));
234  delete nodetype;
235  if (isnetwork)
236  return SWIG_NewPointerObj(
237  (void*)dynamic_cast<const HOM_LopNetwork* const>(node),
238  SWIGTYPE_p_HOM_LopNetwork, own);
239  else
240  return SWIG_NewPointerObj(
241  (void*)dynamic_cast<const HOM_LopNode* const>(node),
242  SWIGTYPE_p_HOM_LopNode, own);
243 
244  case MGR_OPTYPE_ID:
245  // Special case for the /stage manager node, which is actually a
246  // LOP_Network, and therefore a LOP_Node.
247  if (HOM().lopNodeTypeCategory() == node->childTypeCategory())
248  return SWIG_NewPointerObj(
249  (void*)dynamic_cast<const HOM_LopNetwork* const>(node),
250  SWIGTYPE_p_HOM_LopNetwork, own);
251 
252  default:
253  break;
254  };
255 
256  return SWIG_NewPointerObj(node, SWIGTYPE_p_HOM_Node, own);
257 }
258 
259 template <> InterpreterObject
260 HOMconvertValueForInterpreter<HOM_NodeType*>(
261  HOM_NodeType *const &nodetype, int own)
262 {
263  OP_OpTypeId optypeid;
264 
265  if (!nodetype)
266  return SWIG_NewPointerObj(nodetype, SWIGTYPE_p_HOM_NodeType, own);
267 
268  if( !nodetype->managerFlag() )
269  {
270  optypeid = (OP_OpTypeId)nodetype->opTypeIdAsInt();
271  switch (optypeid)
272  {
273  case SOP_OPTYPE_ID:
274  // Because of multiple inheritance, it's extremely important that
275  // we explicitly cast the pointer to a HOM_SopNodeType so we
276  // pass the right address to SWIG_NewPointerObject, since it takes
277  // a void*.
278  return SWIG_NewPointerObj(
279  (void*)dynamic_cast<const HOM_SopNodeType* const>(nodetype),
280  SWIGTYPE_p_HOM_SopNodeType, own);
281 
282  case SHOP_OPTYPE_ID:
283  // Because of multiple inheritance, it's extremely important that
284  // we explicitly cast the pointer to a HOM_ShopNodeType so we
285  // pass the right address to SWIG_NewPointerObject, since it takes
286  // a void*.
287  return SWIG_NewPointerObj(
288  (void*)dynamic_cast<const HOM_ShopNodeType* const>(nodetype),
289  SWIGTYPE_p_HOM_ShopNodeType, own);
290 
291  case VOP_OPTYPE_ID:
292  // Because of multiple inheritance, it's extremely important that
293  // we explicitly cast the pointer to a HOM_VopNodeType so we
294  // pass the right address to SWIG_NewPointerObject, since it takes
295  // a void*.
296  return SWIG_NewPointerObj(
297  (void*)dynamic_cast<const HOM_VopNodeType* const>(nodetype),
298  SWIGTYPE_p_HOM_VopNodeType, own);
299  default:
300  break;
301  }
302  }
303 
304  return SWIG_NewPointerObj(nodetype, SWIGTYPE_p_HOM_NodeType, own);
305 }
306 
307 template <> InterpreterObject
308 HOMconvertValueForInterpreter<HOM_BaseKeyframe*>(
309  HOM_BaseKeyframe *const &keyframe, int own)
310 {
311  if (!keyframe)
312  return SWIG_NewPointerObj(keyframe, SWIGTYPE_p_HOM_BaseKeyframe, own);
313 
314  if (keyframe->evaluatedType() == HOM_parmData::Float)
315  {
316  // Because of multiple inheritance, it's extremely important that
317  // we explicitly cast the pointer to a HOM_Keyframe so we
318  // pass the right address to SWIG_NewPointerObject, since it takes
319  // a void*.
320  return SWIG_NewPointerObj(
321  (void*)dynamic_cast<const HOM_Keyframe* const>(keyframe),
322  SWIGTYPE_p_HOM_Keyframe, own);
323  }
324  else if (keyframe->evaluatedType() == HOM_parmData::String)
325  {
326  // Because of multiple inheritance, it's extremely important that
327  // we explicitly cast the pointer to a HOM_Keyframe so we
328  // pass the right address to SWIG_NewPointerObject, since it takes
329  // a void*.
330  return SWIG_NewPointerObj(
331  (void*)dynamic_cast<const HOM_StringKeyframe* const>(keyframe),
332  SWIGTYPE_p_HOM_StringKeyframe, own);
333  }
334 
335  return SWIG_NewPointerObj(keyframe, SWIGTYPE_p_HOM_BaseKeyframe, own);
336 }
337 
338 template <> InterpreterObject
339 HOMconvertValueForInterpreter<HOM_PackedPrim*>(HOM_PackedPrim *const &prim, int own)
340 {
341  if (!prim)
342  return SWIG_NewPointerObj(prim, SWIGTYPE_p_HOM_PackedPrim, own);
343 
344  // Because of multiple inheritance, it's extremely important that
345  // we explicitly cast the pointer to the right HOM type so we
346  // pass the right address to SWIG_NewPointerObject, since it takes
347  // a void*.
348 
349  switch (prim->type().id())
350  {
351  case HOM_primType::Agent_Id:
352  return SWIG_NewPointerObj(
353  (void *)dynamic_cast<const HOM_Agent *const>(prim),
354  SWIGTYPE_p_HOM_Agent, own);
355 
356  case HOM_primType::PackedFragment_Id:
357  return SWIG_NewPointerObj(
358  (void *)dynamic_cast<const HOM_PackedFragment *const>(prim),
359  SWIGTYPE_p_HOM_PackedFragment, own);
360 
361  case HOM_primType::PackedGeometry_Id:
362  return SWIG_NewPointerObj(
363  (void *)dynamic_cast<const HOM_PackedGeometry *const>(prim),
364  SWIGTYPE_p_HOM_PackedGeometry, own);
365  }
366 
367  return SWIG_NewPointerObj(
368  (void *)dynamic_cast<const HOM_PackedPrim *const>(prim),
369  SWIGTYPE_p_HOM_PackedPrim, own);
370 }
371 
372 template <> InterpreterObject
373 HOMconvertValueForInterpreter<HOM_Prim*>(HOM_Prim *const &prim, int own)
374 {
375  if (!prim)
376  return SWIG_NewPointerObj(prim, SWIGTYPE_p_HOM_Prim, own);
377 
378  // Because of multiple inheritance, it's extremely important that
379  // we explicitly cast the pointer to the right HOM type so we
380  // pass the right address to SWIG_NewPointerObject, since it takes
381  // a void*.
382  HOM_PackedPrim * packed = dynamic_cast<HOM_PackedPrim *>(prim);
383  if(packed)
384  return HOMconvertValueForInterpreter(packed, own);
385 
386  switch (prim->type().id())
387  {
388  case HOM_primType::Polygon_Id:
389  return SWIG_NewPointerObj(
390  (void*)dynamic_cast<const HOM_Polygon* const>(prim),
391  SWIGTYPE_p_HOM_Polygon, own);
392 
393  case HOM_primType::NURBSCurve_Id:
394  case HOM_primType::BezierCurve_Id:
395  return SWIG_NewPointerObj(
396  (void*)dynamic_cast<const HOM_Face* const>(prim),
397  SWIGTYPE_p_HOM_Face, own);
398 
399  case HOM_primType::Mesh_Id:
400  case HOM_primType::NURBSSurface_Id:
401  case HOM_primType::BezierSurface_Id:
402  return SWIG_NewPointerObj(
403  (void*)dynamic_cast<const HOM_Surface* const>(prim),
404  SWIGTYPE_p_HOM_Surface, own);
405 
406  case HOM_primType::Circle_Id:
407  case HOM_primType::Sphere_Id:
408  case HOM_primType::Tube_Id:
409  return SWIG_NewPointerObj(
410  (void*)dynamic_cast<const HOM_Quadric* const>(prim),
411  SWIGTYPE_p_HOM_Quadric, own);
412 
413  case HOM_primType::Volume_Id:
414  return SWIG_NewPointerObj(
415  (void*)dynamic_cast<const HOM_Volume* const>(prim),
416  SWIGTYPE_p_HOM_Volume, own);
417 
418  case HOM_primType::VDB_Id:
419  return SWIG_NewPointerObj(
420  (void*)dynamic_cast<const HOM_VDB* const>(prim),
421  SWIGTYPE_p_HOM_VDB, own);
422 
423  // TODO: Support more primitive types.
424  }
425 
426  return SWIG_NewPointerObj(prim, SWIGTYPE_p_HOM_Prim, own);
427 }
428 
429 template <> InterpreterObject
430 HOMconvertValueForInterpreter<HOM_ParmTemplate*>(
431  HOM_ParmTemplate *const &parm_template, int own)
432 {
433  if (!parm_template)
434  return SWIG_NewPointerObj(
435  parm_template, SWIGTYPE_p_HOM_ParmTemplate, own);
436 
437  // Because of multiple inheritance, it's extremely important that we
438  // explicitly cast to a pointer to the subclass so we pass the right
439  // address to SWIG_NewPointerObject, since it takes a void*.
440  switch (parm_template->type().id())
441  {
442  case HOM_parmTemplateType::Int_Id:
443  return SWIG_NewPointerObj(
444  (void*)dynamic_cast<const HOM_IntParmTemplate* const>(
445  parm_template),
446  SWIGTYPE_p_HOM_IntParmTemplate, own);
447 
448  case HOM_parmTemplateType::Float_Id:
449  return SWIG_NewPointerObj(
450  (void*)dynamic_cast<const HOM_FloatParmTemplate* const>(
451  parm_template),
452  SWIGTYPE_p_HOM_FloatParmTemplate, own);
453 
454  case HOM_parmTemplateType::String_Id:
455  return SWIG_NewPointerObj(
456  (void*)dynamic_cast<const HOM_StringParmTemplate* const>(
457  parm_template),
458  SWIGTYPE_p_HOM_StringParmTemplate, own);
459 
460  case HOM_parmTemplateType::Data_Id:
461  return SWIG_NewPointerObj(
462  (void*)dynamic_cast<const HOM_DataParmTemplate* const>(
463  parm_template),
464  SWIGTYPE_p_HOM_DataParmTemplate, own);
465 
466  case HOM_parmTemplateType::Toggle_Id:
467  return SWIG_NewPointerObj(
468  (void*)dynamic_cast<const HOM_ToggleParmTemplate* const>(
469  parm_template),
470  SWIGTYPE_p_HOM_ToggleParmTemplate, own);
471 
472  case HOM_parmTemplateType::Menu_Id:
473  return SWIG_NewPointerObj(
474  (void*)dynamic_cast<const HOM_MenuParmTemplate* const>(
475  parm_template),
476  SWIGTYPE_p_HOM_MenuParmTemplate, own);
477 
478  case HOM_parmTemplateType::Button_Id:
479  return SWIG_NewPointerObj(
480  (void*)dynamic_cast<const HOM_ButtonParmTemplate* const>(
481  parm_template),
482  SWIGTYPE_p_HOM_ButtonParmTemplate, own);
483 
484  case HOM_parmTemplateType::Label_Id:
485  return SWIG_NewPointerObj(
486  (void*)dynamic_cast<const HOM_LabelParmTemplate* const>(
487  parm_template),
488  SWIGTYPE_p_HOM_LabelParmTemplate, own);
489 
490  case HOM_parmTemplateType::Separator_Id:
491  return SWIG_NewPointerObj(
492  (void*)dynamic_cast<const HOM_SeparatorParmTemplate* const>(
493  parm_template),
494  SWIGTYPE_p_HOM_SeparatorParmTemplate, own);
495 
496  case HOM_parmTemplateType::FolderSet_Id:
497  return SWIG_NewPointerObj(
498  (void*)dynamic_cast<const HOM_FolderSetParmTemplate* const>(
499  parm_template),
500  SWIGTYPE_p_HOM_FolderSetParmTemplate, own);
501 
502  case HOM_parmTemplateType::Folder_Id:
503  return SWIG_NewPointerObj(
504  (void*)dynamic_cast<const HOM_FolderParmTemplate* const>(
505  parm_template),
506  SWIGTYPE_p_HOM_FolderParmTemplate, own);
507 
508  case HOM_parmTemplateType::Ramp_Id:
509  return SWIG_NewPointerObj(
510  (void*)dynamic_cast<const HOM_RampParmTemplate* const>(
511  parm_template),
512  SWIGTYPE_p_HOM_RampParmTemplate, own);
513  };
514 
515  UT_ASSERT(!"Unknown parm template type");
516  return SWIG_NewPointerObj(parm_template, SWIGTYPE_p_HOM_ParmTemplate, own);
517 }
518 
519 template <> InterpreterObject
520 HOMconvertValueForInterpreter<HOM_PaneTab*>(
521  HOM_PaneTab *const &pane_tab, int own)
522 {
523  if (!pane_tab)
524  return SWIG_NewPointerObj(pane_tab, SWIGTYPE_p_HOM_PaneTab, own);
525 
526  // Because of multiple inheritance, it's extremely important that
527  // we explicitly cast the pointer to the HOM type so we pass the right
528  // address to SWIG_NewPointerObject, since it takes a void*.
529 
530  switch (pane_tab->type().id())
531  {
532  case HOM_paneTabType::ContextViewer_Id:
533  return SWIG_NewPointerObj(
534  (void*)dynamic_cast<const HOM_ContextViewer* const>(pane_tab),
535  SWIGTYPE_p_HOM_ContextViewer, own);
536 
537  case HOM_paneTabType::SceneViewer_Id:
538  return SWIG_NewPointerObj(
539  (void*)dynamic_cast<const HOM_SceneViewer* const>(pane_tab),
540  SWIGTYPE_p_HOM_SceneViewer, own);
541 
542  case HOM_paneTabType::CompositorViewer_Id:
543  return SWIG_NewPointerObj(
544  (void*)dynamic_cast<const HOM_CompositorViewer* const>(pane_tab),
545  SWIGTYPE_p_HOM_CompositorViewer, own);
546 
547  case HOM_paneTabType::NetworkEditor_Id:
548  return SWIG_NewPointerObj(
549  (void*)dynamic_cast<const HOM_NetworkEditor* const>(pane_tab),
550  SWIGTYPE_p_HOM_NetworkEditor, own);
551 
552  case HOM_paneTabType::HelpBrowser_Id:
553  return SWIG_NewPointerObj(
554  (void*)dynamic_cast<const HOM_HelpBrowser* const>(pane_tab),
555  SWIGTYPE_p_HOM_HelpBrowser, own);
556 
557  case HOM_paneTabType::PythonPanel_Id:
558  return SWIG_NewPointerObj(
559  (void*)dynamic_cast<const HOM_PythonPanel* const>(pane_tab),
560  SWIGTYPE_p_HOM_PythonPanel, own);
561 
562  case HOM_paneTabType::IPRViewer_Id:
563  return SWIG_NewPointerObj(
564  (void*)dynamic_cast<const HOM_IPRViewer* const>(pane_tab),
565  SWIGTYPE_p_HOM_IPRViewer, own);
566 
567  case HOM_paneTabType::AssetBrowser_Id:
568  return SWIG_NewPointerObj(
569  (void*)dynamic_cast<const HOM_AssetBrowser* const>(pane_tab),
570  SWIGTYPE_p_HOM_AssetBrowser, own);
571 
572  case HOM_paneTabType::PerformanceMonitor_Id:
573  return SWIG_NewPointerObj(
574  (void*)dynamic_cast<const HOM_PerformanceMonitor* const>(pane_tab),
575  SWIGTYPE_p_HOM_PerformanceMonitor, own);
576 
577  case HOM_paneTabType::ChannelEditor_Id:
578  return SWIG_NewPointerObj(
579  (void*)dynamic_cast<const HOM_ChannelEditorPane* const>(pane_tab),
580  SWIGTYPE_p_HOM_ChannelEditorPane, own);
581 
582  case HOM_paneTabType::DataTree_Id:
583  return SWIG_NewPointerObj(
584  (void*)dynamic_cast<const HOM_DataTree* const>(pane_tab),
585  SWIGTYPE_p_HOM_DataTree, own);
586 
587  case HOM_paneTabType::SceneGraphTree_Id:
588  return SWIG_NewPointerObj(
589  (void*)dynamic_cast<const HOM_SceneGraphTree* const>(pane_tab),
590  SWIGTYPE_p_HOM_SceneGraphTree, own);
591 
592  case HOM_paneTabType::Parm_Id:
593  return SWIG_NewPointerObj(
594  (void*)dynamic_cast<const HOM_ParameterEditor* const>(pane_tab),
595  SWIGTYPE_p_HOM_ParameterEditor, own);
596 
597  case HOM_paneTabType::DetailsView_Id:
598  return SWIG_NewPointerObj(
599  (void*)dynamic_cast<const HOM_GeometrySpreadsheet * const>(pane_tab),
600  SWIGTYPE_p_HOM_GeometrySpreadsheet, own);
601 
602  case HOM_paneTabType::ChannelViewer_Id:
603  case HOM_paneTabType::OutputViewer_Id:
604  case HOM_paneTabType::ShaderViewer_Id:
605  case HOM_paneTabType::TreeView_Id:
606  case HOM_paneTabType::RenderGallery_Id:
607  return SWIG_NewPointerObj(
608  (void*)dynamic_cast<const HOM_PathBasedPaneTab* const>(pane_tab),
609  SWIGTYPE_p_HOM_PathBasedPaneTab, own);
610 
611  case HOM_paneTabType::ChannelList_Id:
612  case HOM_paneTabType::Textport_Id:
613  case HOM_paneTabType::PythonShell_Id:
614  case HOM_paneTabType::HandleList_Id:
615  case HOM_paneTabType::BundleList_Id:
616  case HOM_paneTabType::TakeList_Id:
617  case HOM_paneTabType::ParmSpreadsheet_Id:
618  case HOM_paneTabType::LightLinker_Id:
619  case HOM_paneTabType::MaterialPalette_Id:
620  case HOM_paneTabType::EngineSessionSync_Id:
621  return SWIG_NewPointerObj(pane_tab, SWIGTYPE_p_HOM_PaneTab, own);
622  };
623 
624  UT_ASSERT(!"Unknown pane tab type");
625  return SWIG_NewPointerObj(pane_tab, SWIGTYPE_p_HOM_PaneTab, own);
626 }
627 
628 template <> InterpreterObject
629 HOMconvertValueForInterpreter<HOM_SopVerb*>(
630  HOM_SopVerb *const &verb, int own)
631 {
632  return SWIG_NewPointerObj(verb, SWIGTYPE_p_HOM_SopVerb, own);
633 }
634 
635 template <> InterpreterObject
636 HOMconvertValueForInterpreter<HOM_Geometry*>(
637  HOM_Geometry *const &geo, int own)
638 {
639  return SWIG_NewPointerObj(geo, SWIGTYPE_p_HOM_Geometry, own);
640 }
641 
642 template <> InterpreterObject
643 HOMconvertValueForInterpreter<HOM_NetworkItem*>(
644  HOM_NetworkItem *const &item, int own)
645 {
646  if (item)
647  {
648  switch (item->networkItemType().id())
649  {
650  case HOM_networkItemType::Node_Id:
651  // We know its a node, but we need to convert to the specific
652  // node type referred to by this item.
653  return HOMconvertValueForInterpreter(
654  dynamic_cast<HOM_Node* const>(item), own);
655 
656  case HOM_networkItemType::NetworkBox_Id:
657  return SWIG_NewPointerObj(
658  (void*)dynamic_cast<const HOM_NetworkBox* const>(item),
659  SWIGTYPE_p_HOM_NetworkBox, own);
660 
661  case HOM_networkItemType::StickyNote_Id:
662  return SWIG_NewPointerObj(
663  (void*)dynamic_cast<const HOM_StickyNote* const>(item),
664  SWIGTYPE_p_HOM_StickyNote, own);
665 
666  case HOM_networkItemType::SubnetIndirectInput_Id:
667  return SWIG_NewPointerObj(
668  (void*)dynamic_cast<const HOM_SubnetIndirectInput* const>(item),
669  SWIGTYPE_p_HOM_SubnetIndirectInput, own);
670 
671  case HOM_networkItemType::Connection_Id:
672  return SWIG_NewPointerObj(
673  (void*)dynamic_cast<const HOM_NodeConnection* const>(item),
674  SWIGTYPE_p_HOM_NodeConnection, own);
675 
676  case HOM_networkItemType::NetworkDot_Id:
677  return SWIG_NewPointerObj(
678  (void*)dynamic_cast<const HOM_NetworkDot* const>(item),
679  SWIGTYPE_p_HOM_NetworkDot, own);
680 
681  default:
682  break;
683  };
684  }
685 
686  return SWIG_NewPointerObj(item, SWIGTYPE_p_HOM_NetworkItem, own);
687 }
688 
689 template <> InterpreterObject
690 HOMconvertValueForInterpreter<HOM_NetworkMovableItem*>(
691  HOM_NetworkMovableItem *const &item, int own)
692 {
693  if (!item)
694  return SWIG_NewPointerObj(item, SWIGTYPE_p_HOM_NetworkMovableItem, own);
695 
696  return HOMconvertValueForInterpreter<HOM_NetworkItem *>(item, own);
697 }
698 
699 template <> InterpreterObject
700 HOMconvertValueForInterpreter<
701  std::vector<HOM_ElemPtr<HOM_NodeConnection> >*>(
702  std::vector<HOM_ElemPtr<HOM_NodeConnection> > *const &list,
703  int own)
704 {
705  return swig::from(*list);
706 }
707 
708 template <> InterpreterObject
709 HOMconvertValueForInterpreter<HOM_DopData*>(HOM_DopData *const &data, int own)
710 {
711  const HOM_DopObject *const dop_object =
712  dynamic_cast<const HOM_DopObject *const>(data);
713  if (dop_object)
714  return SWIG_NewPointerObj(
715  (void *)dop_object, SWIGTYPE_p_HOM_DopObject, own);
716 
717  const HOM_DopRelationship *const dop_relationship =
718  dynamic_cast<const HOM_DopRelationship *const>(data);
719  if (dop_relationship)
720  return SWIG_NewPointerObj(
721  (void *)dop_relationship, SWIGTYPE_p_HOM_DopRelationship, own);
722 
723  return SWIG_NewPointerObj(data, SWIGTYPE_p_HOM_DopData, own);
724 }
725 
726 template <> InterpreterObject
727 HOMconvertValueForInterpreter<HOM_RadialItem*>(
728  HOM_RadialItem *const &item, int own)
729 {
730  if (item)
731  {
732  switch (item->type().id())
733  {
734  case HOM_radialItemType::Script_Id:
735  return SWIG_NewPointerObj(
736  (void*)dynamic_cast<const HOM_RadialScriptItem* const>(item),
737  SWIGTYPE_p_HOM_RadialScriptItem, own);
738 
739  case HOM_radialItemType::Submenu_Id:
740  return SWIG_NewPointerObj(
741  (void*)dynamic_cast<const HOM_RadialSubmenu* const>(item),
742  SWIGTYPE_p_HOM_RadialSubmenu, own);
743 
744  default:
745  break;
746  };
747  }
748 
749  return SWIG_NewPointerObj(item, SWIGTYPE_p_HOM_RadialItem, own);
750 }
751 
752 template <> InterpreterObject
753 HOMconvertValueForInterpreter<HOM_EnumValue*>(
754  HOM_EnumValue *const &item, int own)
755 {
756  // We should NEVER heap allocate HOM_EnumValue because only return
757  // static instances of them to SWIG.
758  UT_ASSERT(!own);
759 
760  return SWIG_NewPointerObj(
761  (void*)dynamic_cast<const HOM_EnumValue* const>(item),
762  SWIGTYPE_p_HOM_EnumValue, /*own*/0);
763 }
764 
765 // These functions specialize pointers to other classes. If a class is
766 // used inside HOM_IterableList or HOM_ElemPtr, it must be listed here.
767 #define HOM_PROVIDE_SWIG_LOOKUP(type) \
768  template <> InterpreterObject HOMconvertValueForInterpreter<type*>( \
769  type* const& value, int own) \
770  { \
771  return SWIG_NewPointerObj(SWIG_as_voidptr(value), \
772  SWIGTYPE_p_ ## type, own); \
773  }
774 
775 HOM_PROVIDE_SWIG_LOOKUP(HOM_AdvancedDrawable)
776 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentClip)
777 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentDefinition)
778 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentLayer)
779 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentShape)
780 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentShapeBinding)
781 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentShapeDeformer)
782 HOM_PROVIDE_SWIG_LOOKUP(HOM_AgentTransformGroup)
783 HOM_PROVIDE_SWIG_LOOKUP(HOM_Attrib)
784 HOM_PROVIDE_SWIG_LOOKUP(HOM_AttribDataId)
785 HOM_PROVIDE_SWIG_LOOKUP(HOM_ChannelGraphSelection)
786 HOM_PROVIDE_SWIG_LOOKUP(HOM_Color)
787 HOM_PROVIDE_SWIG_LOOKUP(HOM_Desktop)
788 HOM_PROVIDE_SWIG_LOOKUP(HOM_Dialog)
789 HOM_PROVIDE_SWIG_LOOKUP(HOM_DopRecord)
790 HOM_PROVIDE_SWIG_LOOKUP(HOM_Drawable)
791 HOM_PROVIDE_SWIG_LOOKUP(HOM_FloatingPanel)
792 HOM_PROVIDE_SWIG_LOOKUP(HOM_GadgetContext)
793 HOM_PROVIDE_SWIG_LOOKUP(HOM_GadgetDrawable)
794 HOM_PROVIDE_SWIG_LOOKUP(HOM_Gallery)
795 HOM_PROVIDE_SWIG_LOOKUP(HOM_GalleryEntry)
796 HOM_PROVIDE_SWIG_LOOKUP(HOM_GeometrySelection)
797 HOM_PROVIDE_SWIG_LOOKUP(HOM_GeometryViewport)
798 HOM_PROVIDE_SWIG_LOOKUP(HOM_Handle)
799 HOM_PROVIDE_SWIG_LOOKUP(HOM_GeometryDrawable)
800 HOM_PROVIDE_SWIG_LOOKUP(HOM_GeometryDrawableGroup)
801 HOM_PROVIDE_SWIG_LOOKUP(HOM_HDADefinition)
802 HOM_PROVIDE_SWIG_LOOKUP(HOM_HDASection)
803 HOM_PROVIDE_SWIG_LOOKUP(HOM_ik_Joint)
804 HOM_PROVIDE_SWIG_LOOKUP(HOM_IndexPairPropertyTable)
805 HOM_PROVIDE_SWIG_LOOKUP(HOM_logging_LogEntry)
806 HOM_PROVIDE_SWIG_LOOKUP(HOM_LopInstanceIdRule)
807 HOM_PROVIDE_SWIG_LOOKUP(HOM_LopSelectionRule)
808 HOM_PROVIDE_SWIG_LOOKUP(HOM_Matrix2)
809 HOM_PROVIDE_SWIG_LOOKUP(HOM_Matrix3)
810 HOM_PROVIDE_SWIG_LOOKUP(HOM_Matrix4)
811 HOM_PROVIDE_SWIG_LOOKUP(HOM_NetworkBox)
812 HOM_PROVIDE_SWIG_LOOKUP(HOM_NetworkDot)
813 HOM_PROVIDE_SWIG_LOOKUP(HOM_NodeBundle)
814 HOM_PROVIDE_SWIG_LOOKUP(HOM_NodeConnection)
815 HOM_PROVIDE_SWIG_LOOKUP(HOM_NodeGroup)
816 HOM_PROVIDE_SWIG_LOOKUP(HOM_Pane)
817 HOM_PROVIDE_SWIG_LOOKUP(HOM_Parm)
818 HOM_PROVIDE_SWIG_LOOKUP(HOM_ParmTuple)
819 HOM_PROVIDE_SWIG_LOOKUP(HOM_Point)
820 HOM_PROVIDE_SWIG_LOOKUP(HOM_Polygon)
821 HOM_PROVIDE_SWIG_LOOKUP(HOM_PythonPanelInterface)
822 HOM_PROVIDE_SWIG_LOOKUP(HOM_Edge)
823 HOM_PROVIDE_SWIG_LOOKUP(HOM_PointGroup)
824 HOM_PROVIDE_SWIG_LOOKUP(HOM_PrimGroup)
825 HOM_PROVIDE_SWIG_LOOKUP(HOM_EdgeGroup)
826 HOM_PROVIDE_SWIG_LOOKUP(HOM_VertexGroup)
827 HOM_PROVIDE_SWIG_LOOKUP(HOM_Quaternion)
828 HOM_PROVIDE_SWIG_LOOKUP(HOM_RadialMenu)
829 HOM_PROVIDE_SWIG_LOOKUP(HOM_Ramp)
830 HOM_PROVIDE_SWIG_LOOKUP(HOM_Selection)
831 HOM_PROVIDE_SWIG_LOOKUP(HOM_Selector)
832 HOM_PROVIDE_SWIG_LOOKUP(HOM_Shelf)
833 HOM_PROVIDE_SWIG_LOOKUP(HOM_ShelfSet)
834 HOM_PROVIDE_SWIG_LOOKUP(HOM_SimpleDrawable)
835 HOM_PROVIDE_SWIG_LOOKUP(HOM_StickyNote)
836 HOM_PROVIDE_SWIG_LOOKUP(HOM_SubnetIndirectInput)
837 HOM_PROVIDE_SWIG_LOOKUP(HOM_Take)
838 HOM_PROVIDE_SWIG_LOOKUP(HOM_TextDrawable)
839 HOM_PROVIDE_SWIG_LOOKUP(HOM_Tool)
840 HOM_PROVIDE_SWIG_LOOKUP(HOM_Track)
841 HOM_PROVIDE_SWIG_LOOKUP(HOM_UIEvent)
842 HOM_PROVIDE_SWIG_LOOKUP(HOM_UIEventDevice)
843 HOM_PROVIDE_SWIG_LOOKUP(HOM_Vector2)
844 HOM_PROVIDE_SWIG_LOOKUP(HOM_Vector3)
845 HOM_PROVIDE_SWIG_LOOKUP(HOM_Vector4)
846 HOM_PROVIDE_SWIG_LOOKUP(HOM_Vertex)
847 HOM_PROVIDE_SWIG_LOOKUP(HOM_VexContext)
848 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewerHandleContext)
849 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewerHandleTemplate)
850 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewerState)
851 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewerStateContext)
852 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewerStateMenu)
853 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewerStateTemplate)
854 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewportVisualizer)
855 HOM_PROVIDE_SWIG_LOOKUP(HOM_ViewportVisualizerType)
856 
857 %}
858 
859 //----------------------------------------------------------------------------
860 
861 // We create typemaps for base classes that appear as return types to make
862 // sure swig instances the proper subclasses in the interpreter.
863 
864 #define HOM_CONVERT_AND_CATCH \
865  try \
866  { \
867  $result = HOMconvertValueForInterpreter($1, $owner); \
868  } \
869  catch (...) \
870  { \
871  (void)hom::raise_swig_exception(); \
872  $result = nullptr; \
873  } \
874 /**/
875 
876 %typemap(out) HOM_Prim* {
877  HOM_CONVERT_AND_CATCH
878 }
879 
880 %typemap(out) HOM_PackedPrim* {
881  HOM_CONVERT_AND_CATCH
882 }
883 
884 %typemap(out) HOM_Node* {
885  HOM_CONVERT_AND_CATCH
886 }
887 
888 %typemap(out) HOM_NodeType* {
889  HOM_CONVERT_AND_CATCH
890 }
891 
892 %typemap(out) HOM_BaseKeyframe* {
893  HOM_CONVERT_AND_CATCH
894 }
895 
896 %typemap(out) HOM_ParmTemplate* {
897  HOM_CONVERT_AND_CATCH
898 }
899 
900 %typemap(out) HOM_Pane* {
901  HOM_CONVERT_AND_CATCH
902 }
903 
904 %typemap(out) HOM_PaneTab* {
905  HOM_CONVERT_AND_CATCH
906 }
907 
908 %typemap(out) HOM_DopData* {
909  HOM_CONVERT_AND_CATCH
910 }
911 
912 %typemap(out) HOM_RadialItem* {
913  HOM_CONVERT_AND_CATCH
914 }
915 
916 %typemap(out) HOM_NetworkMovableItem* {
917  HOM_CONVERT_AND_CATCH
918 }
919 
920 %typemap(out) HOM_NetworkItem* {
921  HOM_CONVERT_AND_CATCH
922 }
923 
924 %typemap(out) std::vector<HOM_ElemPtr<HOM_NodeConnection> > * {
925  HOM_CONVERT_AND_CATCH
926 }
927 
928 //----------------------------------------------------------------------------
929 
930 // These typemaps convert HOM exceptions into corresponding python standard
931 // exceptions.
932 %typemap(throws) HOM_TypeError %{
933  SWIG_exception_fail(SWIG_TypeError, $1.instanceMessage().c_str());
934 %}
935 
936 %typemap(throws) HOM_ValueError %{
937  SWIG_exception_fail(SWIG_ValueError, $1.instanceMessage().c_str());
938 %}
939 
940 #ifdef SWIGPYTHON
941 %typemap(throws) HOM_SystemExit %{
942  PyErr_SetObject(PyExc_SystemExit, SWIG_From_int($1.code()));
943  SWIG_fail;
944 %}
945 #endif
946 
947 //----------------------------------------------------------------------------
948 
949 // This typemap lets you declare a hboost::any parameter and swig will convert
950 // the interpreter (Python) object to a hboost::any that wraps the C++ data
951 // type.
952 %typemap(in) hboost::any {
953  try
954  {
955  // Note that if we can't convert to a hboost::any, we leave the
956  // hboost::any as empty (i.e. its empty() method returns true).
957  HOMinterpreterObjectToBoostAny($input, $1);
958  }
959  catch (...)
960  {
961  (void)hom::raise_swig_exception();
962  }
963 }
964 
965 // This typemap lets you declare a HOM_UTOptionAny (hboost::any) parameter and
966 // swig will convert the interpreter (Python) object into the C++ data type
967 // for interpreter objects that correspond to a UT_OptionType.
968 %typemap(in) HOM_UTOptionAny {
969  try
970  {
971  // Note that if we can't convert to a hboost::any, we leave the
972  // hboost::any as empty (i.e. its empty() method returns true).
973  HOMinterpreterObjectToUTOptionAny($input, $1);
974  }
975  catch (...)
976  {
977  (void)hom::raise_swig_exception();
978  }
979 }
980 
981 // This typemap lets you return hboost::any objects.
982 %typemap(out) hboost::any {
983  try
984  {
985  $result = HOMboostAnyToInterpreterObject($1);
986  }
987  catch (...)
988  {
989  (void)hom::raise_swig_exception();
990  }
991 }
992 
993 %typemap(out) HOM_DDSourceAny {
994  try
995  {
996  $result = HOMDDSourceAnyToInterpreterObject($1);
997  }
998  catch (...)
999  {
1000  (void)hom::raise_swig_exception();
1001  }
1002 }
1003 
1004 //----------------------------------------------------------------------------
1005 
1006 #ifdef SWIGPYTHON
1007 %typemap(out) PY_OpaqueObject {
1008  $result = HOMincRef((InterpreterObject)$1.opaqueObject());
1009 }
1010 #endif
1011 
1012 // For whatever reason, adding the typemap does not customize swig::from(),
1013 // so we do that manually.
1014 %{
1015 #ifdef SWIGPYTHON
1016 namespace swig {
1017  template <>
1018  struct traits_from<PY_OpaqueObject>
1019  {
1020  static PyObject *from(const PY_OpaqueObject &val)
1021  {
1022  return HOMincRef((InterpreterObject)val.opaqueObject());
1023  }
1024  };
1025 }
1026 #endif
1027 
1028 //----------------------------------------------------------------------------
1029 
1030 // This helper function takes an interpreter (Python) object and converts it
1031 // into a hboost::any object. It returns whether or not the conversion was
1032 // possible, and leaves the hboost::any unchanged if a conversion wasn't
1033 // possible.
1034 bool
1035 HOMinterpreterObjectToBoostAny(InterpreterObject input, hboost::any &result)
1036 {
1037 #ifdef SWIGPYTHON
1038  if (input == Py_None)
1039  {
1040  result = (void *)NULL;
1041  return true;
1042  }
1043 
1044  // SWIG_AsVal_bool is too permissive, and treats thinks that an integer
1045  // is a bool. So, we explicitly check against True and False.
1046  if (input == Py_True)
1047  {
1048  result = true;
1049  return true;
1050  }
1051 
1052  if (input == Py_False)
1053  {
1054  result = false;
1055  return true;
1056  }
1057 #endif
1058 
1059  int int_result;
1060  if (SWIG_IsOK(SWIG_AsVal_int(input, &int_result)))
1061  {
1062  result = int_result;
1063  return true;
1064  }
1065 
1066  double double_result;
1067  if (SWIG_IsOK(SWIG_AsVal_double(input, &double_result)))
1068  {
1069  result = double_result;
1070  return true;
1071  }
1072 
1073  std::string string_result;
1074  if (SWIG_IsOK(SWIG_AsVal_std_string(input, &string_result)))
1075  {
1076  result = string_result;
1077  return true;
1078  }
1079 
1080  void *geometry_result = NULL;
1081  if (SWIG_IsOK(SWIG_ConvertPtr(input, &geometry_result,
1082  SWIGTYPE_p_HOM_Geometry, 0)) && geometry_result)
1083  {
1084  result = reinterpret_cast<HOM_Geometry *>(geometry_result);
1085  return true;
1086  }
1087 
1088  void *ramp_result = NULL;
1089  if (SWIG_IsOK(SWIG_ConvertPtr(input, &ramp_result,
1090  SWIGTYPE_p_HOM_Ramp, 0)) && ramp_result)
1091  {
1092  result = reinterpret_cast<HOM_Ramp *>(ramp_result);
1093  return true;
1094  }
1095 
1096  void *color_result = NULL;
1097  if (SWIG_IsOK(SWIG_ConvertPtr(input, &color_result,
1098  SWIGTYPE_p_HOM_Color, 0)) && color_result)
1099  {
1100  result = reinterpret_cast<HOM_Color *>(color_result);
1101  return true;
1102  }
1103 
1104  void *parm_result = NULL;
1105  if (SWIG_IsOK(SWIG_ConvertPtr(input, &parm_result,
1106  SWIGTYPE_p_HOM_Parm, 0)) && parm_result)
1107  {
1108  result = reinterpret_cast<HOM_Parm *>(parm_result);
1109  return true;
1110  }
1111 
1112  void *enum_result = NULL;
1113  if (SWIG_IsOK(SWIG_ConvertPtr(input, &enum_result,
1114  SWIGTYPE_p_HOM_EnumValue, 0)) && enum_result)
1115  {
1116  result = reinterpret_cast<HOM_EnumValue *>(enum_result);
1117  return true;
1118  }
1119 
1120  void *vec2_result = NULL;
1121  if (SWIG_IsOK(SWIG_ConvertPtr(input, &vec2_result,
1122  SWIGTYPE_p_HOM_Vector2, 0)) && vec2_result)
1123  {
1124  result = reinterpret_cast<HOM_Vector2 *>(vec2_result);
1125  return true;
1126  }
1127 
1128  void *vec3_result = NULL;
1129  if (SWIG_IsOK(SWIG_ConvertPtr(input, &vec3_result,
1130  SWIGTYPE_p_HOM_Vector3, 0)) && vec3_result)
1131  {
1132  result = reinterpret_cast<HOM_Vector3 *>(vec3_result);
1133  return true;
1134  }
1135 
1136  void *vec4_result = NULL;
1137  if (SWIG_IsOK(SWIG_ConvertPtr(input, &vec4_result,
1138  SWIGTYPE_p_HOM_Vector4, 0)) && vec4_result)
1139  {
1140  result = reinterpret_cast<HOM_Vector4 *>(vec4_result);
1141  return true;
1142  }
1143 
1144  void *matrix2_result = NULL;
1145  if (SWIG_IsOK(SWIG_ConvertPtr(input, &matrix2_result,
1146  SWIGTYPE_p_HOM_Matrix2, 0)) && matrix2_result)
1147  {
1148  result = reinterpret_cast<HOM_Matrix2 *>(matrix2_result);
1149  return true;
1150  }
1151 
1152  void *matrix3_result = NULL;
1153  if (SWIG_IsOK(SWIG_ConvertPtr(input, &matrix3_result,
1154  SWIGTYPE_p_HOM_Matrix3, 0)) && matrix3_result)
1155  {
1156  result = reinterpret_cast<HOM_Matrix3 *>(matrix3_result);
1157  return true;
1158  }
1159 
1160  void *matrix4_result = NULL;
1161  if (SWIG_IsOK(SWIG_ConvertPtr(input, &matrix4_result,
1162  SWIGTYPE_p_HOM_Matrix4, 0)) && matrix4_result)
1163  {
1164  result = reinterpret_cast<HOM_Matrix4 *>(matrix4_result);
1165  return true;
1166  }
1167 
1168  std::vector<int> *int_vector_ptr = NULL;
1169  if (SWIG_IsOK(swig::asptr(input, (std::vector<int> **)NULL)) &&
1170  SWIG_IsOK(swig::asptr(input, &int_vector_ptr)))
1171  {
1172  result = *int_vector_ptr;
1173  delete int_vector_ptr;
1174  return true;
1175  }
1176 
1177  std::vector<double> *double_vector_ptr = NULL;
1178  if (SWIG_IsOK(swig::asptr(input, (std::vector<double> **)NULL)) &&
1179  SWIG_IsOK(swig::asptr(input, &double_vector_ptr)))
1180  {
1181  result = *double_vector_ptr;
1182  delete double_vector_ptr;
1183  return true;
1184  }
1185 
1186  std::vector<std::string> *string_vector_ptr = NULL;
1187  if (SWIG_IsOK(swig::asptr(input, (std::vector<std::string> **)NULL)) &&
1188  SWIG_IsOK(swig::asptr(input, &string_vector_ptr)))
1189  {
1190  result = *string_vector_ptr;
1191  delete string_vector_ptr;
1192  return true;
1193  }
1194 
1195  std::vector<HOM_Vector2> *vector2_vector_ptr = NULL;
1196  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Vector2> **)NULL)) &&
1197  SWIG_IsOK(swig::asptr(input, &vector2_vector_ptr)))
1198  {
1199  result = *vector2_vector_ptr;
1200  delete vector2_vector_ptr;
1201  return true;
1202  }
1203 
1204  std::vector<HOM_Vector3> *vector3_vector_ptr = NULL;
1205  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Vector3> **)NULL)) &&
1206  SWIG_IsOK(swig::asptr(input, &vector3_vector_ptr)))
1207  {
1208  result = *vector3_vector_ptr;
1209  delete vector3_vector_ptr;
1210  return true;
1211  }
1212 
1213  std::vector<HOM_Vector4> *vector4_vector_ptr = NULL;
1214  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Vector4> **)NULL)) &&
1215  SWIG_IsOK(swig::asptr(input, &vector4_vector_ptr)))
1216  {
1217  result = *vector4_vector_ptr;
1218  delete vector4_vector_ptr;
1219  return true;
1220  }
1221 
1222  std::vector<HOM_Matrix2> *matrix2_vector_ptr = NULL;
1223  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Matrix2> **)NULL)) &&
1224  SWIG_IsOK(swig::asptr(input, &matrix2_vector_ptr)))
1225  {
1226  result = *matrix2_vector_ptr;
1227  delete matrix2_vector_ptr;
1228  return true;
1229  }
1230 
1231  std::vector<HOM_Matrix3> *matrix3_vector_ptr = NULL;
1232  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Matrix3> **)NULL)) &&
1233  SWIG_IsOK(swig::asptr(input, &matrix3_vector_ptr)))
1234  {
1235  result = *matrix3_vector_ptr;
1236  delete matrix3_vector_ptr;
1237  return true;
1238  }
1239 
1240  std::vector<HOM_Matrix4> *matrix4_vector_ptr = NULL;
1241  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Matrix4> **)NULL)) &&
1242  SWIG_IsOK(swig::asptr(input, &matrix4_vector_ptr)))
1243  {
1244  result = *matrix4_vector_ptr;
1245  delete matrix4_vector_ptr;
1246  return true;
1247  }
1248 
1249  std::map<std::string, hboost::any> *map_ptr = NULL;
1250  if (SWIG_IsOK(swig::asptr(input, (std::map<std::string, hboost::any> **)NULL)) &&
1251  SWIG_IsOK(swig::asptr(input, &map_ptr)))
1252  {
1253  result = *map_ptr;
1254  delete map_ptr;
1255  return true;
1256  }
1257 
1258  std::vector<std::map<std::string, hboost::any> > *map_vector_ptr = NULL;
1259  if (SWIG_IsOK(swig::asptr(input, (std::vector<std::map<std::string, hboost::any> > **)NULL)) &&
1260  SWIG_IsOK(swig::asptr(input, &map_vector_ptr)))
1261  {
1262  result = *map_vector_ptr;
1263  delete map_vector_ptr;
1264  return true;
1265  }
1266 
1267  UT_ASSERT(result.empty());
1268  return false;
1269 }
1270 
1271 // This helper function takes an interpreter (Python) object and converts it
1272 // into a HOM_UTOptionAny (hboost::any) object. It returns whether or not the
1273 // conversion was possible, and leaves the HOM_UTOptionAny unchanged if a
1274 // conversion wasn't possible.
1275 bool
1276 HOMinterpreterObjectToUTOptionAny(InterpreterObject input,
1277  HOM_UTOptionAny &result)
1278 {
1279 #ifdef SWIGPYTHON
1280  if (input == Py_None)
1281  {
1282  result = (void *)NULL;
1283  return true;
1284  }
1285 
1286  // SWIG_AsVal_bool is too permissive, and treats thinks that an integer
1287  // is a bool. So, we explicitly check against True and False.
1288  if (input == Py_True)
1289  {
1290  result = true;
1291  return true;
1292  }
1293 
1294  if (input == Py_False)
1295  {
1296  result = false;
1297  return true;
1298  }
1299 #endif
1300 
1301  int int_result;
1302  if (SWIG_IsOK(SWIG_AsVal_int(input, &int_result)))
1303  {
1304  result = int_result;
1305  return true;
1306  }
1307 
1308  double double_result;
1309  if (SWIG_IsOK(SWIG_AsVal_double(input, &double_result)))
1310  {
1311  result = double_result;
1312  return true;
1313  }
1314 
1315  std::string string_result;
1316  if (SWIG_IsOK(SWIG_AsVal_std_string(input, &string_result)))
1317  {
1318  result = string_result;
1319  return true;
1320  }
1321 
1322  void *vector2_result = NULL;
1323  if (SWIG_IsOK(SWIG_ConvertPtr(input, &vector2_result,
1324  SWIGTYPE_p_HOM_Vector2, 0)) && vector2_result)
1325  {
1326  result = reinterpret_cast<HOM_Vector2 *>(vector2_result);
1327  return true;
1328  }
1329 
1330  void *vector3_result = NULL;
1331  if (SWIG_IsOK(SWIG_ConvertPtr(input, &vector3_result,
1332  SWIGTYPE_p_HOM_Vector3, 0)) && vector3_result)
1333  {
1334  result = reinterpret_cast<HOM_Vector3 *>(vector3_result);
1335  return true;
1336  }
1337 
1338  void *vector4_result = NULL;
1339  if (SWIG_IsOK(SWIG_ConvertPtr(input, &vector4_result,
1340  SWIGTYPE_p_HOM_Vector4, 0)) && vector4_result)
1341  {
1342  result = reinterpret_cast<HOM_Vector4 *>(vector4_result);
1343  return true;
1344  }
1345 
1346  void *quat_result = NULL;
1347  if (SWIG_IsOK(SWIG_ConvertPtr(input, &quat_result,
1348  SWIGTYPE_p_HOM_Quaternion, 0)) && quat_result)
1349  {
1350  result = reinterpret_cast<HOM_Quaternion *>(quat_result);
1351  return true;
1352  }
1353 
1354  void *matrix2_result = NULL;
1355  if (SWIG_IsOK(SWIG_ConvertPtr(input, &matrix2_result,
1356  SWIGTYPE_p_HOM_Matrix2, 0)) && matrix2_result)
1357  {
1358  result = reinterpret_cast<HOM_Matrix2 *>(matrix2_result);
1359  return true;
1360  }
1361 
1362  void *matrix3_result = NULL;
1363  if (SWIG_IsOK(SWIG_ConvertPtr(input, &matrix3_result,
1364  SWIGTYPE_p_HOM_Matrix3, 0)) && matrix3_result)
1365  {
1366  result = reinterpret_cast<HOM_Matrix3 *>(matrix3_result);
1367  return true;
1368  }
1369 
1370  void *matrix4_result = NULL;
1371  if (SWIG_IsOK(SWIG_ConvertPtr(input, &matrix4_result,
1372  SWIGTYPE_p_HOM_Matrix4, 0)) && matrix4_result)
1373  {
1374  result = reinterpret_cast<HOM_Matrix4 *>(matrix4_result);
1375  return true;
1376  }
1377 
1378  void *geometry_result = NULL;
1379  if (SWIG_IsOK(SWIG_ConvertPtr(input, &geometry_result,
1380  SWIGTYPE_p_HOM_Geometry, 0)) && geometry_result)
1381  {
1382  result = reinterpret_cast<HOM_Geometry *>(geometry_result);
1383  return true;
1384  }
1385 
1386  void *ramp_result = NULL;
1387  if (SWIG_IsOK(SWIG_ConvertPtr(input, &ramp_result,
1388  SWIGTYPE_p_HOM_Ramp, 0)) && ramp_result)
1389  {
1390  result = reinterpret_cast<HOM_Ramp *>(ramp_result);
1391  return true;
1392  }
1393 
1394  std::vector<int> *int_vector_ptr = NULL;
1395  if (SWIG_IsOK(swig::asptr(input, (std::vector<int> **)NULL)) &&
1396  SWIG_IsOK(swig::asptr(input, &int_vector_ptr)))
1397  {
1398  result = *int_vector_ptr;
1399  delete int_vector_ptr;
1400  return true;
1401  }
1402 
1403  std::vector<double> *double_vector_ptr = NULL;
1404  if (SWIG_IsOK(swig::asptr(input, (std::vector<double> **)NULL)) &&
1405  SWIG_IsOK(swig::asptr(input, &double_vector_ptr)))
1406  {
1407  result = *double_vector_ptr;
1408  delete double_vector_ptr;
1409  return true;
1410  }
1411 
1412  std::vector<std::string> *string_vector_ptr = NULL;
1413  if (SWIG_IsOK(swig::asptr(input, (std::vector<std::string> **)NULL)) &&
1414  SWIG_IsOK(swig::asptr(input, &string_vector_ptr)))
1415  {
1416  result = *string_vector_ptr;
1417  delete string_vector_ptr;
1418  return true;
1419  }
1420 
1421  std::vector<HOM_Vector2> *vector2_vector_ptr = NULL;
1422  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Vector2> **)NULL)) &&
1423  SWIG_IsOK(swig::asptr(input, &vector2_vector_ptr)))
1424  {
1425  result = *vector2_vector_ptr;
1426  delete vector2_vector_ptr;
1427  return true;
1428  }
1429 
1430  std::vector<HOM_Vector3> *vector3_vector_ptr = NULL;
1431  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Vector3> **)NULL)) &&
1432  SWIG_IsOK(swig::asptr(input, &vector3_vector_ptr)))
1433  {
1434  result = *vector3_vector_ptr;
1435  delete vector3_vector_ptr;
1436  return true;
1437  }
1438 
1439  std::vector<HOM_Vector4> *vector4_vector_ptr = NULL;
1440  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Vector4> **)NULL)) &&
1441  SWIG_IsOK(swig::asptr(input, &vector4_vector_ptr)))
1442  {
1443  result = *vector4_vector_ptr;
1444  delete vector4_vector_ptr;
1445  return true;
1446  }
1447 
1448  std::vector<HOM_Matrix2> *matrix2_vector_ptr = NULL;
1449  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Matrix2> **)NULL)) &&
1450  SWIG_IsOK(swig::asptr(input, &matrix2_vector_ptr)))
1451  {
1452  result = *matrix2_vector_ptr;
1453  delete matrix2_vector_ptr;
1454  return true;
1455  }
1456 
1457  std::vector<HOM_Matrix3> *matrix3_vector_ptr = NULL;
1458  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Matrix3> **)NULL)) &&
1459  SWIG_IsOK(swig::asptr(input, &matrix3_vector_ptr)))
1460  {
1461  result = *matrix3_vector_ptr;
1462  delete matrix3_vector_ptr;
1463  return true;
1464  }
1465 
1466  std::vector<HOM_Matrix4> *matrix4_vector_ptr = NULL;
1467  if (SWIG_IsOK(swig::asptr(input, (std::vector<HOM_Matrix4> **)NULL)) &&
1468  SWIG_IsOK(swig::asptr(input, &matrix4_vector_ptr)))
1469  {
1470  result = *matrix4_vector_ptr;
1471  delete matrix4_vector_ptr;
1472  return true;
1473  }
1474 
1475  UT_ASSERT(result.empty());
1476  return false;
1477 }
1478 
1479 // Creating an input typemap isn't sufficient to handle input parameters with
1480 // std::vector's or std::map's of hboost::any's, so we need to specialize
1481 // swig::traits_asptr<hboost::any>.
1482 namespace swig {
1483  template <>
1484  struct traits_asptr<hboost::any>
1485  {
1486  static int asptr(InterpreterObject obj, hboost::any **val)
1487  {
1488  // TODO: Will the hboost::any be properly deleted?
1489  hboost::any *p = new hboost::any();
1490  HOMinterpreterObjectToBoostAny(obj, *p);
1491  if (val)
1492  *val = p;
1493  return SWIG_NEWOBJ;
1494  }
1495  };
1496 }
1497 
1498 // This function is not instantiated until the first use of HOM_BinaryString,
1499 // but we need to use it in HOMboostAnyToInterpreterObject. So just forward
1500 // declare it here.
1501 static PyObject * SWIG_From_HOM_BinaryString(const HOM_BinaryString& s);
1502 
1503 // This helper function takes a variable wrapped inside a hboost::any object
1504 // and creates a new instance of the corresponding InterpreterObject.
1505 static InterpreterObject
1506 HOMboostAnyToInterpreterObject(const hboost::any &result)
1507 {
1508  if (result.empty())
1509  return SWIG_Py_Void();
1510 
1511  if (result.type() == typeid(int))
1512  return SWIG_From_int(hboost::any_cast<int>(result));
1513 
1514  if (result.type() == typeid(long))
1515  return SWIG_From_long(hboost::any_cast<long>(result));
1516 
1517  if (result.type() == typeid(int64))
1518  return swig::from(hboost::any_cast<int64>(result));
1519 
1520  if (result.type() == typeid(float))
1521  return SWIG_From_float(hboost::any_cast<float>(result));
1522 
1523  if (result.type() == typeid(double))
1524  return SWIG_From_double(hboost::any_cast<double>(result));
1525 
1526  if (result.type() == typeid(bool))
1527  return SWIG_From_bool(hboost::any_cast<bool>(result));
1528 
1529  if (result.type() == typeid(std::string))
1530  return SWIG_From_std_string(hboost::any_cast<std::string>(result));
1531 
1532  if (result.type() == typeid(HOM_BinaryString))
1533  return SWIG_From_HOM_BinaryString(hboost::any_cast<HOM_BinaryString>(result));
1534 
1535  if (result.type() == typeid(std::map<std::string, hboost::any>))
1536  return swig::from(
1537  hboost::any_cast<std::map<std::string, hboost::any> >(result));
1538 
1539  if (result.type() == typeid(std::vector<int>))
1540  return swig::from(hboost::any_cast<std::vector<int> >(result));
1541 
1542  if (result.type() == typeid(std::vector<int64>))
1543  return swig::from(hboost::any_cast<std::vector<int64> >(result));
1544 
1545  if (result.type() == typeid(std::vector<float>))
1546  return swig::from(hboost::any_cast<std::vector<float> >(result));
1547 
1548  if (result.type() == typeid(std::vector<std::string>))
1549  return swig::from(hboost::any_cast<std::vector<std::string> >(result));
1550 
1551  if (result.type() == typeid(std::vector<double>))
1552  return swig::from(hboost::any_cast<std::vector<double> >(result));
1553 
1554  if (result.type() == typeid(std::vector<std::vector<float> >))
1555  return swig::from(
1556  hboost::any_cast<std::vector<std::vector<float> > >(result));
1557 
1558  if (result.type() == typeid(std::vector<std::vector<double> >))
1559  return swig::from(
1560  hboost::any_cast<std::vector<std::vector<double> > >(result));
1561 
1562  if (result.type() == typeid(std::vector<std::map<std::string, hboost::any> >))
1563  return swig::from(
1564  hboost::any_cast<std::vector<std::map<std::string, hboost::any> > >(result));
1565 
1566  // If a HOM function returns a pointer to a HOM_Vector*/HOM_Matrix*, it
1567  // will transfer the ownership of that object to swig.
1568  if (result.type() == typeid(HOM_Vector2 *))
1569  return HOMconvertValueForInterpreter(
1570  hboost::any_cast<HOM_Vector2 *>(result), SWIG_POINTER_OWN);
1571 
1572  if (result.type() == typeid(HOM_Vector3 *))
1573  return HOMconvertValueForInterpreter(
1574  hboost::any_cast<HOM_Vector3 *>(result), SWIG_POINTER_OWN);
1575 
1576  if (result.type() == typeid(HOM_Vector4 *))
1577  return HOMconvertValueForInterpreter(
1578  hboost::any_cast<HOM_Vector4 *>(result), SWIG_POINTER_OWN);
1579 
1580  if (result.type() == typeid(HOM_Matrix2 *))
1581  return HOMconvertValueForInterpreter(
1582  hboost::any_cast<HOM_Matrix2 *>(result), SWIG_POINTER_OWN);
1583 
1584  if (result.type() == typeid(HOM_Matrix3 *))
1585  return HOMconvertValueForInterpreter(
1586  hboost::any_cast<HOM_Matrix3 *>(result), SWIG_POINTER_OWN);
1587 
1588  if (result.type() == typeid(HOM_Matrix4 *))
1589  return HOMconvertValueForInterpreter(
1590  hboost::any_cast<HOM_Matrix4 *>(result), SWIG_POINTER_OWN);
1591 
1592  if (result.type() == typeid(HOM_NodeType *))
1593  return HOMconvertValueForInterpreter(
1594  hboost::any_cast<HOM_NodeType *>(result), SWIG_POINTER_OWN);
1595 
1596  if (result.type() == typeid(HOM_Ramp *))
1597  return HOMconvertValueForInterpreter(
1598  hboost::any_cast<HOM_Ramp *>(result), SWIG_POINTER_OWN);
1599 
1600  if (result.type() == typeid(HOM_Color *))
1601  return HOMconvertValueForInterpreter(
1602  hboost::any_cast<HOM_Color *>(result), SWIG_POINTER_OWN);
1603 
1604  if (result.type() == typeid(HOM_Parm *))
1605  return HOMconvertValueForInterpreter(
1606  hboost::any_cast<HOM_Parm *>(result), SWIG_POINTER_OWN);
1607 
1608  if (result.type() == typeid(HOM_EnumValue *))
1609  return HOMconvertValueForInterpreter(
1610  hboost::any_cast<HOM_EnumValue *>(result), /*own*/0);
1611 
1612  if (result.type() == typeid(HOM_Geometry *))
1613  return HOMconvertValueForInterpreter(
1614  hboost::any_cast<HOM_Geometry *>(result), SWIG_POINTER_OWN);
1615 
1616  if (result.type() == typeid(std::vector<HOM_ElemPtr<HOM_Vector2> >))
1617  return swig::from(
1618  hboost::any_cast<std::vector<HOM_ElemPtr<HOM_Vector2> > >(result));
1619 
1620  if (result.type() == typeid(std::vector<HOM_ElemPtr<HOM_Vector3> >))
1621  return swig::from(
1622  hboost::any_cast<std::vector<HOM_ElemPtr<HOM_Vector3> > >(result));
1623 
1624  if (result.type() == typeid(std::vector<HOM_ElemPtr<HOM_Vector4> >))
1625  return swig::from(
1626  hboost::any_cast<std::vector<HOM_ElemPtr<HOM_Vector4> > >(result));
1627 
1628  if (result.type() == typeid(std::vector<HOM_ElemPtr<HOM_Matrix2> >))
1629  return swig::from(
1630  hboost::any_cast<std::vector<HOM_ElemPtr<HOM_Matrix2> > >(result));
1631 
1632  if (result.type() == typeid(std::vector<HOM_ElemPtr<HOM_Matrix3> >))
1633  return swig::from(
1634  hboost::any_cast<std::vector<HOM_ElemPtr<HOM_Matrix3> > >(result));
1635 
1636  if (result.type() == typeid(std::vector<HOM_ElemPtr<HOM_Matrix4> >))
1637  return swig::from(
1638  hboost::any_cast<std::vector<HOM_ElemPtr<HOM_Matrix4> > >(result));
1639 
1640 #if UT_ASSERT_LEVEL > 0
1641  std::cout << "Unknown data type: "
1642  << UTunmangleClassNameFromTypeIdName(result.type().name()) << "\n";
1643 #endif
1644  UT_ASSERT(!"Unknown data type");
1645  return SWIG_Py_Void();
1646 }
1647 
1648 // This helper function takes a variable wrapped inside a hboost::any object
1649 // and creates a new instance of the corresponding InterpreterObject.
1650 static InterpreterObject
1651 HOMDDSourceAnyToInterpreterObject(const HOM_DDSourceAny &result)
1652 {
1653  if (result.type() == typeid(HOM_Node *))
1654  {
1655  return HOMconvertValueForInterpreter(
1656  hboost::any_cast<HOM_Node *>(result), SWIG_POINTER_OWN);
1657  }
1658  if (result.type() == typeid(HOM_Parm *))
1659  {
1660  return HOMconvertValueForInterpreter(
1661  hboost::any_cast<HOM_Parm *>(result), SWIG_POINTER_OWN);
1662  }
1663  if (result.type() == typeid(HOM_GalleryEntry *))
1664  {
1665  return HOMconvertValueForInterpreter(
1666  hboost::any_cast<HOM_GalleryEntry *>(result), SWIG_POINTER_OWN);
1667  }
1668 
1669  return HOMboostAnyToInterpreterObject(result);
1670 }
1671 
1672 namespace swig {
1673  // Adding the typemap does not customize swig::from() so we do that
1674  // manually.
1675  template <>
1676  struct traits_from<hboost::any>
1677  {
1678  static PyObject *from(const hboost::any &val)
1679  { return HOMboostAnyToInterpreterObject(val); }
1680  };
1681 }
1682 
1683 static InterpreterObject
1684 HOMoptionsToInterpreterObject(const UT_Options &options);
1685 
1686 static InterpreterObject
1687 HOMoptionEntryToInterpreterObject(const UT_OptionEntry &option_entry)
1688 {
1689  // We're usually called from code that has the GIL released so make sure we
1690  // acquire it here.
1691  PY_InterpreterAutoLock py_lock;
1692 
1693  InterpreterObject result = NULL;
1694 
1695  switch (option_entry.getType())
1696  {
1697  case UT_OPTION_INT:
1698  return SWIG_From_int(
1699  ((const UT_OptionInt &)option_entry).getValue());
1700 
1701  case UT_OPTION_BOOL:
1702  return SWIG_From_bool(
1703  ((const UT_OptionBool &)option_entry).getValue());
1704 
1705  case UT_OPTION_FPREAL:
1706  return SWIG_From_double(
1707  ((const UT_OptionFpreal &)option_entry).getValue());
1708 
1709  case UT_OPTION_STRING:
1710  case UT_OPTION_STRINGRAW:
1711  {
1712  return SWIG_From_std_string(
1713  ((const UT_OptionString &)option_entry).getValue().toStdString());
1714  }
1715 
1716  case UT_OPTION_VECTOR2:
1717  return HOMconvertValueForInterpreter(
1718  new HOM_Vector2(
1719  ((const UT_OptionVector2 &)option_entry).getValue()),
1720  SWIG_POINTER_OWN);
1721 
1722  case UT_OPTION_VECTOR3:
1723  return HOMconvertValueForInterpreter(
1724  new HOM_Vector3(
1725  ((const UT_OptionVector3 &)option_entry).getValue()),
1726  SWIG_POINTER_OWN);
1727 
1728  case UT_OPTION_VECTOR4:
1729  return HOMconvertValueForInterpreter(
1730  new HOM_Vector4(
1731  ((const UT_OptionVector4 &)option_entry).getValue()),
1732  SWIG_POINTER_OWN);
1733 
1734  case UT_OPTION_QUATERNION:
1735  return HOMconvertValueForInterpreter(
1736  new HOM_Quaternion(
1737  ((const UT_OptionQuaternion &)option_entry).getValue()),
1738  SWIG_POINTER_OWN);
1739 
1740  case UT_OPTION_MATRIX2:
1741  return HOMconvertValueForInterpreter(
1743  ((const UT_OptionMatrix2 &)option_entry).getValue())),
1744  SWIG_POINTER_OWN);
1745 
1746  case UT_OPTION_MATRIX3:
1747  return HOMconvertValueForInterpreter(
1749  ((const UT_OptionMatrix3 &)option_entry).getValue())),
1750  SWIG_POINTER_OWN);
1751 
1752  case UT_OPTION_MATRIX4:
1753  return HOMconvertValueForInterpreter(
1755  ((const UT_OptionMatrix4 &)option_entry).getValue())),
1756  SWIG_POINTER_OWN);
1757 
1758  case UT_OPTION_UV:
1759  return HOMconvertValueForInterpreter(
1760  new HOM_Vector2(
1761  ((const UT_OptionUV &)option_entry).getValue()),
1762  SWIG_POINTER_OWN);
1763 
1764  case UT_OPTION_UVW:
1765  return HOMconvertValueForInterpreter(
1766  new HOM_Vector3(
1767  ((const UT_OptionUVW &)option_entry).getValue()),
1768  SWIG_POINTER_OWN);
1769 
1770  case UT_OPTION_INTARRAY:
1771  {
1772  std::vector<int64> int_vector;
1773  UTarrayToStdVector(
1774  static_cast<const UT_OptionInt64Array &>(option_entry)
1775  .getValue(), int_vector);
1776  return swig::from(int_vector);
1777  }
1778 
1779  case UT_OPTION_FPREALARRAY:
1780  {
1781  std::vector<double> double_vector;
1782  UTarrayToStdVector(
1783  static_cast<const UT_OptionFpreal64Array &>(option_entry)
1784  .getValue(), double_vector);
1785  return swig::from(double_vector);
1786  }
1787 
1788  case UT_OPTION_STRINGARRAY:
1789  {
1790  std::vector<std::string> str_vector;
1791  UTarrayToStdVectorOfStrings(
1792  static_cast<const UT_OptionStringArray &>(option_entry)
1793  .getValue(), str_vector);
1794  return swig::from(str_vector);
1795  }
1796 
1797  case UT_OPTION_DICT:
1798  {
1799  UT_OptionsHolder opt;
1800  opt = static_cast<const UT_OptionDict &>(option_entry).getValue();
1801  return HOMoptionsToInterpreterObject(*opt.options());
1802  }
1803  case UT_OPTION_DICTARRAY:
1804  {
1806  optlist = static_cast<const UT_OptionDictArray &>(option_entry).getValue();
1807  InterpreterObject result = PyList_New(0);
1808 
1809  for (auto && opt : optlist)
1810  {
1811  PyList_Append(result, HOMoptionsToInterpreterObject(*opt.options()));
1812  }
1813 
1814  return result;
1815  }
1816  case UT_OPTION_INVALID:
1817  case UT_OPTION_NUM_TYPES:
1818  // Just exit the switch with no result.
1819  break;
1820  }
1821 
1822  return result ? result : SWIG_Py_Void();
1823 }
1824 
1825 #ifdef SWIGPYTHON
1826 static InterpreterObject
1827 HOMoptionsToInterpreterObject(const UT_Options &options)
1828 {
1829  // We're usually called from code that has the GIL released so make sure we
1830  // acquire it here.
1831  PY_InterpreterAutoLock py_lock;
1832 
1833  InterpreterObject result = PyDict_New();
1834 
1835  for (UT_Options::iterator it = options.begin(); !it.atEnd(); ++it)
1836  {
1837  // The Python dictionary object will increment the reference count
1838  // on the value, so we decrement it since we just allocated it.
1839  InterpreterObject value=HOMoptionEntryToInterpreterObject(*it.entry());
1840  PyDict_SetItemString(result, it.name(), value);
1841  Py_DECREF(value);
1842  }
1843 
1844  return result;
1845 }
1846 
1847 static InterpreterObject
1848 HOMoptionsListToInterpreterObject(const std::vector<UT_Options>& options)
1849 {
1850  auto pysize = options.size();
1851 
1852  // We're usually called from code that has the GIL released so make sure we
1853  // acquire it here.
1854  PY_InterpreterAutoLock py_lock;
1855 
1856  InterpreterObject list = PyList_New(pysize);
1857  for (int i = 0; i < pysize; ++i)
1858  {
1859  auto value = HOMoptionsToInterpreterObject(options[i]);
1860  // PyList_SET_ITEM will steal the reference
1861  PyList_SET_ITEM(list, i, value);
1862  }
1863  return list;
1864 }
1865 
1866 #endif
1867 
1868 #ifdef SWIGPYTHON
1869 
1870 // Helper for accessing a HOM object python attributes.
1871 // Used by HDAModule, HDAViewerStateModule and HOMF_HDAViewerHandleModule.
1872 template<typename T>
1873 PyObject* HOMgetattr(T* hom_object, const char *name)
1874 {
1875  HOM_AutoLock hom_lock;
1876  PY_InterpreterAutoLock py_lock;
1877 
1878  // First check the context's locals dictionary. If the context
1879  // pointer is null we treat it as though the dictionary is empty.
1880  PY_EvaluationContext *context = hom_object->getEvaluationContext();
1881  PyObject *dict = context
1882  ? (PyObject *)context->getGlobalsDict() : NULL;
1883  PyObject *attribute = (dict && name)
1884  ? PyDict_GetItemString(dict, name) : NULL;
1885 
1886  // If the lookup failed, try the globals dictionary.
1887  if (!attribute && dict)
1888  {
1889  dict = (PyObject *)context->getGlobalsDict();
1890  attribute = name ? PyDict_GetItemString(dict, name) : NULL;
1891  }
1892 
1893  // If we found an object in the dictionary, return it, being careful
1894  // to increment the reference count on the object.
1895  if (attribute)
1896  return HOMincRef(attribute);
1897 
1898  // We didn't find the object, so raise an exception.
1899  if (!name)
1900  name = "";
1901  UT_WorkBuffer error_message;
1902  error_message.sprintf("'module' object has no attribute '%s'", name);
1903  PyErr_SetString(PyExc_AttributeError, error_message.buffer());
1904  return NULL;
1905 }
1906 #endif
1907 
1908 //----------------------------------------------------------------------------
1909 
1910 #ifdef SWIGPYTHON
1911 // This helper class takes a Python buffer object and provides access to
1912 // the underlying C buffer. Note that the class is only used inside the
1913 // swig file, so it doesn't need to be exported from the current library.
1914 class HOM_PyBuffer
1915 {
1916 public:
1917  HOM_PyBuffer(InterpreterObject py_object)
1918  {
1919 #if PY_VERSION_HEX >= 0x03000000
1920  myBytesObj = nullptr;
1921 #endif
1922  myData = NULL;
1923  myLength = 0;
1924 
1925  PyObject *obj = py_object;
1926 
1927 #if PY_VERSION_HEX >= 0x03000000
1928  // Automatically convert HOM binary strings to buffer-like objects.
1929  if (PyUnicode_Check(obj))
1930  {
1931  myBytesObj =
1932  PyUnicode_AsEncodedString(obj, "utf-8", "surrogateescape");
1933  obj = myBytesObj;
1934  }
1935 #endif
1936 
1937  // Python added a new buffer interface starting with Python 2.6.
1938 #if PY_VERSION_HEX >= 0x02060000
1939  myUseNewAPI = false;
1940  if (PyObject_CheckBuffer(obj))
1941  {
1942  if (PyObject_GetBuffer(obj, &myPyBuffer, PyBUF_SIMPLE) < 0)
1943  {
1944 #if PY_VERSION_HEX >= 0x03000000
1945  cleanBytesObject_();
1946 #endif
1947  throw HOM_TypeError("failed to get readable buffer");
1948  }
1949 
1950  myUseNewAPI = true;
1951  myData = myPyBuffer.buf;
1952  myLength = myPyBuffer.len;
1953  return;
1954  }
1955 #endif
1956 
1957 #if PY_VERSION_HEX >= 0x03000000
1958  cleanBytesObject_();
1959  throw HOM_TypeError("failed to get readable buffer");
1960 #else
1961  // Either the new API isn't supported in this Python version or the
1962  // Python object doesn't support it. Try the old API.
1963  if (!PyObject_CheckReadBuffer(obj))
1964  throw HOM_TypeError("expected a readable buffer");
1965 
1966  if (PyObject_AsReadBuffer(obj, &myData, &myLength) < 0)
1967  throw HOM_TypeError("failed to get readable buffer");
1968 #endif
1969  }
1970 
1971  ~HOM_PyBuffer()
1972  {
1973 #if PY_VERSION_HEX >= 0x03000000
1974  cleanBytesObject_();
1975 #endif
1976 
1977 #if PY_VERSION_HEX >= 0x02060000
1978  if (myUseNewAPI)
1979  PyBuffer_Release(&myPyBuffer);
1980 #endif
1981  }
1982 
1983 #if PY_VERSION_HEX >= 0x03000000
1984  void cleanBytesObject_()
1985  {
1986  if (!myBytesObj)
1987  return;
1988 
1989  Py_DECREF(myBytesObj);
1990  myBytesObj = nullptr;
1991  }
1992 #endif
1993 
1994 #if PY_VERSION_HEX >= 0x03000000
1995  PyObject *myBytesObj;
1996 #endif
1997 
1998 #if PY_VERSION_HEX >= 0x02060000
1999  bool myUseNewAPI;
2000  Py_buffer myPyBuffer;
2001 #endif
2002  const void *myData;
2003  Py_ssize_t myLength;
2004 };
2005 #endif
2006 
2007 //----------------------------------------------------------------------------
2008 
2009 // These helper functions are used to implement the attrib() methods of
2010 // Points, Prims, and Vertices. We need to do extra work for these methods
2011 // because the return type can vary.
2012 template <typename T>
2013 InterpreterObject
2014 HOMattribValue(T &geo_element, HOM_Attrib &hom_attrib)
2015 {
2016  InterpreterObject result = NULL;
2017  const bool scalar = (hom_attrib.size() == 1 && !hom_attrib.isArrayType());
2018  switch (hom_attrib.dataType().id())
2019  {
2020  case HOM_attribData::Int_Id:
2021  if (scalar)
2022  result = swig::from(
2023  hboost::any_cast<int64>(geo_element.intAttribValue(hom_attrib)));
2024  else
2025  result = swig::from(
2026  hboost::any_cast<std::vector<int64> >(
2027  geo_element.intListAttribValue(hom_attrib)));
2028  break;
2029 
2030  case HOM_attribData::Float_Id:
2031  if (scalar)
2032  result = SWIG_From_double(geo_element.floatAttribValue(hom_attrib));
2033  else
2034  result = swig::from(geo_element.floatListAttribValue(hom_attrib));
2035  break;
2036 
2037  case HOM_attribData::String_Id:
2038  if (scalar)
2039  result = SWIG_From_std_string(
2040  geo_element.stringAttribValue(hom_attrib));
2041  else
2042  result = swig::from(geo_element.stringListAttribValue(hom_attrib));
2043  break;
2044 
2045  case HOM_attribData::Dict_Id:
2046  if (scalar)
2047  result = swig::from(geo_element.dictAttribValue(hom_attrib));
2048  else
2049  result = swig::from(geo_element.dictListAttribValue(hom_attrib));
2050  break;
2051  }
2052  UT_ASSERT(result);
2053  return result;
2054 }
2055 
2056 
2057 // Note that the caller is responsible for deleting the HOM_Attrib object
2058 // that's returned.
2059 template <typename T> HOM_Attrib*
2060 HOMlookUpAttrib(T &geo_element, const char *name);
2061 
2062 template <> HOM_Attrib*
2063 HOMlookUpAttrib(HOM_Point &point, const char *name)
2064 { return HOMdel(point.geometry())->findPointAttrib(name); }
2065 
2066 template <> HOM_Attrib*
2067 HOMlookUpAttrib(HOM_Prim &prim, const char *name)
2068 { return HOMdel(prim.geometry())->findPrimAttrib(name); }
2069 
2070 template <> HOM_Attrib*
2071 HOMlookUpAttrib(HOM_Vertex &vertex, const char *name)
2072 { return HOMdel(vertex.geometry())->findVertexAttrib(name); }
2073 
2074 template <> HOM_Attrib*
2075 HOMlookUpAttrib(HOM_Geometry &geometry, const char *name)
2076 { return geometry.findGlobalAttrib(name); }
2077 
2078 template <typename T>
2079 InterpreterObject
2080 HOMattribValue(T &geo_element, const char *name)
2081 {
2082  HOMthrowIfNone(name, "name cannot be None");
2083  HOM_Attrib *hom_attrib = HOMlookUpAttrib(geo_element, name);
2084  if (!hom_attrib)
2085  throw HOM_OperationFailed();
2086 
2087  InterpreterObject result = HOMattribValue(geo_element, *hom_attrib);
2088  delete hom_attrib;
2089  return result;
2090 }
2091 %}
2092 
2093 //----------------------------------------------------------------------------
2094 
2095 %{
2096 // These helper functions are used to implement parm evaluation.
2097 static InterpreterObject
2098 HOMevalParm(HOM_Parm &parm)
2099 {
2100  switch (parm.parmDataTypeEnumId())
2101  {
2102  case HOM_parmData::Int_Id:
2103  return SWIG_From_int(parm.evalAsInt());
2104  case HOM_parmData::Float_Id:
2105  return SWIG_From_double(parm.evalAsFloat());
2106  case HOM_parmData::String_Id:
2107  return SWIG_From_std_string(parm.evalAsString());
2108  case HOM_parmData::Ramp_Id:
2109  return SWIG_NewPointerObj(
2110  (void*)parm.evalAsRamp(), SWIGTYPE_p_HOM_Ramp, SWIG_POINTER_OWN);
2111  case HOM_parmData::Data_Id:
2112  if (parm.dataParmTypeEnumId() == HOM_dataParmType::KeyValueDictionary_Id)
2113  return swig::from(parm.evalAsJSONMap());
2114 
2115  return SWIG_NewPointerObj(
2116  (void*)parm.evalAsGeometry(), SWIGTYPE_p_HOM_Geometry, SWIG_POINTER_OWN);
2117  }
2118 
2119  UT_ASSERT(!"Unknown parm data type");
2120  return SWIG_Py_Void();
2121 }
2122 
2123 static InterpreterObject
2124 HOMevalParmAtFrame(HOM_Parm &parm, double frame)
2125 {
2126  switch (parm.parmDataTypeEnumId())
2127  {
2128  case HOM_parmData::Int_Id:
2129  return SWIG_From_int(parm.evalAsIntAtFrame(frame));
2130  case HOM_parmData::Float_Id:
2131  return SWIG_From_double(parm.evalAsFloatAtFrame(frame));
2132  case HOM_parmData::String_Id:
2133  return SWIG_From_std_string(parm.evalAsStringAtFrame(frame));
2134  case HOM_parmData::Ramp_Id:
2135  return SWIG_NewPointerObj(
2136  (void*)parm.evalAsRampAtFrame(frame),
2137  SWIGTYPE_p_HOM_Ramp, SWIG_POINTER_OWN);
2138  case HOM_parmData::Data_Id:
2139  if (parm.dataParmTypeEnumId() == HOM_dataParmType::KeyValueDictionary_Id)
2140  return swig::from(parm.evalAsJSONMapAtFrame(frame));
2141 
2142  return SWIG_NewPointerObj(
2143  (void*)parm.evalAsGeometryAtFrame(frame),
2144  SWIGTYPE_p_HOM_Geometry, SWIG_POINTER_OWN);
2145  }
2146 
2147  UT_ASSERT(!"Unknown parm data type");
2148  return SWIG_Py_Void();
2149 }
2150 
2151 static InterpreterObject
2152 HOMevalParmTuple(HOM_ParmTuple &parm_tuple)
2153 {
2154  switch (parm_tuple.parmDataTypeEnumId())
2155  {
2156  case HOM_parmData::Int_Id:
2157  return swig::from(parm_tuple.evalAsInts());
2158  case HOM_parmData::Float_Id:
2159  return swig::from(parm_tuple.evalAsFloats());
2160  case HOM_parmData::String_Id:
2161  return swig::from(parm_tuple.evalAsStrings());
2162  case HOM_parmData::Ramp_Id:
2163  return swig::from(parm_tuple.evalAsRamps());
2164  case HOM_parmData::Data_Id:
2165  if (parm_tuple.dataParmTypeEnumId()
2166  == HOM_dataParmType::KeyValueDictionary_Id)
2167  {
2168  return swig::from(parm_tuple.evalAsJSONMaps());
2169  }
2170 
2171  return swig::from(parm_tuple.evalAsGeometries());
2172  }
2173 
2174  UT_ASSERT(!"Unknown parm data type");
2175  return SWIG_Py_Void();
2176 }
2177 
2178 static InterpreterObject
2179 HOMevalParmTupleAtFrame(HOM_ParmTuple &parm_tuple, double frame)
2180 {
2181  switch (parm_tuple.parmDataTypeEnumId())
2182  {
2183  case HOM_parmData::Int_Id:
2184  return swig::from(parm_tuple.evalAsIntsAtFrame(frame));
2185  case HOM_parmData::Float_Id:
2186  return swig::from(parm_tuple.evalAsFloatsAtFrame(frame));
2187  case HOM_parmData::String_Id:
2188  return swig::from(parm_tuple.evalAsStringsAtFrame(frame));
2189  case HOM_parmData::Ramp_Id:
2190  return swig::from(parm_tuple.evalAsRampsAtFrame(frame));
2191  case HOM_parmData::Data_Id:
2192  if (parm_tuple.dataParmTypeEnumId()
2193  == HOM_dataParmType::KeyValueDictionary_Id)
2194  {
2195  return swig::from(parm_tuple.evalAsJSONMapsAtFrame(frame));
2196  }
2197 
2198  return swig::from(parm_tuple.evalAsGeometriesAtFrame(frame));
2199  }
2200 
2201  UT_ASSERT(!"Unknown parm data type");
2202  return SWIG_Py_Void();
2203 }
2204 
2205 static InterpreterObject
2206 HOMevalViewportVisualizerParm(HOM_ViewportVisualizer &visualizer, const char *parm_name)
2207 {
2208  switch (visualizer.parmDataTypeEnumId(parm_name))
2209  {
2210  case HOM_parmData::Int_Id:
2211  return SWIG_From_int(visualizer.evalParmAsInt(parm_name));
2212  case HOM_parmData::Float_Id:
2213  return SWIG_From_double(visualizer.evalParmAsFloat(parm_name));
2214  case HOM_parmData::String_Id:
2215  return SWIG_From_std_string(visualizer.evalParmAsString(parm_name));
2216  case HOM_parmData::Ramp_Id:
2217  return SWIG_NewPointerObj(
2218  (void*)visualizer.evalParmAsRamp(parm_name), SWIGTYPE_p_HOM_Ramp,
2219  SWIG_POINTER_OWN);
2220  }
2221 
2222  UT_ASSERT(!"Unknown parm data type");
2223  return SWIG_Py_Void();
2224 }
2225 
2226 
2227 //----------------------------------------------------------------------------
2228 
2229 %}
2230 #endif
2231 
2232 #endif
UT_Matrix4T< double > UT_DMatrix4
virtual std::vector< HOM_ElemPtr< HOM_Geometry > > evalAsGeometries()=0
UT_Matrix3T< double > UT_DMatrix3
virtual std::vector< int > evalAsIntsAtFrame(double frame)=0
virtual int size()=0
virtual std::string evalParmAsString(const char *parm_name)=0
virtual HOM_Prim * prim(int index)=0
virtual bool isArrayType()=0
void
Definition: png.h:1083
virtual std::vector< HOM_ElemPtr< HOM_Ramp > > evalAsRampsAtFrame(double frame)=0
virtual HOM_Attrib * findGlobalAttrib(const char *name)=0
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
virtual int parmDataTypeEnumId()=0
virtual double evalAsFloat()=0
GLenum GLenum GLenum input
Definition: glew.h:14162
virtual std::vector< int > evalAsInts()=0
SYS_FORCE_INLINE const char * buffer() const
UT_UniquePtr< T > HOMdel(T *hom_object)
Definition: HOM_Module.h:1112
GLuint object
Definition: glew.h:9028
GLuint const GLchar * name
Definition: glcorearb.h:785
bool atEnd() const
Definition: UT_Options.h:294
GLuint in
Definition: glew.h:11552
virtual HOM_Ramp * evalParmAsRamp(const char *parm_name)=0
virtual HOM_Ramp * evalAsRampAtFrame(double frame)=0
virtual std::vector< std::string > evalAsStrings()=0
UT_API std::string UTunmangleClassNameFromTypeIdName(const std::string &name)
virtual HOM_Geometry * geometry()=0
GLuint64EXT * result
Definition: glew.h:14311
virtual double evalAsFloatAtFrame(double frame)=0
virtual std::vector< std::map< std::string, std::string > > evalAsJSONMaps()=0
virtual int evalAsIntAtFrame(double frame)=0
virtual int dataParmTypeEnumId()=0
bool any(const vbool4 &v)
Definition: simd.h:3446
virtual std::map< std::string, std::string > evalAsJSONMapAtFrame(double frame)=0
virtual HOM_Geometry * geometry()=0
virtual HOM_Geometry * evalAsGeometryAtFrame(double frame)=0
virtual UT_OptionType getType() const
UT_Matrix2T< double > UT_DMatrix2
virtual std::vector< std::map< std::string, std::string > > evalAsJSONMapsAtFrame(double frame)=0
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLhandleARB obj
Definition: glew.h:6266
virtual std::map< std::string, std::string > evalAsJSONMap()=0
long long int64
Definition: SYS_Types.h:116
GLfloat GLfloat p
Definition: glew.h:16656
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
GLuint GLenum GLsizei GLsizei GLboolean packed
Definition: glew.h:12964
OP_OpTypeId
Definition: OP_OpTypeId.h:18
void * opaqueObject() const
virtual int parmDataTypeEnumId()=0
virtual std::string evalAsStringAtFrame(double frame)=0
virtual std::vector< HOM_ElemPtr< HOM_Geometry > > evalAsGeometriesAtFrame(double frame)=0
virtual std::vector< double > evalAsFloatsAtFrame(double frame)=0
virtual HOM_Ramp * evalAsRamp()=0
int sprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
virtual int dataParmTypeEnumId()=0
hboost::any HOM_DDSourceAny
Definition: HOM_Defines.h:42
virtual int evalAsInt()=0
GLboolean * data
Definition: glcorearb.h:130
iterator begin() const
Definition: UT_Options.h:406
virtual std::vector< double > evalAsFloats()=0
GLuint GLfloat * val
Definition: glcorearb.h:1607
A map of string to various well defined value types.
Definition: UT_Options.h:84
virtual double evalParmAsFloat(const char *parm_name)=0
virtual int parmDataTypeEnumId(const char *parm_name)=0
void HOMthrowIfNone(const T *pointer, const char *msg, bool allow_empty=true)
Definition: HOM_ErrorUtil.h:34
SYS_FORCE_INLINE const UT_Options * options() const
Definition: UT_Options.h:804
virtual bool isManager(bool include_management_types=true)=0
GLsizei const GLfloat * value
Definition: glcorearb.h:823
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
virtual HOM_EnumValue & dataType()=0
int id() const
Definition: HOM_EnumValue.h:82
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:171
virtual std::vector< HOM_ElemPtr< HOM_Ramp > > evalAsRamps()=0
#define const
Definition: zconf.h:214
virtual int evalParmAsInt(const char *parm_name)=0
HOM_API HOM_Module & HOM()
virtual std::vector< std::string > evalAsStringsAtFrame(double frame)=0
GLdouble s
Definition: glew.h:1395
virtual std::string evalAsString()=0
virtual HOM_Geometry * evalAsGeometry()=0
virtual HOM_Geometry * geometry()=0