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