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=
nullptr)
const override;
163 virtual int getChildIndex(
const OP_Node *)
const;
177 virtual void moveChildIndex(
int srcindex,
int dstindex);
183 virtual const char *getChildType()
const;
196 int getOpsByName(
const char *op_name,
200 void stashCurrentNodePtr(
const OP_Node *child);
201 OP_Node * getStashedCurrentNodePtr()
const;
203 virtual OP_Node *getCurrentNodePtr();
204 virtual OP_Node *getDisplayNodePtr();
205 virtual OP_Node *getRenderNodePtr();
206 virtual OP_Node *getExportNodePtr();
208 virtual OP_Node *getCop3DNodePtr();
211 virtual void childDeleted(
OP_Node *);
212 virtual void childFlagChange(
OP_Node *);
261 const char *
name =
nullptr,
264 int loadcontents = 1,
265 int *aliased_scripted_op =
nullptr,
266 char *mat_icon_filename =
nullptr,
267 bool exact_type =
false);
271 const char *
name =
nullptr)
273 return createNode(type,
name, 1, 1, 1,
nullptr,
290 const char *toname =
nullptr,
291 bool reference_parameters =
false);
298 bool reference_parameters,
299 bool relative_references,
300 bool connect_outputs_to_multi_inputs);
304 void copyPickedItems(
319 const char *toname =
nullptr,
320 bool reference_parameters =
false);
325 const char *toname =
nullptr);
329 void copyPickedNodes(
const OP_Network *srcnet,
337 virtual bool movePickedNodes(
OP_Network *src_net,
344 int destroyNode(
OP_Node *node);
347 virtual int renameNode(
OP_Node *node,
const char *
name,
352 OP_Network *findOrCreateMotionEffectsNetwork(
bool create=
true);
361 OP_Node *deleteImplicitAncestors(
363 const char *
state =
nullptr,
365 bool included =
true);
372 const char *
state =
nullptr,
374 bool included =
true);
390 virtual int isInvalidName(
const char *
name);
392 static void fixName(
const char *
name,
405 OP_ERROR savePickedItems(std::ostream &os,
414 OP_ERROR saveAllItems(std::ostream &os,
429 std::set<int>* renaming_exclude_ids =
nullptr,
437 OP_ERROR saveSingleNetworkBox(std::ostream &os,
454 OP_ERROR saveOpList(std::ostream &os,
457 int *nsaved =
nullptr);
460 OP_ERROR saveItemList(std::ostream &os,
464 const char *getClipboardFile(
const char *file_prefix =
nullptr);
472 const char *file_prefix =
nullptr);
474 bool turn_off_display =
false,
475 const char *file_prefix =
nullptr);
539 char *findUniqueGroupName(
const char *basename=
nullptr);
542 int destroyGroup(
const char *
name);
545 int getNgroups()
const;
546 OP_Group *getGroup(
int index)
const;
548 int getMemberships(
const OP_Node *node,
552 char *findUniqueNetworkBoxName(
const char *base =
nullptr);
553 char *findUniquePostItNoteName(
const char *base =
nullptr);
554 char *findUniqueDotName(
const char *base =
nullptr);
561 int getNnetworkBoxes()
const;
571 int getNpostItNotes()
const;
576 OP_PostIt *getPostItNote(
int index)
const;
581 {
return myDotList; }
582 int getNdots()
const;
585 OP_Dot *getDot(
int index)
const;
592 bool include_hidden_nodes)
const;
599 bool include_hidden =
false,
600 bool recurse_picked_netboxes =
false)
const;
627 bool isSubNode(
const OP_Node *node)
const;
642 void addPicked(
const OP_Group *group);
643 void subPicked(
const OP_Group *group);
658 const char *script_path=
nullptr);
660 {
return myOperatorTable; }
661 virtual const char *getScriptDirectory();
669 bool wantsParentInputs()
const;
673 {
return myParentInputs.entries(); }
687 void getAllConnectedChildren(
689 bool expand_subnets =
true)
const;
690 void getAllConnectedChildrenNamed(
693 bool expand_subnets =
true)
const;
711 void clearDelScripts(
int picked_only);
736 const char *prefix =
" ")
override;
742 const char *prefix =
" ")
override;
747 int getRepresentativeNodeId(
OP_Node *changed_child,
753 bool changeChildNodeType(
OP_Node *child,
759 int *new_child_id =
nullptr);
763 bool getIsSubNodeEditable(
const OP_Node *subnode)
const;
764 bool hasAnyEditableSubNodes()
const;
766 {
return myEditableSubNodes; }
780 static void saveOTLBackupInformation(std::ostream &os,
784 static void saveFallbacksPathsFor(
791 {
return myIsClearingContentsOfEditableSubnodes; }
796 {
return theWarnDeprecatedOpsOnLoad; }
798 { theWarnDeprecatedOpsOnLoad = enable; }
800 void setCachedMimeFile(
const char *
filename);
801 const char *getCachedMimeFile()
const;
802 void clearCachedMimeFile();
803 bool hasCachedMimeFile()
const;
807 bool update)
override;
815 void clearAndDestroyNodes();
841 {
return myProxyRefNodes.entries() > 0; }
849 const char *ext =
"",
850 const char *
path =
nullptr)
override;
853 virtual void beginLoadingInNetwork();
854 virtual void endLoadingInNetwork();
857 virtual void finishedLoadingChildOrder();
862 virtual void finishedLoadingNetwork(
bool is_child_call=
false);
867 static int syncContentsLevel();
881 virtual void addNode(
OP_Node *node,
int notify=1,
int explicitly=1);
887 void resetDisplayNodePtr(
OP_Node *skipthisnode=
nullptr);
889 void resetRenderNodePtr(
OP_Node *skipthisnode=
nullptr);
891 void resetAudioNodePtr(
OP_Node *skipthisnode=
nullptr);
895 void validateStatusNodePtrs(
const OP_NodeList &skipnodes);
897 virtual void updateExtraFlagPtrs();
902 virtual void destroySingleNode(
OP_Node *node);
907 void modifyAllChildNodeNames(
bool renamepickableobjects,
908 const char *prefix,
int &
id,
909 std::set<int>* renaming_exclude_ids =
nullptr);
941 const char *path_prefix,
bool vopnets);
943 const char *path_prefix,
bool vopnets,
944 bool force_no_init =
false);
947 const OP_SaveFlags &childflags,
const char *path_prefix,
948 bool vopnets,
bool force_no_init =
false,
952 const char *path_prefix);
958 op_PathSet &noneditable_missing_table);
962 const char *path_prefix);
964 const char *path_prefix);
966 const char *path_prefix);
974 bool path_contains_network =
true,
975 bool path_contains_packet_ext =
true,
985 bool path_contains_network =
true,
986 bool path_contains_packet_ext =
true,
996 bool path_contains_network =
true,
997 bool path_contains_packet_ext =
true,
999 OP_Dot **created =
nullptr);
1004 void beginPickLoaded(
bool pick_loaded);
1005 void beginLoadUndo(
OP_Node *save_ops[4]);
1007 void endLoadUndo(
OP_Node *save_ops[4]);
1008 void endPickLoaded();
1014 bool &match_definition_failure,
1015 const char *packet_node_path);
1019 void syncContentsClearNetboxesFromNonInitSubNodes(
OP_Network *net);
1022 void clearContentsOfEditableSubNodes();
1025 bool isLoadingContentsSection(
OP_Operator *op)
const;
1027 void setDoMergeFlag(
bool flag ) { myDoMerge = flag; }
1031 void resolveNetworkBoxOwnership();
1034 void sendBulkNotifications(
const OP_NodeList &loaded_ops,
1036 bool builddependencies,
1037 bool notify_name_dependents);
1038 void fixPendingOverride();
1040 int savePartialVerify(std::ostream &os);
1041 void createParentInputs();
1046 bool buildItemRoots(
UT_IStream &is,
const char *merge_pattern,
1060 void fixLoadInputs();
1066 int groupCount()
const;
1069 OP_ERROR saveParentInputs(std::ostream &os,
int picked= 0);
1081 void prepareOpSave(std::ostream &os,
const OP_SaveFlags &flags,
1082 int &nsaved,
int &write_trailer);
1083 void cleanupOpSave(std::ostream &os,
const OP_SaveFlags &flags,
1084 int &nsaved,
int &write_trailer);
1091 void changeNodeIdFromLoad(
OP_Node &node,
int new_id);
1092 void invokeFinishLoadingNetwork(
OP_NodeList& op_roots);
1094 bool verifyParents();
1095 static bool verifyAllParents();
1115 OP_UndoLoad *myUndoLoad;
1120 short myDandROpsEqual;
1121 char myNameSortDirty;
1122 char myOpLoadedFlag;
1128 int myStashedCurrentNodeId;
1129 bool myIsClearingContentsOfEditableSubnodes;
1134 static bool theWarnDeprecatedOpsOnLoad;
1160 return static_cast<OP_Network *>(node);
1167 return static_cast<const OP_Network *>(node);
1174 return static_cast<OP_Network *>(node);
UT_ValArray< OP_Node * > myOutputNodes
virtual bool allowOperatorInTabMenu(OP_Operator *op)
UT_String suffixReplaceStr
virtual void moveProxyRefNodes(OP_Network *)
virtual void globNetworkBoxes(const char *pat, UT_String *expand, UT_ValArray< OP_NetworkBox * > *list=nullptr, OP_GlobContext *glob_context=nullptr, const char *prefix=" ")
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 OP_Node * getChild(const char *name, int *hint=nullptr) const
GLsizei const GLfloat * value
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
virtual bool load(UT_IStream &is, const char *ext="", const char *path=nullptr)
void buildOpDependencies() override
virtual OP_Network * cloneToProxyRefNode()
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
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
virtual void inputConnectChanged(OP_InputIdx which)
bool operator==(const OP_Node *node) 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)
void notifyRenameDependents(const UT_String &full_from)
virtual OP_PostIt * findPostItNote(const char *const_path)
virtual void globPostIts(const char *pat, UT_String *expand, UT_ValArray< OP_PostIt * > *list=nullptr, OP_GlobContext *glob_context=nullptr, const char *prefix=" ")
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
GLint GLint GLsizei GLint GLenum GLenum type
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)
OP_Node * createNodeOfExactType(const char *type, const char *name=nullptr)
Convenience method for requesting en exact type.
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 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 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()
OP_Node * myExportNodePtr
virtual OP_Dot * findDot(const char *const_path)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter