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