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