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