12 #ifndef __OP_Network_h__
13 #define __OP_Network_h__
42 class OP_ProxyRefNode;
119 {
return allowOperatorAsChild(op); }
123 virtual bool allowTool(
const char *tool_name) {
return true; }
155 static const char *getScriptFromTable(
const char *
table);
156 static const char *getOpTypeFromTable(
const char *table);
161 int *hint=0)
const override;
163 virtual int getChildIndex(
const OP_Node *)
const;
178 virtual void moveChildIndex(
int srcindex,
int dstindex);
184 virtual const char *getChildType()
const;
197 int getOpsByName(
const char *op_name,
201 void stashCurrentNodePtr(
const OP_Node *child);
202 OP_Node * getStashedCurrentNodePtr()
const;
204 virtual OP_Node *getCurrentNodePtr();
205 virtual OP_Node *getDisplayNodePtr();
206 virtual OP_Node *getRenderNodePtr();
210 virtual void childDeleted(
OP_Node *);
211 virtual void childFlagChange(
OP_Node *);
231 virtual bool isOperatorAllowedInTabMenu(
OP_Operator *op);
259 int notify = 1,
int explicitly = 1,
260 int loadcontents = 1,
261 int *aliasedScriptedOp = 0,
262 char *matIconFilename = 0,
263 bool exact_type =
false);
267 const char *
name = 0)
269 return createNode(type,
name, 1, 1, 1, 0, 0,
true);
285 const char *toname = NULL,
286 bool reference_parameters =
false);
293 bool reference_parameters,
294 bool relative_references,
295 bool connect_outputs_to_multi_inputs);
299 void copyPickedItems(
314 const char *toname = NULL,
315 bool reference_parameters =
false);
320 const char *toname = 0);
324 void copyPickedNodes(
const OP_Network *srcnet,
332 virtual bool movePickedNodes(
OP_Network *src_net,
339 int destroyNode(
OP_Node *node);
342 virtual int renameNode(
OP_Node *node,
const char *
name,
347 OP_Network *findOrCreateMotionEffectsNetwork(
bool create=
true);
357 const char *state = 0,
OP_Node *keep_node = 0,
358 bool included =
true);
365 const char *state = 0,
OP_Node *keep_node = 0,
366 bool included =
true);
382 virtual int isInvalidName(
const char *
name);
384 static void fixName(
const char *
name,
397 OP_ERROR savePickedItems(std::ostream &os,
406 OP_ERROR saveAllItems(std::ostream &os,
421 std::set<int>* renaming_exclude_ids = NULL,
429 OP_ERROR saveSingleNetworkBox(std::ostream &os,
446 OP_ERROR saveOpList(std::ostream &os,
452 OP_ERROR saveItemList(std::ostream &os,
456 const char *getClipboardFile(
const char *file_prefix = 0);
464 const char *file_prefix = 0);
466 bool turn_off_display =
false,
467 const char *file_prefix = 0);
531 char *findUniqueGroupName(
const char *basename=0);
534 int destroyGroup(
const char *
name);
537 int getNgroups()
const;
538 OP_Group *getGroup(
int index)
const;
540 int getMemberships(
const OP_Node *node,
544 char *findUniqueNetworkBoxName(
const char *base = NULL);
545 char *findUniquePostItNoteName(
const char *base = NULL);
546 char *findUniqueDotName(
const char *base = NULL);
553 int getNnetworkBoxes()
const;
563 int getNpostItNotes()
const;
568 OP_PostIt *getPostItNote(
int index)
const;
573 {
return myDotList; }
574 int getNdots()
const;
577 OP_Dot *getDot(
int index)
const;
584 bool include_hidden_nodes)
const;
591 bool include_hidden =
false,
592 bool recurse_picked_netboxes =
false)
const;
619 bool isSubNode(
const OP_Node *node)
const;
634 void addPicked(
const OP_Group *group);
635 void subPicked(
const OP_Group *group);
650 const char *script_path=0);
652 {
return myOperatorTable; }
653 virtual const char *getScriptDirectory();
661 bool wantsParentInputs()
const;
665 {
return myParentInputs.entries(); }
679 void getAllConnectedChildren(
681 bool expandSubnets =
true)
const;
682 void getAllConnectedChildrenNamed(
685 bool expandSubnets =
true)
const;
703 void clearDelScripts(
int pickedOnly);
726 const char *prefix =
" ")
override;
731 const char *prefix =
" ")
override;
736 int getRepresentativeNodeId(
OP_Node *changed_child,
742 bool changeChildNodeType(
OP_Node *child,
748 int *newChildId=NULL);
752 bool getIsSubNodeEditable(
const OP_Node *subnode)
const;
753 bool hasAnyEditableSubNodes()
const;
755 {
return myEditableSubNodes; }
769 static void saveOTLBackupInformation(std::ostream &os,
778 {
return myIsClearingContentsOfEditableSubnodes; }
783 {
return theWarnDeprecatedOpsOnLoad; }
785 { theWarnDeprecatedOpsOnLoad = enable; }
787 void setCachedMimeFile(
const char *
filename);
788 const char *getCachedMimeFile()
const;
789 void clearCachedMimeFile();
790 bool hasCachedMimeFile()
const;
794 bool update)
override;
802 void clearAndDestroyNodes();
828 {
return myProxyRefNodes.entries() > 0; }
836 const char *
path = 0)
override;
839 virtual void beginLoadingInNetwork();
840 virtual void endLoadingInNetwork();
843 virtual void finishedLoadingChildOrder();
848 virtual void finishedLoadingNetwork(
bool is_child_call=
false);
853 static int syncContentsLevel();
867 virtual void addNode(
OP_Node *node,
int notify=1,
int explicitly=1);
873 void resetDisplayNodePtr(
OP_Node *skipthisnode=0);
875 void resetRenderNodePtr(
OP_Node *skipthisnode=0);
877 void resetAudioNodePtr(
OP_Node *skipthisnode=0);
881 void validateStatusNodePtrs(
const OP_NodeList &skipnodes);
883 virtual void updateExtraFlagPtrs();
888 virtual void destroySingleNode(
OP_Node *node);
893 void modifyAllChildNodeNames(
bool renamepickableobjects,
894 const char *prefix,
int &
id,
895 std::set<int>* renaming_exclude_ids = NULL);
925 const char *pathPrefix,
bool vopnets);
927 const char *pathPrefix,
bool vopnets,
928 bool forceNoInit =
false);
932 bool vopnets,
bool forceNoInit =
false,
936 const char *pathPrefix);
942 op_PathSet &noneditable_missing_table);
946 const char *path_prefix);
948 const char *path_prefix);
950 const char *path_prefix);
958 bool path_contains_network =
true,
959 bool path_contains_packet_ext =
true,
969 bool path_contains_network =
true,
970 bool path_contains_packet_ext =
true,
980 bool path_contains_network =
true,
981 bool path_contains_packet_ext =
true,
988 void beginPickLoaded(
bool pick_loaded);
989 void beginLoadUndo(
OP_Node *save_ops[4]);
991 void endLoadUndo(
OP_Node *save_ops[4]);
992 void endPickLoaded();
998 bool &match_definition_failure,
999 const char *packet_node_path);
1003 void syncContentsClearNetboxesFromNonInitSubNodes(
OP_Network *net);
1006 void clearContentsOfEditableSubNodes();
1009 bool isLoadingContentsSection(
OP_Operator *op)
const;
1011 void setDoMergeFlag(
bool flag ) { myDoMerge = flag; }
1015 void resolveNetworkBoxOwnership();
1018 void sendBulkNotifications(
const OP_NodeList &loaded_ops,
1020 bool builddependencies,
1021 bool notify_name_dependents);
1022 void fixPendingOverride();
1024 int savePartialVerify(std::ostream &os);
1025 void createParentInputs();
1030 bool buildItemRoots(
UT_IStream &is,
const char *mergePattern,
1044 void fixLoadInputs();
1050 int groupCount()
const;
1053 OP_ERROR saveParentInputs(std::ostream &os,
int picked= 0);
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);
1075 void changeNodeIdFromLoad(
OP_Node &node,
int new_id);
1076 void invokeFinishLoadingNetwork(
OP_NodeList& op_roots);
1078 bool verifyParents();
1079 static bool verifyAllParents();
1099 OP_UndoLoad *myUndoLoad;
1104 short myDandROpsEqual;
1105 char myNameSortDirty;
1106 char myOpLoadedFlag;
1110 int myLastInputChanged;
1112 int myStashedCurrentNodeId;
1113 bool myIsClearingContentsOfEditableSubnodes;
1118 static bool theWarnDeprecatedOpsOnLoad;
1144 return static_cast<OP_Network *>(node);
1151 return static_cast<const OP_Network *>(node);
1158 return static_cast<OP_Network *>(node);
UT_ValArray< OP_Node * > myOutputNodes
virtual bool load(UT_IStream &is, const char *ext="", const char *path=0)
virtual bool allowOperatorInTabMenu(OP_Operator *op)
UT_String suffixReplaceStr
virtual void moveProxyRefNodes(OP_Network *)
GT_API const UT_StringHolder filename
virtual void traverseScope(const char *pattern, OP_ScopeOp scope_op, const OP_ScopeOptions &scope_options)
Safe reference to an OP node.
void operator=(const OP_Network *net)
int getNparentInputs() const
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
const GLuint GLenum const void * binary
GLsizei const GLchar *const * path
OP_NetworkId(const OP_Network *node)
virtual const char * getViewSetting() const
void buildOpDependencies() override
OP_Node * createNodeOfExactType(const char *type, const char *name=0)
Convenience method for requesting en exact type.
virtual OP_Network * cloneToProxyRefNode()
virtual void nodeUnlocked()
bool operator!=(const OP_Node *node) const
#define OP_INVALID_NODE_ID
virtual void runDelScript()
bool operator!=(const OP_Network *net) const
fpreal getChildrenScale() const
int64 getMemoryUsage(bool inclusive) const override
bool operator==(const OP_Node *node) const
virtual OP_Node * getChild(const char *name, int *hint=0) const
OP_Node * myDisplayNodePtr
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.
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)
GA_API const UT_StringHolder scale
virtual ~OP_OperatorFilter()
virtual bool allowTool(const char *tool_name)
static bool warnDeprecatedOpsOnLoad()
virtual int isNetwork() const
int hasProxyRefNodes() const override
virtual int getNchildren() const
OP_NetworkId(const OP_NetworkId &id)
virtual void unpinChannels(bool recurse)
UT_SymbolMap< OP_OperatorTable * > OP_OperatorTableMap
OP_DotList & getDotList()
UT_String prefixReplaceStr
virtual OP_Network * createProxyRefNode(const char *path)
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
virtual OP_ERROR getErrorSeverity()
virtual void setViewSetting(const char *)
static void setWarnDeprecatedOpsOnLoad(bool enable)
void notifyRenameReferences(const UT_String &full_from)
GLuint const GLchar * name
virtual OP_NetworkBoxItem * findItem(const char *const_path, OP_ItemTypeMask item_type=OP_ITEMTYPE_ALL)
bool getIsClearingContentsOfEditableSubnodes()
virtual void undisplayChannels(bool recurse)
GLenum GLenum GLsizei void * table
bool operator==(const OP_Network *net) const
OP_Node * myRenderNodePtr
void pickRequest(int shift)
virtual bool allowOperatorAsChild(OP_Operator *op)
const UT_SortedSet< int > & getEditableSubNodes() const
OP_Network * operator->() const
void pickRequest(int shift)
void *(OP_Network::* OP_FindItemFunc)(const char *)
virtual void changeParmTemplate(PRM_Template *new_template)
unsigned int OP_ItemTypeMask
Create an evaluation context scope with a new node.
virtual void rebuildOpDependents(bool proxy_only)
virtual bool syncContents(UT_IStream &is)
virtual bool allowToolSubmenus(const UT_StringHolder &tool_name, const UT_StringArray &submenus)
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=" ")
virtual void getPotentialChildErrorNodes(OP_NodeList &nodes) const
virtual int getDandROpsEqual()
virtual void getActiveOperatorsDefinedByOTL(UT_Set< OP_Operator * > &active_operators) const
static OP_Node * lookupNode(int unique_id, bool include_proxy=false)
virtual bool getSaveWithVopnets()
void clearUndoFlags() override
virtual int updateDandROpsEqual(int=1)
const OP_Network * ptr() const
virtual void inputConnectChanged(int which)
virtual bool opShouldHandleChange(OP_EventType reason)
virtual void getAdditionalUndoNodes(const OP_NodeList &orig_list, OP_NodeList &nodes_for_input_undo)
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)
virtual OP_NetworkBox * findNetworkBox(const char *name)
OP_API const OP_OperatorTableMap & OPgetGlobalOperatorTables()
virtual void clearUnreferencedInputs()
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
virtual OP_Dot * findDot(const char *const_path)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter