HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_Network.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  * NAME: OP Library (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __OP_Network_h__
13 #define __OP_Network_h__
14 
15 #include "OP_API.h"
16 #include "OP_DataTypes.h"
17 #include "OP_DotList.h"
18 #include "OP_GroupList.h"
19 #include "OP_NetworkBox.h"
20 #include "OP_NetworkBoxList.h"
21 #include "OP_Node.h"
22 #include "OP_PostIt.h"
23 #include "OP_PostItNoteList.h"
24 #include <UT/UT_Array.h>
25 #include <UT/UT_ValArray.h>
26 #include <UT/UT_Set.h>
27 #include <UT/UT_String.h>
28 #include <UT/UT_StringMMPattern.h>
29 #include <UT/UT_SymbolTable.h>
30 #include <SYS/SYS_Types.h>
31 #include <iosfwd>
32 #include <set>
33 
34 class UT_CPIO;
35 class UT_WorkBuffer;
36 class UT_StringArray;
37 class OP_Director;
38 class OP_Dot;
39 class OP_Group;
40 class OP_Operator;
41 class OP_OperatorTable;
42 class OP_ProxyRefNode;
44 class OP_UndoLoad;
45 class op_PathSet;
46 class MOT_Director;
47 
49 
51 
52 // The tile type is used to distinguish between the various types of
53 // nodes that the networks are starting to contain.
55 {
56  OP_TILE_ALL = 0xFF,
57  OP_TILE_NODE = 0x01, // The regular op nodes
58  OP_TILE_PARENT = 0x02, // The parent inputs for subnets
59  OP_TILE_GROUP = 0x04, // The op groups
60 
61  // These are for convenience
65 };
66 
67 // If you are looking for the OBJ_TABLE_NAME and SOP_SCRIPT_NAME style #defines
68 // that used to be here, they have been moved up to OP_Node.h.
69 
71 {
72  OP_RENAME_NO_PROPAGATE = 0x00, // does no propagation
73  OP_RENAME_NORMAL = 0x01, // does all propagation
74  OP_RENAME_NO_EVENTS = 0x02, // does not send op events AND
75  // does not re-export chops
76  OP_RENAME_NO_DEPENDENCIES = 0x04, // does not notify dependencies
77 
79 };
80 
82 {
84  {
85  replacePrefix = 0;
86  replaceSuffix = 0;
88  }
89 
97 
98 private:
99  // copy constructors are not implemented yet
101  OP_FixNameParms &operator =( const OP_FixNameParms &copy );
102 };
103 
104 // This class is used to filter OP_Operators from being instantiated
105 // and shelf tools from appearing in the Tab menu.
107 {
108  public:
110  virtual ~OP_OperatorFilter() { }
111 
112  /// Returns true if an operator type can be created as a child, and
113  /// false otherwise.
114  virtual bool allowOperatorAsChild(OP_Operator *op) { return true; }
115 
116  /// Returns true if an operator type should be listed in the Tab menu,
117  /// and false otherwise.
119  { return allowOperatorAsChild(op); }
120 
121  /// Returns true if a shelf tool by the given name can appear
122  /// in the Tab menu for that (parent) network.
123  virtual bool allowTool(const char *tool_name) { return true; }
124 
125  /// Returns true if a shelf tool by the given name can appear
126  /// in the Tab menu for that (parent) network.
127  virtual bool allowToolSubmenus(const UT_StringHolder &tool_name,
128  const UT_StringArray &submenus) { return allowTool(tool_name); }
129 };
130 
131 typedef void *(OP_Network::*OP_FindItemFunc) (const char *);
132 
134 {
135 public:
137  ~OP_NetworkOperatorFilter() override;
138 
139  bool allowOperatorAsChild(OP_Operator *op) override;
140  bool allowOperatorInTabMenu(OP_Operator *op) override;
141 
142  bool allowToolSubmenus(const UT_StringHolder &tool_name,
143  const UT_StringArray &submenus) override;
144 
145  void setFilter(const UT_StringHolder &filter);
146 private:
147  UT_StringHolder myFilterString;
148  UT_StringMMPattern myPattern;
149  bool myHasSlash;
150 };
151 
152 class OP_API OP_Network : public OP_Node
153 {
154 public:
155  static const char *getScriptFromTable(const char *table);
156  static const char *getOpTypeFromTable(const char *table);
157 
158  // Primary node access methods. Only take OP_Node's into consideration
159  int getNchildren() const override;
160  OP_Node *getChild(const char *name=0,
161  int *hint=0) const override;
162  OP_Node *getChild(int index) const override;
163  virtual int getChildIndex(const OP_Node *) const;
164 
165  // isNetwork returns if the node can have children. This is true
166  // if the node has an operator table or has any children.
167  // This does NOT tell you if it is derived from OP_Network.
168  int isNetwork() const override;
169 
170  int getDandROpsEqual() override;
171  int updateDandROpsEqual(int check_inputs = 1) override;
172 
173  // This method a node within the network's UT_ValArray of children
174  // dstindex can be any number between 0 and childcount + 1.
175  // dstindex refers to the index of the child before which the
176  // src node should be moved. Right now, it is only used by OPUI_OpList.
177  // As soon as it is used elsewhere, we'll have to add OP_Events for it.
178  virtual void moveChildIndex(int srcindex, int dstindex);
179 
180  // These work the same as getOpType* but return what sort of ops
181  // this network usually has as children. Of course, there's
182  // always the chance of heterogenous ops skulking around in there
183  // so treat it as a guideline rather than an assertion.
184  virtual const char *getChildType() const;
185  virtual OP_OpTypeId getChildTypeID() const = 0;
186 
187  int getTemplateOps(UT_ValArray<OP_Node *> &list);
188 
189  // obtains the children that match a given operator name.
190  // INPUTS:
191  // op_name - the name of a operator to look for (e.g., "object_merge")
192  // OUTPUTS:
193  // list - the list of children that are instances of an operator
194  // that is identified by op_name
195  // RETURNS:
196  // number of children in the output list
197  int getOpsByName(const char *op_name,
198  UT_Array<OP_Node *> &list) const;
199 
200  OP_Node *peekCurrentNodePtr();
201  void stashCurrentNodePtr(const OP_Node *child);
202  OP_Node * getStashedCurrentNodePtr() const;
203 
204  virtual OP_Node *getCurrentNodePtr();
205  virtual OP_Node *getDisplayNodePtr();
206  virtual OP_Node *getRenderNodePtr();
207  virtual CHOP_Node *getAudioNodePtr();
208  virtual const UT_ValArray<OP_Node *> &getOutputNodePtrs() const;
209 
210  virtual void childDeleted(OP_Node *);
211  virtual void childFlagChange(OP_Node *);
212 
213  fpreal getChildrenScale() const { return myChildScale; }
214  void setChildrenScale(fpreal scale);
215 
216  // Returns the OP_OperatorFilter object for this network. Used to
217  // filter out some OP_Operator types. See OP_OperatorFilter above.
218  virtual OP_OperatorFilter *getOperatorFilter();
219 
220  /// Obtains the namespace scope names for this network and for its parents,
221  /// all aranged in a stack array, with this network's name first in the
222  /// array, and the node hierarchy root (director) appearing last.
223  /// By convention, the scope name is the same as the network operator name
224  /// (with the table name).
225  void getNetworkScopeStack(UT_StringArray &scope_stack);
226 
227  /// Returns true if the given op can be created as a child of this network.
228  bool isOperatorAllowedAsChild(OP_Operator *op);
229 
230  /// Returns ture if the given op can show up in the Tab menu.
231  virtual bool isOperatorAllowedInTabMenu(OP_Operator *op);
232 
233  /// Returns true if the given tool can appear in the Tab menu for this net.
234  bool isToolAllowed(const UT_StringHolder &tool_name,
235  const UT_StringArray &submenus);
236 
237  /// Adds a new OP_Node of the specified type as a child of this node.
238  /// If 'name' is not given, then it will use 'type' suffixed with a unique
239  /// numeric suffix. In either case, if the 'name' collides with a
240  /// pre-existing node, then the actual node will be created with a unique
241  /// name created by numeric suffixing.
242  /// @param exact_type If true, the operator name parameter 'type',
243  /// is used verbatim to lookup the operator. Otherwise,
244  /// a preferred operator name that matches 'type'
245  /// specification is found first and then is used to lookup
246  /// the operator. The preferred type may be different than
247  /// 'type' for version namespace (eg "hda"
248  /// may match the preferred "hda::2.0" operator), for
249  /// scope namespace (eg "hda" may match
250  /// "Object/outer::hda" inside "outer" subnet), or for
251  /// operator namespace (eg, "userX::hda" may be preferred
252  /// to "hda", if the namespace hierarchy is so configured
253  /// that "userX" namespace trumps the top level (global)
254  /// namespace).
255  OP_Node *createNode(const char *type, const char *name = 0,
256  int notify = 1, int explicitly = 1,
257  int loadcontents = 1,
258  int *aliasedScriptedOp = 0,
259  char *matIconFilename = 0,
260  bool exact_type = false);
261 
262  /// Convenience method for requesting en exact type
264  const char *name = 0)
265  {
266  return createNode(type, name, 1, 1, 1, 0, 0, true);
267  }
268 
269  // Create dummy reference proxy nodes for dangling references
270  // This should only be called from OP_Node!
271  OP_Network *createProxyRefNode( const char *path ) override;
272 
273 
274  // Returns the list of nodes eligible to be considered for child
275  // errors.
277  OP_NodeList &nodes) const override;
278 
279  // Makes a copy of a single node inside this network. The source node does
280  // not need to be inside this network.
281  OP_Node *copyNode(const OP_Node *srcnode,
282  const char *toname = NULL,
283  bool reference_parameters = false);
284 
285  // Makes a copy of any number of network items inside this network. The
286  // source items must all be contained in a single network, but it does
287  // not need to be this network.
288  bool copyItems(const OP_NetworkBoxItemList &srcitems,
289  OP_NetworkBoxItemList &destitems,
290  bool reference_parameters,
291  bool relative_references,
292  bool connect_outputs_to_multi_inputs);
293 
294  // Makes a copy of all picked network items into this network. The source
295  // network does not need to be this network.
296  void copyPickedItems(
297  const OP_Network *srcnet,
298  OP_ItemTypeMask item_type_mask,
299  OP_Group *newnodes = nullptr,
300  const OP_FixNameParms *fix_name_parms=nullptr);
301 
302  // Copy 'srcnetbox' and its contents to this network. 'toname' specifies
303  // the name you'd like the copy to have. If this name has already been
304  // taken in this network, we'll use a slightly altered unique version of
305  // it. 'nodes' may only be non-null when 'save_type' is
306  // OP_NETWORKBOX_SAVE_SPECIFIED_CONTENTS, in which case it must be a valid
307  // ptr array of nodes in 'netbox'.
308  OP_NetworkBox *copyNetworkBox(OP_NetworkBox *srcnetbox,
309  OP_NetworkBoxSaveType save_type,
310  OP_NodeList *nodes = NULL,
311  const char *toname = NULL,
312  bool reference_parameters = false);
313 
314  // Copy a single post-it note into this network. The source post-it does
315  // not need to be in this network.
316  OP_PostIt *copyPostItNote(OP_PostIt *src_note,
317  const char *toname = 0);
318 
319  // Makes a copy of all picked nodes into this network. The source network
320  // does not need to be this network.
321  void copyPickedNodes(const OP_Network *srcnet,
322  OP_Group *newnodes=0,
323  const OP_FixNameParms *fix_name_parms=0);
324 
325  // Moves the picked nodes from srcnet into this network.
326  // If src_nodes_ptr and dest_nodes_ptr are not null, they will be set
327  // to the original node pointers and the new node pointers. (The nodes
328  // in src_nodes_ptr will have been deleted.)
329  virtual bool movePickedNodes(OP_Network *src_net,
330  OP_NodeList *src_nodes_ptr=NULL,
331  OP_NodeList *dest_nodes_ptr=NULL);
332 
333  /// Returns true if it is safe at this time to destroy this node.
334  static bool canDestroyNode(OP_Node *node);
335 
336  int destroyNode(OP_Node *node);
337  int destroyNodes(const OP_NodeList &nodes);
338 
339  virtual int renameNode(OP_Node *node, const char *name,
341 
342  /// Obtains the CHOP network to store motion effects. If create is true,
343  /// then it will be created if it doesn't exist yet.
344  OP_Network *findOrCreateMotionEffectsNetwork(bool create=true);
345 
346  // Delete implicit ancestors. If included is true delete the initial given
347  // node as well. If a state name is passed in, check that the nodes were
348  // created by that state. The node is not deleted if any of its outputs do
349  // not match the given state. This function will have no effect on nodes
350  // not belonging to this network, or on subnetworks. The deletion will
351  // stop at the first invalid node (if keep_node points to anything, that
352  // node is invalid for deletion).
353  OP_Node *deleteImplicitAncestors(OP_Node &node,
354  const char *state = 0, OP_Node *keep_node = 0,
355  bool included = true);
356  // non-destructive version of deleteImplicitAncestors() that just returns
357  // the information.
358  OP_Node *getImplicitAncestors(
359  OP_NodeList &implicit_nodes,
360  OP_NodeList &border_nodes,
361  OP_Node &node,
362  const char *state = 0, OP_Node *keep_node = 0,
363  bool included = true);
364 
365  // Fetch all channel collections from this node down.
366  int getAllCollections(UT_ValArray<CH_Collection *> &list,
367  int hide=0);
368 
369  /// Build a unique node name or a unique operator name from
370  /// the one given. We'll pretend we also have children with the names in
371  /// 'fakeChildren' when we do our name-collision checking if 'fakeChildren'
372  /// is non-NULL.
373  void uniqueNodeName(UT_String &name,
374  UT_StringSet *fakeChildren = 0);
375 
376  // This function is used to make some extra names invalid. Returns 0
377  // by default. Used by the VOPNET manager to prevent a new VOPNET
378  // with a name that matches an existing operator type.
379  virtual int isInvalidName(const char *name);
380 
381  static void fixName( const char *name,
382  const OP_FixNameParms &fix_name_parms,
383  UT_String &fixed_name );
384 
385  // I/O methods - there are also the save & load inherited from the
386  // OP_Node class.
387 
388  ///Save all picked items of the types specified by 'item_type'. Note that
389  ///saving any nodes or netboxes implicitly always saves indirect inputs if
390  ///they're picked (legacy behaviour). If 'item_type' includes netboxes, you
391  ///can specify the save policy for netboxes regarding how much of their
392  ///contents they should be saved along with themselves. This is the only way
393  ///for a node to remember which netbox it was in.
394  OP_ERROR savePickedItems(std::ostream &os,
395  const OP_SaveFlags &flags,
396  OP_ItemTypeMask item_type,
397  OP_NetworkBoxSaveType save_type =
399 
400  ///Save all items of the types specified by 'item_type'. Note that
401  ///saving any nodes or netboxes implicitly always saves indirect inputs if
402  ///they're picked or part of a picked netbox (legacy behaviour).
403  OP_ERROR saveAllItems(std::ostream &os,
404  const OP_SaveFlags &flags,
405  OP_ItemTypeMask item_type);
406 
407  // Saves a single node with the same save options on the child nodes
408  // as on the top level node, with the exception of network box membership
409  // for children (which should always be saved)
410  OP_ERROR saveSingle(std::ostream &os, OP_Node *op,
411  const OP_SaveFlags &flags,
412  const UT_String &name_override = UT_String());
413  // Saves a single node with different save options for the child nodes
414  // compared to the top level node.
415  OP_ERROR saveSingle(std::ostream &os, OP_Node *op,
416  const OP_SaveFlags &flags,
417  const OP_SaveFlags &childflags,
418  std::set<int>* renaming_exclude_ids = NULL,
419  const UT_String &name_override = UT_String());
420 
421  ///Saves a single netbox. 'save_type' lets you specify the save policy
422  ///with regards to how much of its contents the network box saves with it.
423  ///'nodes' may only be non-null when 'save_type' is
424  ///OP_NETWORKBOX_SAVE_SPECIFIED_CONTENTS, in which case it must be a valid
425  ///ptr array of nodes in 'netbox'.
426  OP_ERROR saveSingleNetworkBox(std::ostream &os,
427  OP_NetworkBox &netbox,
428  const OP_SaveFlags &flags,
429  OP_NetworkBoxSaveType save_type,
430  OP_NodeList *nodes = NULL);
431 
432  /// Save a single post it note.
433  OP_ERROR saveSinglePostIt(std::ostream &os, OP_PostIt &pnote,
434  const OP_SaveFlags &flags);
435 
436  /// Save a single dot.
437  OP_ERROR saveSingleDot(std::ostream &os, OP_Dot &dot,
438  const OP_SaveFlags &flags);
439 
440  ///In order to avoid duplicately saving nodes in 'op_list' that have already
441  ///been saved by their netboxes, make sure to mark those netboxes and then
442  ///pass in 'skip_nodes_in_marked_netboxes' as true.
443  OP_ERROR saveOpList(std::ostream &os,
444  const UT_Array<OP_Node *> &op_list,
445  const OP_SaveFlags &save_flags,
446  int *nsaved = NULL);
447 
448  //Use when saving a mixture of different types of items into 1 file
449  OP_ERROR saveItemList(std::ostream &os,
450  const OP_NetworkBoxItemList &items,
451  const OP_SaveFlags &save_flags);
452 
453  const char *getClipboardFile(const char *file_prefix = 0);
454 
455  //Note that although we now have an OP_ItemTypeMask parameter available to
456  //us, we still need to keep the OP_TileType parameters to indicate saving
457  //of groups *boo*
458  int saveToClipboard(int all, OP_TileType type=OP_TILE_NODE,
459  int grouplist=0,
460  OP_ItemTypeMask item_type = OP_ITEMTYPE_NODE,
461  const char *file_prefix = 0);
462  int loadFromClipboard(fpreal x = 0, fpreal y = 0,
463  bool turn_off_display = false,
464  const char *file_prefix = 0);
465 
466  // loadNetwork will load nodes into the current net. For example,
467  // if there file is "foo.sops", you would call obj->loadNetwork().
468  // if the file were "foo.obj", you would call obj->getParent()->loadNetwork
469  bool loadNetwork(UT_IStream &is,
470  int merge = 0,
471  const char *pattern = NULL,
472  int overwrite = 0,
473  const OP_FixNameParms *fix_name_parms = NULL,
474  UT_StringArray *src_names = NULL,
475  UT_StringArray *dest_names = NULL);
476 
477  // Second signature for loadNetwork which takes an OP_OverwriteAction enum
478  // to control the overwrite behavior in a more granular way than the bool
479  // parameter offered in the method above.
480  bool loadIntoNetwork(UT_IStream &is,
482  bool merge = false,
483  const char *pattern = NULL,
484  const OP_FixNameParms *fix_name_parms = NULL,
485  UT_StringArray *src_names = NULL,
486  UT_StringArray *dest_names = NULL);
487 
488  bool pasteNetworkForMove(UT_IStream &is,
489  UT_StringArray &src_names,
490  UT_StringArray &dest_names);
491 
492  bool opShouldHandleChange(OP_EventType reason) override;
493 
494  static bool isOpWritten(UT_IStream &is);
495 
496  void clearUnreferencedInputs() override;
497 
498  /// Check a stream for collisions for loading... This will add the
499  /// problem nodes to 'node_list' and the problem network boxes to
500  /// 'netbox_list', and also return the total number of collisions found...
501  /// It rewinds the stream to the starting point, thus, it can't be used with
502  /// stdin! Remember that a node can collide with a network box, since they
503  /// share the same namespace!
504  int getLoadCollisions(UT_IStream &is, OP_NodeList &node_list,
505  UT_ValArray<OP_NetworkBox *> &netbox_list,
506  UT_ValArray<OP_PostIt *> &pnote_list,
507  const char *pattern = "*");
508 
509  /// Simulates adding items with the names in 'names' to this network, and
510  /// stores the resulting names after name-collisions have been addressed
511  /// back into 'names'. This works for anything sharing the node namespace,
512  /// which currently includes nodes and network boxes.
513  void simulateNameCollisions(UT_StringArray &names);
514 
515  // The getSortedList() returns an array of all the child nodes sorted
516  // alphabetically.
517  const UT_ValArray<OP_Node *> *getSortedList();
518 
519  // getAnyOutputOf will return the first OP found which is has the
520  // given OP as an input. Returns null if no such op exists.
521  OP_Node *getAnyOutputOf(OP_Node *op) const;
522 
523  // getAnyOP will return any OP in the collection.
524  // Null if there are none.
525  OP_Node *getAnyOP() const;
526 
527  // Group manipulation methods:
528  char *findUniqueGroupName(const char *basename=0);
529  OP_Group * findGroup(const char *name) const;
530  OP_Group * createGroup(const char *name=0);
531  int destroyGroup(const char *name);
532  int destroyGroup(OP_Group *group);
533 
534  int getNgroups() const;
535  OP_Group *getGroup(int index) const;
536  int getGroups(UT_ValArray<OP_Group *> &list, int internal=0);
537  int getMemberships(const OP_Node *node,
539  int internal=0);
540 
541  char *findUniqueNetworkBoxName(const char *base = NULL);
542  char *findUniquePostItNoteName(const char *base = NULL);
543  char *findUniqueDotName(const char *base = NULL);
544 
545  /// Pass in NULL as the name if you'd like a default name. Passing in
546  /// 'items' will automatically create a network box containing those items
547  /// with the netbox positioned properly around them
548  OP_NetworkBox *createNetworkBox(const char *name,
549  OP_NetworkBoxItemList *items = NULL);
550  int getNnetworkBoxes() const;
551  // Given a path, return the network box. The path may be relative.
552  OP_NetworkBox *findNetworkBox(const char *const_path) override;
553  // Unlike 'findNetworkBox()', these 2 methods only return netboxes
554  // contained directly in this network itself.
555  OP_NetworkBox *getNetworkBox(int index) const;
556  OP_NetworkBox *getNetworkBox(const char *name) const;
557 
558  /// Pass in NULL as the name if you'd like a default name.
559  OP_PostIt *createPostItNote(const char *name);
560  int getNpostItNotes() const;
561  // Given a path, return the post it note. The path may be relative.
562  OP_PostIt *findPostItNote(const char *const_path) override;
563  // Unlike 'findPostItNote()', these 2 methods only return postits
564  // contained directly in this network itself.
565  OP_PostIt *getPostItNote(int index) const;
566  OP_PostIt *getPostItNote(const char *name) const;
567 
568  // Dots are not meant to be referenced by name.
570  { return myDotList; }
571  int getNdots() const;
572  // Given a path, return the post it note. The path may be relative.
573  OP_Dot *findDot(const char *const_path) override;
574  OP_Dot *getDot(int index) const;
575  OP_Dot *getDot(const char *name) const;
576 
577  /// Return the number of items picked. 'item_type_mask' is a bit field used
578  /// to specify which item types you'd liked to include in the count. Use the
579  /// values in OP_ItemType to set the bits in 'item_type_mask'.
580  unsigned int nPicked(OP_ItemTypeMask item_type_mask,
581  bool include_hidden_nodes) const;
582 
583  /// Return all picked items of types specified by 'item_type_mask'.
584  /// Note that if only picked nodes are of interest, there is also
585  /// OP_Node::getPickedChildren().
586  void getPickedItems(OP_ItemTypeMask item_type_mask,
587  OP_NetworkBoxItemList &picked,
588  bool include_hidden = false,
589  bool recurse_picked_netboxes = false) const;
590 
591  /// Return all items that match the type mask.
592  void getAllItems(OP_ItemTypeMask item_type_mask,
593  OP_NetworkBoxItemList &items) const;
594 
595  /// Returns true if the item was successfully deleted
596  bool destroyItem(OP_NetworkBoxItem *item);
597  /// Returns the number of successfully deleted items
598  int destroyItems(const OP_NetworkBoxItemList &items);
599 
600  /// Same as findNode or findNetworkBox, but more generalized so you can
601  /// search through multiple items with just one method. 'item_type_mask' is
602  /// used to specify what type of items you want to consider in your search.
603  /// Does not support indirect parent input searches.
604  OP_NetworkBoxItem *findItem(const char *const_path,
605  OP_ItemTypeMask item_type = OP_ITEMTYPE_ALL
606  ) override;
607 
608  /// Look up a direct child item by name, with an option to screen based
609  /// on the item type. Like findItem above, but doesn't look into child
610  /// networks.
611  OP_NetworkBoxItem *getItem(const char *name,
612  OP_ItemTypeMask item_type = OP_ITEMTYPE_ALL);
613 
614  /// Returns true if the given node is a child descendant of the same
615  /// type with no intervening levels of different type.
616  bool isSubNode(const OP_Node *node) const;
617 
618  /// Try to avoid using this method, it only clears the selection for tiles,
619  /// not network boxes (network boxes are considered items but not tiles).
620  /// Can use setAllPickFlags() instead. In fact, since there are no group
621  /// tiles in the worksheet any more, this method has become somewhat useless
622  void clearSelection(OP_TileType t, int grouplist);
623 
624  ///Set the pick flags to 'value' for all items of types specified by
625  ///'item_type'
626  void setAllPickFlags(OP_ItemTypeMask item_type, int value);
627  void pickRequest(OP_NetworkBoxItem *item, int shift);
628  void pickRequest(int shift)
629  { OP_Node::pickRequest(shift); }
630 
631  void addPicked(const OP_Group *group); // Pick these nodes
632  void subPicked(const OP_Group *group); // Removed from picked
633 
634  // There are two versions of getOperatorTable. One that takes an
635  // operator type and returns the table for that type. The second
636  // returns the operator table associated with this network. This
637  // latter assumes that "setOperatorTable" has been called. All
638  // OP_Network sub-class constructors should do this:
639  //
640  // setOperatorTable(getOperatorTable(operatorType));
641  //
642  // If the script_path is NOT null, this method will create the
643  // operator table if it doesn't exist. Otherwise, it will return
644  // null for non-existant table names.
645  static OP_OperatorTable *getOperatorTable(
646  const UT_StringRef &op_type,
647  const char *script_path=0);
649  { return myOperatorTable; }
650  virtual const char *getScriptDirectory();
651 
652  // this is overridden so that we can clear the group flags
653  void clearUndoFlags() override;
654 
655  // Sub-networks use parent inputs to connect open inputs in
656  // the net to inputs in the parent. A list of the parent connections
657  // is the bookeeping required to manage and resolve these connections.
658  bool wantsParentInputs() const;
659 
660  // Get all picked Parent Inputs
661  int getNparentInputs() const
662  { return myParentInputs.entries(); }
663  OP_SubnetIndirectInput *findParentInput(const char *const_path) override;
664  OP_SubnetIndirectInput *getParentInput(int index) const;
665  OP_SubnetIndirectInput *getParentInput(const char *name) const;
666 
667  // getIndirectString returns a string that can be used to save
668  // parent inputs that refer to our parent input table.
669  // These are simply saved as a string index into our table.
670  // These can be resolved back using resolveIndirectString.
671  int getIndirectString(OP_IndirectInput *, UT_String &);
672  OP_IndirectInput *resolveIndirectString(const char *);
673 
674  void inputConnectChanged(int which) override;
675 
676  void getAllConnectedChildren(
677  int input_index, UT_Array<OP_Node*> &nodes,
678  bool expandSubnets = true) const;
679  void getAllConnectedChildrenNamed(
680  const OP_ConnectorId& input_name,
681  UT_Array<OP_Node*> &nodes,
682  bool expandSubnets = true) const;
683 
684  // The ViewSetting functions are used by ICE to store the name
685  // of the COP currently being viewed. Put here because COP2_SubNets
686  // and ICENET_Nodes both need to store this information.
687  virtual void setViewSetting(const char *) {};
688  virtual const char *getViewSetting() const { return ""; }
689 
690  void dumpDependencies(std::ostream &os) override;
691 
692  void changeParmTemplate(
693  PRM_Template *new_template) override;
694 
695  int getNumChildManagers(OP_OpTypeId type) const;
696  void addChildManager(OP_OpTypeId type);
697  void removeChildManager(OP_OpTypeId type);
698  bool getSaveWithVopnets() override;
699  void runDelScript() override;
700  void clearDelScripts(int pickedOnly);
701 
702  /// This method will unscope all the channels belonging to this op.
703  /// If the recurse flag is set it will recurse through the children
704  /// (at this level the recurse flag is ignored).
705  void unscopeChannels(bool recurse) override;
706 
707  /// This method will undisplay all the channels belonging to this op.
708  /// If the recurse flag is set it will recurse through the children
709  /// (at this level the recurse flag is ignored).
710  void undisplayChannels(bool recurse) override;
711 
712  /// This method will undisplay all the channels belonging to this op.
713  /// If the recurse flag is set it will recurse through the children
714  /// (at this level the recurse flag is ignored).
715  void unpinChannels(bool recurse) override;
716 
717  // Do global expansion on a pattern - get lists of network boxes
718  // If expand is given, concatenated with full list of names
719  // If list is given, appended with list of nodes.
720  void globNetworkBoxes(const char *pat, UT_String *expand,
722  OP_GlobContext *context = 0,
723  const char *prefix = " ") override;
724 
725  void globPostIts(const char *pat, UT_String *expand,
726  UT_ValArray<OP_PostIt *> *list=0,
727  OP_GlobContext *context = 0,
728  const char *prefix = " ") override;
729 
730  /// Returns the unique id of the representative operator that this network
731  /// may have. The changed_child parameter and the current_rep_id are used
732  /// in order to minimize the number of findSubNode() calls that are made.
733  int getRepresentativeNodeId(OP_Node *changed_child,
734  int current_rep_id);
735 
736  // Changes a child node's type from its current type to 'newtype'
737  // the keep... parameters will maintain the same name, pararmeter values
738  // and network contents if set to true.
739  bool changeChildNodeType(OP_Node *child,
740  const char *newtype,
741  bool keepname,
742  bool keepparms,
743  bool keepcontents,
744  bool quiet,
745  int *newChildId=NULL);
746 
747  // Returns true if the supplied node is specially marked as editable
748  // in this locked HDA node.
749  bool getIsSubNodeEditable(const OP_Node *subnode) const;
750  bool hasAnyEditableSubNodes() const;
752  { return myEditableSubNodes; }
753 
754  /// Builds the list of subnodes that are marked as message nodes.
755  /// Returns false if there are none (list.entries() == 0 then)
756  bool getMessageSubNodes(OP_NodeList &list) const;
757 
758  // Add any OTL-defined operators used by this network to the specified
759  // table.
761  UT_Set<OP_Operator *> &active_operators
762  ) const override;
763 
764  // Save a packet containing the fallback library paths for the specified
765  // operators.
766  static void saveOTLBackupInformation(std::ostream &os,
767  const OP_OperatorList &fallbackops,
768  const OP_OperatorList &dummyops);
769 
770  OP_SubnetIndirectInput *getNamedParentInput(
771  const OP_ConnectorId& name) const;
773  { return myIsClearingContentsOfEditableSubnodes; }
774 
775  int64 getMemoryUsage(bool inclusive) const override;
776 
777  static bool warnDeprecatedOpsOnLoad()
778  { return theWarnDeprecatedOpsOnLoad; }
779  static void setWarnDeprecatedOpsOnLoad(bool enable)
780  { theWarnDeprecatedOpsOnLoad = enable; }
781 
782  static const char *theChildTableName;
783 
784  void setCachedMimeFile(const char *filename);
785  const char *getCachedMimeFile() const;
786  void clearCachedMimeFile();
787  bool hasCachedMimeFile() const;
788 
789  OP_ERROR getErrorSeverity() override;
790  void getRawErrors(UT_Array<UT_Error> &errors,
791  bool update) override;
792 
793 protected:
794  // Protected constructor since networks are only created by Operators.
795  OP_Network(OP_Network *parent, const char *name, OP_Operator *op);
796  ~OP_Network() override;
797 
798  void clearAndDestroy() override;
799  void clearAndDestroyNodes();
800 
802  OP_Node *by_whom,
803  OP_EventType reason,
804  int parm_index,
805  OP_PropagateData &prop_data) override;
806 
807  // new method for dependencies: use the PRM_TYPE_OP_REF_*
808  // in your parm template to add your dependency.
809  // override this to do special cases, make sure you call the base class
810  void buildOpDependencies() override;
812  const UT_String &full_from,
813  OP_NodeList &cook_nodes) override;
815  const UT_String &full_from,
816  OP_NodeList &cook_nodes) override;
817  void rebuildOpDependents( bool proxy_only ) override;
818 
819  // clone dependencies from the proxy. proxy is no longer valid
820  // after the clone!
821  void cloneFromProxyRefNode( OP_Network *proxy ) override;
822  // clone a new proxy node. this node is no longer valid after this!
823  OP_Network * cloneToProxyRefNode() override;
824  int hasProxyRefNodes() const override
825  { return myProxyRefNodes.entries() > 0; }
826  void removeProxyRefNode( OP_Network *proxy );
827  void moveProxyRefNodes( OP_Network *dest ) override;
828 
829  void moveDependencies( OP_Node *from_node ) override;
830 
831  // Override of OP_Node::load to handle some network-specific packets.
832  bool load(UT_IStream &is, const char *ext = "",
833  const char *path = 0) override;
834 
835  /// Called upon entering and exiting loadNetwork() method
836  virtual void beginLoadingInNetwork();
837  virtual void endLoadingInNetwork();
838 
839  // Called at the end of loadChildOrder()
840  virtual void finishedLoadingChildOrder();
841 
842  // Called when loadNetwork finishes loading this whole network.
843  // Do not set `is_child_call`. That argument is set internally to
844  // true when finishedLoadingNetwork() is called on the node's children.
845  virtual void finishedLoadingNetwork(bool is_child_call=false);
846 
847 public:
848  /// Returns the current recursion depth of syncContents, note this is
849  /// NOT thread safe.
850  static int syncContentsLevel();
851 
852 protected:
853  // This overrides the OP_Node function.
854  // syncContents loads the given stream into this operator.
855  // The stream should be in .hip file format, with "this" pointing to
856  // the root node in the .hip file. It handles collisions gracefully
857  // by updating the existing operators instead of deleting and
858  // recreating them. It deletes any existing nodes not in the
859  // stream, and creates nodes if necessary.
860  bool syncContents(UT_IStream &is) override;
861 
862  // The following should only be called by the director, who doesn't have
863  // a real choice, does he?
864  virtual void addNode(OP_Node *node, int notify=1, int explicitly=1);
865 
866  OP_Node *findConnectedNode(OP_Node *op) const;
867 
868  // These functions ensure we have valid render and display nodes.
869  OP_Node *getPreferredDisplayNodePtr(OP_Node *skipthisnode)const;
870  void resetDisplayNodePtr(OP_Node *skipthisnode=0);
871  OP_Node *getPreferredRenderNodePtr(OP_Node *skipthisnode) const;
872  void resetRenderNodePtr(OP_Node *skipthisnode=0);
873  OP_Node *getPreferredAudioNodePtr(OP_Node *skipthisnode) const;
874  void resetAudioNodePtr(OP_Node *skipthisnode=0);
875  virtual CHOP_Node **getAudioNodeRef();
876 
877  // This function calls all of the above, for when we are deleting nodes.
878  void validateStatusNodePtrs(const OP_NodeList &skipnodes);
879 
880  virtual void updateExtraFlagPtrs();
881 
882  void nodeUnlocked() override;
883 
884  bool canDestroyNode() override;
885  virtual void destroySingleNode(OP_Node *node);
886 
887  // This function goes recursively through every node below this one and
888  // renames it to some unique but meaningless value. This is used for
889  // compiling networks.
890  void modifyAllChildNodeNames(bool renamepickableobjects,
891  const char *prefix, int &id,
892  std::set<int>* renaming_exclude_ids = NULL);
893 
894  /// This is a helper method to the setChannelScope method. It traverses
895  /// the node's parameters and sets the scope on them according to the
896  /// given pattern.
897  /// This method is also defined in OP_Parameters, it is overridden here
898  /// to provide parsing support for network paths.
899  void traverseScope(const char *pattern,
900  OP_ScopeOp scope_op,
901  const OP_ScopeOptions &scope_opts) override;
902 
903 
907 
908  // Implemented in VOPs. Only the new nodes are to be inserted into the out
909  // list, not any of the existing ones.
910  virtual void getAdditionalUndoNodes(const OP_NodeList& orig_list,
911  OP_NodeList& nodes_for_input_undo) { }
912 
913  /// Returns true if the child at node can should be saved, false otherwise.
914  virtual bool getAllowSavingChild(OP_Node *node,
915  const OP_SaveFlags &flags)
916  { return true; }
917 
918 private:
919  // Some helper functions for loading and saving.
920  OP_ERROR saveNetwork(std::ostream &os, const OP_SaveFlags &flags,
921  const OP_SaveFlags &childflags,
922  const char *pathPrefix, bool vopnets);
923  OP_ERROR saveChildNodes(std::ostream &os, const OP_SaveFlags &flags,
924  const char *pathPrefix, bool vopnets,
925  bool forceNoInit = false);
926  OP_ERROR saveOp(std::ostream &os, OP_Node *node,
927  const OP_SaveFlags &flags,
928  const OP_SaveFlags &childflags, const char *pathPrefix,
929  bool vopnets, bool forceNoInit = false,
930  const UT_String &name_override = UT_String());
931  OP_ERROR savePostIt(std::ostream &os, OP_PostIt *pnote,
932  const OP_SaveFlags &flags,
933  const char *pathPrefix);
934  bool loadNodeType(UT_IStream &is, OP_Network *net,
935  UT_String &nodeType, int &matches);
936  bool loadOp(UT_IStream &is,
937  OP_OverwriteAction overwrite,
938  const char *path,
939  op_PathSet &noneditable_missing_table);
940 
941  ///Save out all the netboxes in this network to 'os' in separate packets
942  OP_ERROR saveNetworkBoxes(std::ostream &os, const OP_SaveFlags &flags,
943  const char *path_prefix);
944  OP_ERROR savePostIts(std::ostream &os, const OP_SaveFlags &flags,
945  const char *path_prefix);
946  OP_ERROR saveDots(std::ostream &os, const OP_SaveFlags &flags,
947  const char *path_prefix);
948 
949  /// Load a network box from 'is'. Can load from both .hip files and the
950  /// clipboard. 'path' is used as the new netbox's name. If 'overwrite' is
951  /// specified, the new netbox will overwrite any other netboxes in this
952  /// network with the same name, rather than modify its name to be unique.
953  /// 'created' is used to return a ptr to the new network box.
954  bool loadNetworkBox(UT_IStream &is, const char *path = "",
955  bool path_contains_network = true,
956  bool path_contains_packet_ext = true,
958  OP_NetworkBox **created = NULL);
959 
960  /// Load a post-it note from 'is'. Can load from both .hip files and the
961  /// clipboard. 'path' is used as the new post-it's name. If 'overwrite' is
962  /// specified, the new post-it will overwrite any other post-its in this
963  /// network with the same name, rather than modify its name to be unique.
964  /// 'created' is used to return a ptr to the new post-it.
965  bool loadPostIt(UT_IStream &is, const char *path = "",
966  bool path_contains_network = true,
967  bool path_contains_packet_ext = true,
969  OP_PostIt **created = NULL);
970 
971  /// Load a network dot from 'is'. Can load from both .hip files and the
972  /// clipboard. 'path' is used as the new dot's name. If 'overwrite' is
973  /// specified, the new dot will overwrite any other dots in this
974  /// network with the same name, rather than modify its name to be unique.
975  /// 'created' is used to return a ptr to the new post-it.
976  bool loadDot(UT_IStream &is, const char *path = "",
977  bool path_contains_network = true,
978  bool path_contains_packet_ext = true,
980  OP_Dot **created = NULL);
981 
982  // Some special handling for items loaded into a network due to copy/paste
983  // or undo/redo. We need to register these items with an OP_UndoLoad, and
984  // we may want to pick them.
985  void beginPickLoaded(bool pick_loaded);
986  void beginLoadUndo(OP_Node *save_ops[4]);
987  void itemLoaded(OP_NetworkBoxItem *item);
988  void endLoadUndo(OP_Node *save_ops[4]);
989  void endPickLoaded();
990 
991  // Some helper functions for syncContents.
992  bool syncContentsInit(UT_IStream &is,
993  OP_Network *net, OP_Node *node,
994  UT_String &nodeName, OP_Node *&newnode,
995  bool &match_definition_failure,
996  const char *packet_node_path);
997  // Helper method to clear the netboxes/post-its from any subnodes of the
998  // given network whose netboxes may be saved to *this network's contents
999  // section without a preceding .init packet for that subnode.
1000  void syncContentsClearNetboxesFromNonInitSubNodes(OP_Network *net);
1001  // Helper method to clear the contents of any editable subnodes which will
1002  // be loaded from the hip file or a parent asset's contents.
1003  void clearContentsOfEditableSubNodes();
1004  // Helper method to determine if an ancestor is an instance of a particular
1005  // operator currently loading its contents section.
1006  bool isLoadingContentsSection(OP_Operator *op) const;
1007 
1008  void setDoMergeFlag( bool flag ) { myDoMerge = flag; }
1009 
1010  // These functions perform operations that are required after loading
1011  // a number of new operators. Used by loadNetwork and syncContents.
1012  void resolveNetworkBoxOwnership();
1013  void initSpecialNodes(OP_NodeList &loaded_ops);
1014  void initNodeConnectors(OP_NodeList &loaded_ops);
1015  void sendBulkNotifications(const OP_NodeList &loaded_ops,
1016  const OP_NodeList &op_roots,
1017  bool builddependencies,
1018  bool notify_name_dependents);
1019  void fixPendingOverride();
1020 
1021  int savePartialVerify(std::ostream &os);
1022  void createParentInputs();
1023 
1024  // Build a list of item roots from the stream. In English, this means that
1025  // 'item_roots' will be populated with the paths of all items at the top
1026  // level of this load. Initial stream position is unchanged.
1027  bool buildItemRoots(UT_IStream &is, const char *mergePattern,
1028  UT_StringArray &item_roots);
1029 
1030  // Destroys all child nodes except those that appear in the supplied
1031  // list (and their parents). Traverses into writable child nodes too.
1032  // Returns the number of descendants found in nodes.
1033  void destroyAllNodesExcept(const UT_Set<OP_Node *> &nodes);
1034 
1035  // Then after the list is made, we go through and rename the original
1036  // items so there won't be any collisions on loading
1037  void prepareCollisionNames(const OP_NetworkBoxItemList &items,
1038  UT_WorkBuffer &prefix);
1039  // Then, after the load, we go through and rename the items to their
1040  // original status (renaming the collisions along the way)
1041  void fixLoadInputs(); // Resolves references of nodes
1042  void fixLoadNames(const OP_NetworkBoxItemList &items,
1043  UT_WorkBuffer &prefix,
1044  const OP_FixNameParms *fix_name_parms,
1045  UT_StringArray *dest_names);
1046 
1047  int groupCount() const; // Doesn't count internal groups.
1048  OP_ERROR saveGroupList(std::ostream &os, int binary = 0);
1049  bool loadGroupList(UT_IStream &is, const char *path="");
1050  OP_ERROR saveParentInputs(std::ostream &os, int picked= 0);
1051  bool loadParentInputs(UT_IStream &is, const char *path = "");
1052  OP_ERROR saveNetworkData(std::ostream &os, int binary = 0,
1053  int picked= 0);
1054  bool loadNetworkData(UT_IStream &is, const char *path = "");
1055  OP_ERROR saveChildOrder(std::ostream &os, const OP_SaveFlags &flags);
1056  bool loadChildOrder(UT_IStream &is);
1057  OP_ERROR saveCompiledSection(std::ostream &os, int binary = 0,
1058  int picked= 0);
1059  bool loadCompiledSection(UT_IStream &is, const char *path = "");
1060 
1061  // these should surround saving of ops within a network.
1062  void prepareOpSave(std::ostream &os, const OP_SaveFlags &flags,
1063  int &nsaved, int &writeTrailer);
1064  void cleanupOpSave(std::ostream &os, const OP_SaveFlags &flags,
1065  int &nsaved, int &writeTrailer);
1066 
1067  // A helper function for findUniqueGroupName and findUniqueNetworkBoxName
1068  // and findUniqueDotName which takes the "does this item exist" function as
1069  // a parameter
1070  char *findUniqueName(const char *base, OP_FindItemFunc find);
1071 
1072  void changeNodeIdFromLoad(OP_Node &node, int new_id);
1073  void invokeFinishLoadingNetwork(OP_NodeList& op_roots);
1074 
1075  bool verifyParents();
1076  static bool verifyAllParents();
1077 
1078  void setOperatorTable(OP_OperatorTable *table);
1079 
1080  UT_SymbolMap<OP_Node *> mySymbols;
1082  UT_ValArray<OP_Network *> myProxyRefNodes;
1083  UT_ValArray<OP_Node *> mySortedList;
1084  UT_ValArray<OP_SubnetIndirectInput*> myParentInputs;
1085  OP_GroupList myGroups;
1086  OP_NetworkBoxList myNetworkBoxes;
1087  OP_PostItNoteList myPostItNotes;
1088  OP_DotList myDotList;
1089  OP_OperatorTable *myOperatorTable;
1090  OP_Node *myLastLoadedOpPtr;
1091  OP_NetworkBox *myLastLoadedNetworkBox;
1092  OP_PostIt *myLastLoadedPostIt;
1093  OP_Dot *myLastLoadedDot;
1094  OP_Node *myCreatedNode;
1095  UT_SortedSet<int> myEditableSubNodes;
1096  OP_UndoLoad *myUndoLoad;
1097  bool myPickLoaded;
1098 
1099  fpreal myChildScale;
1100  int myDandRCounter;
1101  short myDandROpsEqual;
1102  char myNameSortDirty;
1103  char myOpLoadedFlag;
1104  bool myDoMerge;
1105  UT_StringHolder mySkipBadNodePath;
1106 
1107  int myLastInputChanged;
1108  int myChildManagerCount[NUM_MANAGERS];
1109  int myStashedCurrentNodeId;
1110  bool myIsClearingContentsOfEditableSubnodes;
1111  UT_StringHolder myCachedMimeFile;
1112 
1113  OP_NetworkOperatorFilter myNetworkFilter;
1114 
1115  static bool theWarnDeprecatedOpsOnLoad;
1116 
1117  friend class OP_Director;
1118  friend class MOT_Director;
1119 };
1120 
1122 
1123 /// Safe reference to an OP node
1125 {
1126 public:
1128  OP_NetworkId(const OP_Network *node) { *this = node; }
1129  OP_NetworkId(const OP_NetworkId &id) { myId = id.myId; }
1130 
1131  bool isValid() const
1132  {
1133  const OP_Node *node = OP_Node::lookupNode(myId);
1134  return (node && node->isNetwork());
1135  }
1136 
1138  {
1139  OP_Node *node = OP_Node::lookupNode(myId);
1140  if(node && node->isNetwork())
1141  return static_cast<OP_Network *>(node);
1142  return nullptr;
1143  }
1144  const OP_Network *ptr() const
1145  {
1146  const OP_Node *node = OP_Node::lookupNode(myId);
1147  if(node && node->isNetwork())
1148  return static_cast<const OP_Network *>(node);
1149  return nullptr;
1150  }
1152  {
1153  OP_Node *node = OP_Node::lookupNode(myId);
1154  if(node && node->isNetwork())
1155  return static_cast<OP_Network *>(node);
1156  return nullptr;
1157  }
1158  void clear() { myId = OP_INVALID_NODE_ID; }
1159 
1160  void operator=(const OP_Network *net)
1161  {
1162  myId = net ? net->getUniqueId() : OP_INVALID_NODE_ID;
1163  }
1164  bool operator==(const OP_Network *net) const
1165  {
1166  const int id = net ? net->getUniqueId() : OP_INVALID_NODE_ID;
1167  return id == myId;
1168  }
1169  bool operator!=(const OP_Network *net) const
1170  {
1171  const int id = net ? net->getUniqueId() : OP_INVALID_NODE_ID;
1172  return id != myId;
1173  }
1174  bool operator==(const OP_Node *node) const
1175  {
1176  const int id = node ? node->getUniqueId() : OP_INVALID_NODE_ID;
1177  return id == myId;
1178  }
1179  bool operator!=(const OP_Node *node) const
1180  {
1181  const int id = node ? node->getUniqueId() : OP_INVALID_NODE_ID;
1182  return id != myId;
1183  }
1184  void setId(int id) { myId = id; }
1185 private:
1186  int myId;
1187 };
1188 
1189 #endif
1190 
UT_ValArray< OP_Node * > myOutputNodes
Definition: OP_Network.h:906
virtual bool load(UT_IStream &is, const char *ext="", const char *path=0)
bool isValid() const
Definition: OP_Network.h:1131
int getUniqueId() const
Definition: OP_Node.h:712
virtual bool allowOperatorInTabMenu(OP_Operator *op)
Definition: OP_Network.h:118
OP_TileType
Definition: OP_Network.h:54
GLbitfield flags
Definition: glcorearb.h:1596
UT_String suffixReplaceStr
Definition: OP_Network.h:94
Definition: UT_Set.h:58
virtual void moveProxyRefNodes(OP_Network *)
Definition: OP_Node.h:3403
GT_API const UT_StringHolder filename
myNodes
Definition: UT_RTreeImpl.h:708
virtual void traverseScope(const char *pattern, OP_ScopeOp scope_op, const OP_ScopeOptions &scope_options)
Safe reference to an OP node.
Definition: OP_Network.h:1124
void operator=(const OP_Network *net)
Definition: OP_Network.h:1160
int getNparentInputs() const
Definition: OP_Network.h:661
virtual void clearAndDestroy()
virtual void cloneFromProxyRefNode(OP_Network *proxy)
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
virtual bool canDestroyNode()
Return true if it is safe at this time to destroy this node.
OP_OperatorTable * getOperatorTable() const
Definition: OP_Network.h:648
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
OP_NetworkId(const OP_Network *node)
Definition: OP_Network.h:1128
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual const char * getViewSetting() const
Definition: OP_Network.h:688
void buildOpDependencies() override
OP_Node * createNodeOfExactType(const char *type, const char *name=0)
Convenience method for requesting en exact type.
Definition: OP_Network.h:263
GLint y
Definition: glcorearb.h:103
virtual OP_Network * cloneToProxyRefNode()
virtual void nodeUnlocked()
Definition: OP_Node.h:3538
bool operator!=(const OP_Node *node) const
Definition: OP_Network.h:1179
void setId(int id)
Definition: OP_Network.h:1184
#define OP_INVALID_NODE_ID
Definition: OP_ItemId.h:24
virtual void runDelScript()
bool operator!=(const OP_Network *net) const
Definition: OP_Network.h:1169
fpreal getChildrenScale() const
Definition: OP_Network.h:213
OP_NetworkBoxSaveType
Definition: OP_NetworkBox.h:40
int64 getMemoryUsage(bool inclusive) const override
bool operator==(const OP_Node *node) const
Definition: OP_Network.h:1174
virtual OP_Node * getChild(const char *name, int *hint=0) const
OP_Node * myDisplayNodePtr
Definition: OP_Network.h:905
SIM_API const UT_StringHolder all
virtual bool getAllowSavingChild(OP_Node *node, const OP_SaveFlags &flags)
Returns true if the child at node can should be saved, false otherwise.
Definition: OP_Network.h:914
virtual int propagateModification(OP_Node *by_whom, OP_EventType reason, int parm_index, OP_PropagateData &prop_data)
virtual void globNetworkBoxes(const char *pat, UT_String *expand, UT_ValArray< OP_NetworkBox * > *list=0, OP_GlobContext *glob_context=0, const char *prefix=" ")
void notifyRenameDependents(const UT_String &full_from)
virtual OP_PostIt * findPostItNote(const char *const_path)
Definition: OP_Node.h:858
GA_API const UT_StringHolder scale
virtual ~OP_OperatorFilter()
Definition: OP_Network.h:110
virtual bool allowTool(const char *tool_name)
Definition: OP_Network.h:123
static bool warnDeprecatedOpsOnLoad()
Definition: OP_Network.h:777
virtual int isNetwork() const
int hasProxyRefNodes() const override
Definition: OP_Network.h:824
virtual int getNchildren() const
OP_NetworkId(const OP_NetworkId &id)
Definition: OP_Network.h:1129
virtual void unpinChannels(bool recurse)
UT_SymbolMap< OP_OperatorTable * > OP_OperatorTableMap
Definition: OP_Network.h:50
OP_DotList & getDotList()
Definition: OP_Network.h:569
UT_String prefixReplaceStr
Definition: OP_Network.h:91
virtual OP_Network * createProxyRefNode(const char *path)
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
Definition: CE_Vector.h:130
virtual OP_ERROR getErrorSeverity()
virtual void setViewSetting(const char *)
Definition: OP_Network.h:687
static void setWarnDeprecatedOpsOnLoad(bool enable)
Definition: OP_Network.h:779
void notifyRenameReferences(const UT_String &full_from)
long long int64
Definition: SYS_Types.h:116
GLuint id
Definition: glcorearb.h:655
OP_OpTypeId
Definition: OP_OpTypeId.h:18
GLuint const GLchar * name
Definition: glcorearb.h:786
Definition: OP_Dot.h:24
virtual OP_NetworkBoxItem * findItem(const char *const_path, OP_ItemTypeMask item_type=OP_ITEMTYPE_ALL)
Definition: OP_Node.h:864
GLushort pattern
Definition: glad.h:2583
bool getIsClearingContentsOfEditableSubnodes()
Definition: OP_Network.h:772
virtual void undisplayChannels(bool recurse)
GLint GLenum GLint x
Definition: glcorearb.h:409
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
bool operator==(const OP_Network *net) const
Definition: OP_Network.h:1164
OP_Node * myRenderNodePtr
Definition: OP_Network.h:904
void pickRequest(int shift)
GLdouble t
Definition: glad.h:2397
virtual bool allowOperatorAsChild(OP_Operator *op)
Definition: OP_Network.h:114
int removeTrailingDigits
Definition: OP_Network.h:96
friend class OP_Network
Definition: OP_Node.h:4005
const UT_SortedSet< int > & getEditableSubNodes() const
Definition: OP_Network.h:751
OP_OverwriteAction
Definition: OP_DataTypes.h:121
OP_Network * operator->() const
Definition: OP_Network.h:1151
void pickRequest(int shift)
Definition: OP_Network.h:628
void *(OP_Network::* OP_FindItemFunc)(const char *)
Definition: OP_Network.h:131
virtual void changeParmTemplate(PRM_Template *new_template)
unsigned int OP_ItemTypeMask
Definition: OP_ItemId.h:43
Create an evaluation context scope with a new node.
Definition: OP_Director.h:67
virtual void rebuildOpDependents(bool proxy_only)
virtual bool syncContents(UT_IStream &is)
virtual bool allowToolSubmenus(const UT_StringHolder &tool_name, const UT_StringArray &submenus)
Definition: OP_Network.h:127
virtual void unscopeChannels(bool recurse)
virtual void dumpDependencies(std::ostream &os)
virtual void globPostIts(const char *pat, UT_String *expand, UT_ValArray< OP_PostIt * > *list=0, OP_GlobContext *glob_context=0, const char *prefix=" ")
fpreal64 fpreal
Definition: SYS_Types.h:277
#define OP_API
Definition: OP_API.h:10
GLuint index
Definition: glcorearb.h:786
virtual void getPotentialChildErrorNodes(OP_NodeList &nodes) const
virtual int getDandROpsEqual()
Definition: OP_Node.h:808
OP_EventType
Definition: OP_Value.h:22
virtual void getActiveOperatorsDefinedByOTL(UT_Set< OP_Operator * > &active_operators) const
static OP_Node * lookupNode(int unique_id, bool include_proxy=false)
Definition: OP_Node.h:696
virtual bool getSaveWithVopnets()
void clearUndoFlags() override
virtual int updateDandROpsEqual(int=1)
Definition: OP_Node.h:811
const OP_Network * ptr() const
Definition: OP_Network.h:1144
virtual void inputConnectChanged(int which)
Definition: core.h:1131
virtual bool opShouldHandleChange(OP_EventType reason)
virtual void getAdditionalUndoNodes(const OP_NodeList &orig_list, OP_NodeList &nodes_for_input_undo)
Definition: OP_Network.h:910
virtual void moveDependencies(OP_Node *from_node)
virtual void getRawErrors(UT_Array< UT_Error > &errors, bool update)
virtual OP_SubnetIndirectInput * findParentInput(const char *const_path)
Definition: OP_Node.h:862
OP_ScopeOp
Definition: OP_Parameters.h:58
type
Definition: core.h:1059
virtual OP_NetworkBox * findNetworkBox(const char *name)
Definition: OP_Node.h:856
OP_Network * ptr()
Definition: OP_Network.h:1137
OP_RenameAction
Definition: OP_Network.h:70
UT_String suffixStr
Definition: OP_Network.h:95
OP_API const OP_OperatorTableMap & OPgetGlobalOperatorTables()
void clear()
Definition: OP_Network.h:1158
static const char * theChildTableName
Definition: OP_Network.h:782
virtual void clearUnreferencedInputs()
Definition: OP_PostIt.h:42
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2089
virtual OP_Dot * findDot(const char *const_path)
Definition: OP_Node.h:860
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297
UT_String prefixStr
Definition: OP_Network.h:92