HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Node.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_Node_h__
10 #define __HOM_Node_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_NetworkMovableItem.h"
14 #include "HOM_BinaryString.h"
15 #include "HOM_EnumModules.h"
16 #include "HOM_IterableList.h"
17 #include "HOM_PtrOrNull.h"
18 #include <PY/PY_OpaqueObject.h>
19 #include <string>
20 #include <vector>
21 
22 class HOM_StickyNote;
23 class HOM_NodeConnection;
24 class HOM_NodeGroup;
25 class HOM_NodeType;
27 class HOM_Parm;
28 class HOM_ParmTuple;
29 class HOM_IndirectInput;
31 class HOM_HDAModule;
32 class HOM_ParmTemplate;
33 class HOM_DopSimulation;
34 class HOM_DopObject;
36 class HOM_NodeInfoTree;
37 class CL_Clip;
38 
39 SWIGOUT(%rename(Node) HOM_Node;)
40 
41 class HOM_API HOM_Node : virtual public HOM_NetworkMovableItem
42 {
43 public:
45  : HOM_NetworkMovableItem(HOM_networkItemType::Node)
46  { HOM_CONSTRUCT_OBJECT(this) }
47  HOM_Node(const HOM_Node &node)
49  { HOM_CONSTRUCT_OBJECT(this) }
50  virtual ~HOM_Node()
51  { HOM_DESTRUCT_OBJECT(this) }
52 
53  virtual std::vector<std::string> _getArgumentAutoComplete(
54  const char *method_name, const char *arguments,
55  bool meta_info_only = false) = 0;
56 
57  virtual std::string __repr__() = 0;
58 
59  virtual bool operator==(HOM_PtrOrNull<HOM_Node> node) = 0;
60  virtual bool operator!=(HOM_PtrOrNull<HOM_Node> node) = 0;
61 
62  virtual std::string __str__() = 0;
63 
64  SWIGOUT(%kwargs infoTree;)
65  virtual HOM_NodeInfoTree infoTree(
66  bool verbose = false, bool debug = false) = 0;
67  virtual bool isNetwork() = 0;
68 
69  SWIGOUT(%newobject type;)
70  virtual HOM_NodeType *type() = 0;
71 
72  virtual HOM_NodeTypeCategory *childTypeCategory() = 0;
73 
74  virtual bool isFlagReadable(HOM_EnumValue &flag) = 0;
75  virtual bool isFlagWritable(HOM_EnumValue &flag) = 0;
76  virtual bool isGenericFlagSet(HOM_EnumValue &flag) = 0;
77  virtual void setGenericFlag(HOM_EnumValue &flag, bool value) = 0;
78 
79  virtual bool isDisplayDescriptiveNameFlagSet() = 0;
80  virtual void setDisplayDescriptiveNameFlag(bool on) = 0;
81 
82  // We need a quick way to get the OP_OpTypeId from C++ code so we know
83  // which subclass of HOM_Node we should cast to, so that's why
84  // opTypeIdAsInt() exists.
85  SWIGOUT(%ignore opTypeIdAsInt;)
86  virtual int opTypeIdAsInt() = 0;
87  // Further, we need a quick way to get the OBJ_OBJECT_TYPE from C++ code
88  // so we know which subclass of HOM_ObjNode we should cast to.
89  // That's why objTypeAsInt() exists.
90  SWIGOUT(%ignore objTypeAsInt;)
91  virtual int objTypeAsInt() = 0;
92 
93  SWIGOUT(%newobject node;)
94  SWIGOUT(%kwargs node;)
95  virtual HOM_Node* node(const char* node_path) = 0;
96 
97  SWIGOUT(%kwargs nodes;)
98  virtual std::vector<HOM_ElemPtr<HOM_Node> > nodes(
99  const std::vector<std::string>& node_paths) = 0;
100 
101  SWIGOUT(%newobject item;)
102  SWIGOUT(%kwargs item;)
103  virtual HOM_NetworkMovableItem* item(const char* item_path) = 0;
104 
105  SWIGOUT(%kwargs items;)
106  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > items(
107  const std::vector<std::string>& item_paths) = 0;
108 
109  SWIGOUT(%kwargs glob;)
110  virtual std::vector<HOM_ElemPtr<HOM_Node> > glob(
111  const char *pattern, bool ignore_case=false) = 0;
112 
113  SWIGOUT(%kwargs recursiveGlob;)
114  virtual std::vector<HOM_ElemPtr<HOM_Node> > recursiveGlob(
115  const char *pattern,
116  HOM_EnumValue &filter = HOM_nodeTypeFilter::NoFilter) = 0;
117 
118  SWIGOUT(%newobject createNode;)
119  SWIGOUT(%kwargs createNode;)
120  virtual HOM_Node* createNode(
121  const char* node_type_name,
122  const char* node_name=NULL,
123  bool run_init_scripts=true,
124  bool load_contents=true,
125  bool exact_type_name=false) = 0;
126  virtual void runInitScripts() = 0;
127  virtual void createOrMoveVisualizer(int output_index) = 0;
128 
129  virtual int inputIndex(const char *input_name) = 0;
130  virtual int outputIndex(const char *output_name) = 0;
131 
132  virtual void setInput(
133  int input_index,
134  HOM_NetworkMovableItem *item_to_become_input,
135  int output_index = 0) = 0;
136 
137  virtual void setNamedInput(
138  const char *input_name,
139  HOM_NetworkMovableItem *item_to_become_input,
140  const char *output_name) = 0;
141 
142  virtual void setNamedInput(
143  const char *input_name,
144  HOM_NetworkMovableItem *item_to_become_input,
145  int output_index) = 0;
146 
147  virtual void setFirstInput(
148  HOM_NetworkMovableItem *item_to_become_input,
149  int output_index = 0) = 0;
150 
151  virtual void setNextInput(
152  HOM_NetworkMovableItem *item_to_become_input,
153  int output_index = 0,
154  bool unordered_only = false) = 0;
155 
156  virtual void insertInput(
157  int input_index,
158  HOM_NetworkMovableItem *item_to_become_input,
159  int output_index = 0) = 0;
160 
161  virtual int numOrderedInputs() = 0;
162 
163  virtual std::vector<HOM_ElemPtr<HOM_Node> > inputs() = 0;
164 
165  virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> > inputConnections() = 0;
166 
167  SWIGOUT(%newobject inputConnectors;)
168  virtual HOM_IterableList<std::vector<HOM_ElemPtr<HOM_NodeConnection> > > *
169  inputConnectors() = 0;
170 
171  SWIGOUT(%kwargs inputAncestors;)
172  virtual std::vector<HOM_ElemPtr<HOM_Node> > inputAncestors(
173  bool include_ref_inputs = true,
174  bool follow_subnets = false) = 0;
175 
176  virtual std::vector<std::string> inputNames() = 0;
177  virtual std::vector<std::string> inputLabels() = 0;
178 
179  virtual std::string editableInputString(int input_index,
180  const char *key) = 0;
181  virtual void setEditableInputString(int input_index,
182  const char *key, const char *value) = 0;
183 
184  virtual std::vector<std::string> outputNames() = 0;
185  virtual std::vector<std::string> outputLabels() = 0;
186 
187  virtual std::vector<HOM_ElemPtr<HOM_Node> > outputs() = 0;
188 
189  virtual std::vector<HOM_ElemPtr<HOM_NodeConnection> >
190  outputConnections() = 0;
191 
192  SWIGOUT(%newobject outputConnectors;)
193  virtual HOM_IterableList<std::vector<HOM_ElemPtr<HOM_NodeConnection> > > *
194  outputConnectors() = 0;
195 
196  // Dependency information.
197  SWIGOUT(%kwargs references;)
198  virtual std::vector<HOM_ElemPtr<HOM_Node> >
199  references(bool include_children=true) = 0;
200  SWIGOUT(%kwargs dependents;)
201  virtual std::vector<HOM_ElemPtr<HOM_Node> >
202  dependents(bool include_children=true) = 0;
203 
204  // Access things contained in this node (node must be a network).
205  virtual std::vector<HOM_ElemPtr<HOM_Node> > children() = 0;
206  SWIGOUT(%kwargs allSubChildren;)
207  virtual std::vector<HOM_ElemPtr<HOM_Node> > allSubChildren(
208  bool top_down = true, bool recurse_in_locked_nodes = true) = 0;
209  SWIGOUT(%kwargs selectedChildren;)
210  virtual std::vector<HOM_ElemPtr<HOM_Node> > selectedChildren(
211  bool include_hidden = false,
212  bool include_hidden_support_nodes = false) = 0;
213 
214  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > allItems() = 0;
215  SWIGOUT(%kwargs selectedItems;)
216  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > selectedItems(
217  bool include_hidden = false,
218  bool include_hidden_support_nodes = false) = 0;
219  SWIGOUT(%kwargs numItems;)
220  virtual int numItems(HOM_EnumValue *item_type = NULL,
221  bool selected_only = false,
222  bool include_hidden = false) = 0;
223 
224  // Picked child item copy/paste/delete methods.
225  virtual void deleteItems(
226  const std::vector<HOM_NetworkMovableItem *> &items =
227  std::vector<HOM_NetworkMovableItem *>()) = 0;
228  virtual void copyItemsToClipboard(
229  const std::vector<HOM_NetworkMovableItem *> &items =
230  std::vector<HOM_NetworkMovableItem *>()) = 0;
231  virtual void pasteItemsFromClipboard(HOM_Vector2 *position = NULL) = 0;
232  SWIGOUT(%kwargs copyItems;)
233  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> > copyItems(
234  const std::vector<HOM_NetworkMovableItem *> &items,
235  bool channel_reference_originals=false,
236  bool relative_references=true,
237  bool connect_outputs_to_multi_inputs=false) = 0;
238 
239  SWIGOUT(%newobject creator;)
240  virtual HOM_Node *creator() = 0;
241  virtual bool isInsideLockedHDA() = 0;
242  virtual bool isEditableInsideLockedHDA() = 0;
243  virtual bool isEditable() = 0;
244  virtual bool isLockedHDA() = 0;
245  virtual bool isCompiled() = 0;
246 
247  SWIGOUT(%newobject hdaModule;)
248  virtual HOM_HDAModule *hdaModule() = 0;
249 
250  // hm is an alias for hdaModule.
251  SWIGOUT(%newobject hm;)
252  virtual HOM_HDAModule *hm()
253  { return hdaModule(); }
254 
255  SWIGOUT(%newobject moveToGoodPosition;)
256  SWIGOUT(%kwargs moveToGoodPosition;)
257  virtual HOM_Vector2 *moveToGoodPosition(bool relative_to_inputs = true,
258  bool move_inputs = true,
259  bool move_outputs = true,
260  bool move_unconnected = true) = 0;
261 
262  // TODO: Have an argument to specify sorting orders once bug 25998 is fixed.
263  // Have an argument equivalent to oplayout -t once bug 26018 is fixed.
264  SWIGOUT(%kwargs layoutChildren);
265  virtual void layoutChildren
266  (const std::vector<HOM_NetworkMovableItem *> &items =
267  std::vector<HOM_NetworkMovableItem *>(),
268  double horizontal_spacing=-1, double vertical_spacing=-1) = 0;
269 
270  virtual bool isCurrent() = 0;
271  SWIGOUT(%kwargs setCurrent;)
272  virtual void setCurrent(bool on, bool clear_all_selected = false) = 0;
273 
274  virtual bool isHidden() = 0;
275  virtual void hide(bool on) = 0;
276 
277  virtual std::string comment() = 0;
278  virtual void setComment(const char *comment) = 0;
279  virtual void appendComment(const char *comment) = 0;
280 
281  virtual std::string creatorState() = 0;
282  virtual void setCreatorState(const char *state) = 0;
283 
284  virtual bool isBuiltExplicitly() = 0;
285  virtual void setBuiltExplicitly(bool built_explicitly) = 0;
286 
287  virtual HOM_EnumValue *expressionLanguage() = 0;
288  virtual void setExpressionLanguage(HOM_EnumValue &language) = 0;
289 
290  SWIGOUT(%newobject parm;)
291  virtual HOM_Parm *parm(const char* parm_path) = 0;
292 
293  SWIGOUT(%newobject parmTuple;)
294  virtual HOM_ParmTuple *parmTuple(const char* parm_path) = 0;
295 
296  SWIGOUT(%kwargs globParms;)
297  virtual std::vector<HOM_ElemPtr<HOM_Parm> > globParms(
298  const char *pattern, bool ignore_case=false,
299  bool search_label=false,
300  bool single_pattern=false) = 0;
301 
302  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parms() = 0;
303 
304  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsReferencingThis() = 0;
305 
306  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > parmTuples() = 0;
307 
308  virtual std::vector<HOM_ElemPtr<HOM_Parm> > spareParms() = 0;
309  virtual void removeSpareParms() = 0;
310 
311  virtual void syncNodeVersionIfNeeded(const std::string &from_version) = 0;
312 
313  SWIGOUT(%kwargs setParmTemplateGroup;)
314  virtual void setParmTemplateGroup(
315  HOM_ParmTemplateGroup &parm_template_group,
316  bool rename_conflicting_parms=false) = 0;
317 
318 
319  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > parmTuplesInFolder(
320  const std::vector<std::string> &folder_names) = 0;
321 
322  virtual std::vector<HOM_ElemPtr<HOM_Parm> > parmsInFolder(
323  const std::vector<std::string> &folder_names) = 0;
324 
325  SWIGOUT(%newobject parmTemplateGroup;)
326  virtual HOM_ParmTemplateGroup *parmTemplateGroup() = 0;
327 
328  virtual std::vector<std::string> localVariables() = 0;
329 
330  virtual bool isTimeDependent() = 0;
331 
332  virtual void destroy() = 0;
333 
334  // If propagate==true, unlock will be propagated to ancestors
335  SWIGOUT(%kwargs allowEditingOfContents;)
336  virtual void allowEditingOfContents(bool propagate=false) = 0;
337  virtual void matchCurrentDefinition() = 0;
338  virtual bool matchesCurrentDefinition() = 0;
339 
340  SWIGOUT(%kwargs parmAliases;)
341  virtual std::map<HOM_ElemPtr<HOM_Parm>, std::string>
342  parmAliases(bool recurse=false) = 0;
343 
344  virtual void clearParmAliases() = 0;
345 
346  virtual std::vector<HOM_ElemPtr<HOM_NetworkBox> > networkBoxes() = 0;
347 
348  SWIGOUT(%newobject iterNetworkBoxes;)
349  virtual HOM_IterableList<HOM_NetworkBox> *iterNetworkBoxes() = 0;
350 
351  SWIGOUT(%newobject createNetworkBox;)
352  virtual HOM_NetworkBox *createNetworkBox(const char *name=NULL) = 0;
353 
354  SWIGOUT(%newobject copyNetworkBox;)
355  virtual HOM_NetworkBox *copyNetworkBox(HOM_NetworkBox &network_box_to_copy,
356  const char *new_name=NULL, bool channel_reference_original=false) = 0;
357 
358  SWIGOUT(%newobject findNetworkBox;)
359  virtual HOM_NetworkBox *findNetworkBox(const char *name) = 0;
360 
361  virtual std::vector<HOM_ElemPtr<HOM_NetworkBox> >
362  findNetworkBoxes(const char *pattern) = 0;
363 
364  virtual std::vector<HOM_ElemPtr<HOM_NetworkDot> > networkDots() = 0;
365 
366  SWIGOUT(%newobject createNetworkDot;)
367  virtual HOM_NetworkDot *createNetworkDot() = 0;
368 
369  SWIGOUT(%kwargs changeNodeType);
370  SWIGOUT(%newobject changeNodeType;)
371  virtual HOM_Node *changeNodeType(const char *new_node_type,
372  bool keep_name=true, bool keep_parms=true,
373  bool keep_network_contents=true,
374  bool force_change_on_node_type_match=false) = 0;
375 
376  virtual bool canCreateDigitalAsset() = 0;
377  SWIGOUT(%kwargs createDigitalAsset);
378  SWIGOUT(%newobject createDigitalAsset;)
379  virtual HOM_Node *createDigitalAsset(const char *name=NULL,
380  const char *hda_file_name=NULL, const char *description=NULL,
381  int min_num_inputs=0, int max_num_inputs=0,
382  bool compress_contents=false, const char *comment=NULL,
383  const char *version=NULL, bool save_as_embedded=false,
384  bool ignore_external_references=false,
385  bool compile_asset = false,
386  bool change_node_type = true,
387  bool create_backup = true) = 0;
388 
389  SWIGOUT(%kwargs createCompiledDigitalAsset);
390  virtual void createCompiledDigitalAsset(const char *name=NULL,
391  const char *hda_file_name=NULL, const char *description=NULL) = 0;
392 
393  // Sub-Network methods.
394  SWIGOUT(%kwargs collapseIntoSubnet;)
395  SWIGOUT(%newobject collapseIntoSubnet;)
396  virtual HOM_Node *collapseIntoSubnet(
397  const std::vector<HOM_NetworkMovableItem*> &child_items,
398  const char *subnet_name=NULL, const char *subnet_type=NULL) = 0;
399 
400  virtual std::vector<HOM_ElemPtr<HOM_NetworkMovableItem> >
401  extractAndDelete() = 0;
402 
403  virtual std::vector<HOM_ElemPtr<HOM_SubnetIndirectInput> >
404  indirectInputs() = 0;
405 
406  // get the nodes inside a subnet that feed its outputs
407  virtual std::vector<HOM_ElemPtr<HOM_Node> >
408  subnetOutputs() = 0;
409 
410  virtual bool isSubNetwork() = 0;
411 
412  // User data methods:
413  virtual void setUserData(const char *name, const std::string &value) = 0;
414  SWIGOUT(%ignore boostAnyUserData;)
415  virtual hboost::any boostAnyUserData(const char *name) = 0;
416  virtual void destroyUserData(const char *name) = 0;
417  virtual std::map<std::string, HOM_BinaryString> userDataDict() = 0;
418 
419 #ifdef SWIG
420 %extend
421 {
422  InterpreterObject userData(const char *name)
423  { return HOMboostAnyToInterpreterObject(self->boostAnyUserData(name)); }
424 }
425 #endif
426 
427 
428  // Cached user data methods:
429  SWIGOUT(%ignore setOpaqueCachedUserData;)
430  virtual void setOpaqueCachedUserData(
431  const char *name, void *opaque_py_object) = 0;
432  SWIGOUT(%ignore opaqueCachedUserData;)
433  virtual void *opaqueCachedUserData(const char *name) = 0;
434  virtual void destroyCachedUserData(const char *name) = 0;
435  virtual std::map<std::string, PY_OpaqueObject> cachedUserDataDict() = 0;
436 
437 #ifdef SWIG
438 %extend
439 {
440  void setCachedUserData(const char *name, InterpreterObject value)
441  { return self->setOpaqueCachedUserData(name, value); }
442 
443  InterpreterObject cachedUserData(const char *name)
444  { return HOMincRef((InterpreterObject)self->opaqueCachedUserData(name)); }
445 }
446 #endif
447 
448  // Data Block methods (like user data, but bigger blobs with associated
449  // data types).
450  virtual std::vector<std::string> dataBlockKeys(
451  const char *blocktype = nullptr) = 0;
452  virtual std::string dataBlockType(const char *key) = 0;
453  virtual HOM_BinaryString dataBlock(const char *key) = 0;
454  virtual void setDataBlock(const char *key, const char *data,
455  const char *blocktype) = 0;
456 
457  // asCode methods:
458  SWIGOUT(%kwargs asCode;)
459  virtual std::string asCode(bool brief=false,
460  bool recurse=false,
461  bool save_channels_only=false,
462  bool save_creation_commands=true,
463  bool save_keys_in_frames=false,
464  bool save_outgoing_wires=false,
465  bool save_parm_values_only=false,
466  bool save_spare_parms=true,
467  const char *function_name=NULL) = 0;
468 
469  virtual bool canGenerateCookCode(bool check_parent=false) = 0;
470  SWIGOUT(%newobject cookCodeGeneratorNode;)
471  virtual HOM_Node *cookCodeGeneratorNode() = 0;
472  virtual std::string cookCodeLanguage() = 0;
473  virtual bool supportsMultiCookCodeContexts() = 0;
474 
475 
476  SWIGOUT(%kwargs saveCookCodeToFile;)
477  virtual void saveCookCodeToFile(
478  const char *file_name, bool skip_header=false,
479  const char *context_name = NULL) = 0;
480 
481  // This method is deprecated.
482  void saveCodeToFile(const char *file_name, bool skip_header=false,
483  const char *context_name = NULL)
484  { saveCookCodeToFile(file_name, skip_header, context_name); }
485 
486 
487  virtual void saveCompiledCookCodeToFile(const char *file_name,
488  const char *context_name = NULL) = 0;
489 
490  // This method is deprecated.
491  void saveToCompiledVexFile(const char *file_name,
492  const char *context_name = NULL)
493  { saveCompiledCookCodeToFile(file_name, context_name); }
494 
495 
496  SWIGOUT(%kwargs cook;)
497  virtual void cook(
498  bool force = false,
499  const std::vector<double> frame_range = std::vector<double>()) = 0;
500 
501  /// Determine if this node to cook at the current evaluation time
502  virtual bool needsToCook() = 0;
503  /// Determine if this node to cook at the given time
504  virtual bool needsToCook(double time) = 0;
505 
506  virtual int cookCount() = 0;
507 
508  virtual void updateParmStates() = 0;
509 
510  virtual std::string deleteScript() = 0;
511  virtual void setDeleteScript(const std::string &script_text,
512  HOM_EnumValue &language = HOM_scriptLanguage::Python) = 0;
513 
514  // Sticky methods
515  SWIGOUT(%newobject createStickyNote;)
516  virtual HOM_StickyNote *createStickyNote(const char *name=NULL) = 0;
517 
518  virtual std::vector<HOM_ElemPtr<HOM_StickyNote> > stickyNotes() = 0;
519 
520  SWIGOUT(%newobject iterStickyNotes;)
521  virtual HOM_IterableList<HOM_StickyNote> *iterStickyNotes() = 0;
522 
523  SWIGOUT(%newobject copyStickyNote;)
524  virtual HOM_StickyNote *copyStickyNote(HOM_StickyNote &sticky_note_to_copy,
525  const char *new_name=NULL) = 0;
526 
527  SWIGOUT(%newobject findStickyNote;)
528  virtual HOM_StickyNote *findStickyNote(const char *name) = 0;
529 
530  SWIGOUT(%newobject findStickyNotes;)
531  virtual std::vector<HOM_ElemPtr<HOM_StickyNote> > findStickyNotes(
532  const char *pattern) = 0;
533 
534 
535  SWIGOUT(%newobject addNodeGroup;)
536  virtual HOM_NodeGroup *addNodeGroup(const char *name = NULL) = 0;
537 
538  virtual std::vector<HOM_ElemPtr<HOM_NodeGroup> > nodeGroups() = 0;
539 
540  SWIGOUT(%newobject nodeGroup;)
541  virtual HOM_NodeGroup *nodeGroup(const char *name) = 0;
542 
543  virtual std::vector<std::string> errors() = 0;
544  virtual std::vector<std::string> warnings() = 0;
545  virtual std::vector<std::string> messages() = 0;
546 
547  virtual std::string motionEffectsNetworkPath() = 0;
548  SWIGOUT(%newobject findOrCreateMotionEffectsNetwork;)
549  virtual HOM_Node *findOrCreateMotionEffectsNetwork(bool create=true) = 0;
550 
551  SWIGOUT(%kwargs saveItemsToFile;)
552  virtual void saveItemsToFile(
553  const std::vector<HOM_NetworkMovableItem *> &items,
554  const char *file_name,
555  bool save_hda_fallbacks = false) = 0;
556  SWIGOUT(%kwargs loadItemsFromFile;)
557  virtual void loadItemsFromFile(
558  const char *file_name, bool ignore_load_warnings=false) = 0;
559 
560  SWIGOUT(%ignore addOpaqueEventCallback;)
561  virtual void addOpaqueEventCallback(
562  const std::vector<HOM_EnumValue *> &event_types,
563  void *py_callback) = 0;
564  SWIGOUT(%ignore removeOpaqueEventCallback;)
565  virtual void removeOpaqueEventCallback(
566  const std::vector<HOM_EnumValue *> &event_types,
567  void *py_callback) = 0;
568  virtual void removeAllEventCallbacks() = 0;
569  SWIGOUT(%ignore opaqueEventCallbacks;)
570  virtual std::vector<std::pair<std::vector<HOM_EnumValue *>, void *> >
571  opaqueEventCallbacks() = 0;
572 
573  virtual double stampValue(const char *name, double default_value) = 0;
574  virtual std::string stampValue(
575  const char *name, const char *default_value) = 0;
576 
577  virtual void *_asVoidPointer() = 0;
578 
579  SWIGOUT(%newobject simulation;)
580  virtual HOM_DopSimulation *simulation() = 0;
581 
582  virtual std::vector<HOM_ElemPtr<HOM_Node> >
583  findNodesThatProcessedObject(HOM_DopObject &dop_object) = 0;
584 
585  virtual HOM_BinaryString _parmClipData(double start,
586  double end,
587  bool binary = true,
588  bool use_blosc_compression = true,
589  double sample_rate = 0,
590  bool scoped_only = false) = 0;
591 
592  SWIGOUT(%kwargs _setParmClipData;)
593  virtual void _setParmClipData(HOM_BinaryString data,
594  bool binary = true,
595  bool blosc_compressed = true,
596  double sample_rate = 0,
597  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
598 
599  virtual void _saveParmClip(std::string file_name,
600  double start,
601  double end,
602  double sample_rate = 0,
603  bool scoped_only = false) = 0;
604 
605  SWIGOUT(%kwargs _loadParmClip;)
606  virtual void _loadParmClip(std::string file_name,
607  double sample_rate = 0,
608  double start = HOM_MIN_NEGATIVE_DOUBLE) = 0;
609 
610  virtual int __creationTime() = 0;
611  virtual int __modificationTime() = 0;
612 
613 #ifdef SWIG
614 %extend
615 {
616  // evalParm() and evalParmTuple() need to be special methods because
617  // their return types can vary.
618  InterpreterObject evalParm(const char *parm_path)
619  {
620  HOM_Parm *parm = self->parm(parm_path);
621 
622  if (!parm)
623  throw HOM_OperationFailed("Invalid parm name");
624 
625  InterpreterObject result = HOMevalParm(*parm);
626  delete parm;
627  return result;
628  }
629 
630  InterpreterObject evalParmTuple(const char *parm_path)
631  {
632  HOM_ParmTuple *parm_tuple = self->parmTuple(parm_path);
633 
634  if (!parm_tuple)
635  throw HOM_OperationFailed("Invalid parm tuple name");
636 
637  InterpreterObject result = HOMevalParmTuple(*parm_tuple);
638  delete parm_tuple;
639  return result;
640  }
641 
642  void addEventCallback(
643  const std::vector<HOM_EnumValue *> &event_types,
644  InterpreterObject callback)
645  { self->addOpaqueEventCallback(event_types, callback); }
646 
647  void removeEventCallback(
648  const std::vector<HOM_EnumValue *> &event_types,
649  InterpreterObject callback)
650  { self->removeOpaqueEventCallback(event_types, callback); }
651 
652 
653  std::vector<std::pair<std::vector<HOM_EnumValue *>, InterpreterObject> >
654  eventCallbacks()
655  {
656  std::vector<std::pair<std::vector<HOM_EnumValue *>, void *> >
657  opaque_callbacks(self->opaqueEventCallbacks());
658 
659  std::vector<std::pair<std::vector<HOM_EnumValue *>, InterpreterObject> >
660  callbacks;
661  for (int i=0; i< opaque_callbacks.size(); ++i)
662  callbacks.push_back(std::make_pair(
663  opaque_callbacks[i].first,
664  (InterpreterObject)opaque_callbacks[i].second));
665  return callbacks;
666  }
667 }
668 #endif
669 };
670 
671 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1056
void saveCodeToFile(const char *file_name, bool skip_header=false, const char *context_name=NULL)
Definition: HOM_Node.h:482
GT_API const UT_StringHolder time
GLuint start
Definition: glcorearb.h:474
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
HOM_Node()
Definition: HOM_Node.h:44
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
int isTimeDependent() const
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
void saveToCompiledVexFile(const char *file_name, const char *context_name=NULL)
Definition: HOM_Node.h:491
png_uint_32 i
Definition: png.h:2877
HOM_Node(const HOM_Node &node)
Definition: HOM_Node.h:47
#define HOM_API
Definition: HOM_API.h:13
GLuint GLuint end
Definition: glcorearb.h:474
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1055
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:604
#define HOM_MIN_NEGATIVE_DOUBLE
Definition: HOM_Defines.h:46
virtual HOM_HDAModule * hm()
Definition: HOM_Node.h:252
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
GT_API const UT_StringHolder version
GLsizei const GLfloat * value
Definition: glcorearb.h:823
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual ~HOM_Node()
Definition: HOM_Node.h:50
png_infop png_uint_32 flag
Definition: png.h:2242
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:590
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296