12 #ifndef __OP_Network_h__
13 #define __OP_Network_h__
40 class OP_ProxyRefNode;
116 virtual bool allowTool(
const char *tool_name) {
return true; }
124 static const char *getScriptFromTable(
const char *
table);
125 static const char *getOpTypeFromTable(
const char *table);
130 int *hint=0)
const override;
132 virtual int getChildIndex(
const OP_Node *)
const;
147 virtual void moveChildIndex(
int srcindex,
int dstindex);
153 virtual const char *getChildType()
const;
166 int getOpsByName(
const char *op_name,
172 void stashCurrentNodePtr(
const OP_Node *child);
173 OP_Node * getStashedCurrentNodePtr()
const;
175 virtual OP_Node *getDisplayNodePtr();
176 virtual OP_Node *getRenderNodePtr();
180 virtual void childDeleted(
OP_Node *);
181 virtual void childFlagChange(
OP_Node *);
201 virtual bool isOperatorAllowedInTabMenu(
OP_Operator *op);
204 bool isToolAllowed(
const char *tool_name);
225 int notify = 1,
int explicitly = 1,
226 int loadcontents = 1,
227 int *aliasedScriptedOp = 0,
228 char *matIconFilename = 0,
229 bool exact_type =
false);
233 const char *
name = 0)
235 return createNode(type,
name, 1, 1, 1, 0, 0,
true);
251 const char *toname = NULL,
252 bool reference_parameters =
false);
259 bool reference_parameters,
260 bool relative_references,
261 bool connect_outputs_to_multi_inputs);
265 void copyPickedItems(
280 const char *toname = NULL,
281 bool reference_parameters =
false);
286 const char *toname = 0);
290 void copyPickedNodes(
const OP_Network *srcnet,
298 virtual bool movePickedNodes(
OP_Network *src_net,
305 int destroyNode(
OP_Node *node);
308 virtual int renameNode(
OP_Node *node,
const char *
name,
313 OP_Network *findOrCreateMotionEffectsNetwork(
bool create=
true);
323 const char *state = 0,
OP_Node *keep_node = 0,
324 bool included =
true);
331 const char *state = 0,
OP_Node *keep_node = 0,
332 bool included =
true);
348 virtual int isInvalidName(
const char *
name);
350 static void fixName(
const char *
name,
363 OP_ERROR savePickedItems(std::ostream &os,
372 OP_ERROR saveAllItems(std::ostream &os,
387 std::set<int>* renaming_exclude_ids = NULL,
395 OP_ERROR saveSingleNetworkBox(std::ostream &os,
412 OP_ERROR saveOpList(std::ostream &os,
418 OP_ERROR saveItemList(std::ostream &os,
422 const char *getClipboardFile(
const char *file_prefix = 0);
430 const char *file_prefix = 0);
432 bool turn_off_display =
false,
433 const char *file_prefix = 0);
486 char *findUniqueGroupName(
const char *basename=0);
489 int destroyGroup(
const char *
name);
492 int getNgroups()
const;
493 OP_Group *getGroup(
int index)
const;
495 int getMemberships(
const OP_Node *node,
499 char *findUniqueNetworkBoxName(
const char *base = NULL);
500 char *findUniquePostItNoteName(
const char *base = NULL);
501 char *findUniqueDotName(
const char *base = NULL);
508 int getNnetworkBoxes()
const;
518 int getNpostItNotes()
const;
523 OP_PostIt *getPostItNote(
int index)
const;
528 {
return myDotList; }
529 int getNdots()
const;
532 OP_Dot *getDot(
int index)
const;
539 bool include_hidden_nodes)
const;
546 bool include_hidden =
false,
547 bool recurse_picked_netboxes =
false)
const;
574 bool isSubNode(
const OP_Node *node)
const;
605 const char *script_path=0);
607 {
return myOperatorTable; }
608 virtual const char *getScriptDirectory();
616 bool wantsParentInputs()
const;
620 {
return myParentInputs.entries(); }
634 void getAllConnectedChildren(
636 bool expandSubnets =
true)
const;
637 void getAllConnectedChildrenNamed(
640 bool expandSubnets =
true)
const;
658 void clearDelScripts(
int pickedOnly);
681 const char *prefix =
" ")
override;
686 const char *prefix =
" ")
override;
690 const char *path_prefix);
692 const char *path_prefix);
694 const char *path_prefix);
702 bool path_contains_network =
true,
703 bool path_contains_packet_ext =
true,
712 bool path_contains_network =
true,
713 bool path_contains_packet_ext =
true,
714 int overwrite = 0,
OP_PostIt **created = NULL);
722 bool path_contains_network =
true,
723 bool path_contains_packet_ext =
true,
724 int overwrite = 0,
OP_Dot **created = NULL);
729 int getRepresentativeNodeId(
OP_Node *changed_child,
735 bool changeChildNodeType(
OP_Node *child,
741 int *newChildId=NULL);
745 bool getIsSubNodeEditable(
const OP_Node *subnode)
const;
746 bool hasAnyEditableSubNodes()
const;
760 static void saveOTLBackupInformation(std::ostream &os,
767 {
return myIsClearingContentsOfEditableSubnodes; }
772 {
return theWarnDeprecatedOpsOnLoad; }
774 { theWarnDeprecatedOpsOnLoad =
enable; }
778 void setCachedMimeFile(
const char *
filename);
779 const char *getCachedMimeFile()
const;
780 void clearCachedMimeFile();
781 bool hasCachedMimeFile()
const;
785 bool update)
override;
793 void clearAndDestroyNodes();
819 {
return myProxyRefNodes.entries() > 0; }
827 const char *
path = 0)
override;
830 virtual void beginLoadingInNetwork();
831 virtual void endLoadingInNetwork();
834 virtual void finishedLoadingChildOrder();
839 virtual void finishedLoadingNetwork(
bool is_child_call=
false);
852 virtual void addNode(
OP_Node *node,
int notify=1,
int explicitly=1);
858 void resetDisplayNodePtr(
OP_Node *skipthisnode=0);
860 void resetRenderNodePtr(
OP_Node *skipthisnode=0);
862 void resetAudioNodePtr(
OP_Node *skipthisnode=0);
866 void validateStatusNodePtrs(
const OP_NodeList &skipnodes);
868 virtual void updateExtraFlagPtrs();
873 virtual void destroySingleNode(
OP_Node *node);
878 void modifyAllChildNodeNames(
bool renamepickableobjects,
879 const char *prefix,
int &
id,
880 std::set<int>* renaming_exclude_ids = NULL);
910 const char *pathPrefix,
bool vopnets);
912 const char *pathPrefix,
bool vopnets,
913 bool forceNoInit =
false);
917 bool vopnets,
bool forceNoInit =
false,
921 const char *pathPrefix);
925 op_PathSet &noneditable_missing_table);
930 void beginPickLoaded(
bool pick_loaded);
931 void beginLoadUndo(
OP_Node *save_ops[4]);
933 void endLoadUndo(
OP_Node *save_ops[4]);
934 void endPickLoaded();
940 bool &match_definition_failure,
941 const char *packet_node_path);
945 void syncContentsClearNetboxesFromNonInitSubNodes(
OP_Network *net);
948 void clearContentsOfEditableSubNodes();
951 bool isLoadingContentsSection(
OP_Operator *op)
const;
953 void setDoMergeFlag(
bool flag ) { myDoMerge = flag; }
957 void resolveNetworkBoxOwnership();
960 void sendBulkNotifications(
const OP_NodeList &loaded_ops,
962 bool builddependencies,
963 bool notify_name_dependents);
964 void fixPendingOverride();
966 int savePartialVerify(std::ostream &os);
967 void createParentInputs();
972 bool buildItemRoots(
UT_IStream &is,
const char *mergePattern,
986 void fixLoadInputs();
992 int groupCount()
const;
995 OP_ERROR saveParentInputs(std::ostream &os,
int picked= 0);
1007 void prepareOpSave(std::ostream &os,
const OP_SaveFlags &flags,
1008 int &nsaved,
int &writeTrailer);
1009 void cleanupOpSave(std::ostream &os,
const OP_SaveFlags &flags,
1010 int &nsaved,
int &writeTrailer);
1017 void changeNodeIdFromLoad(
OP_Node &node,
int new_id);
1018 void invokeFinishLoadingNetwork(
OP_NodeList& op_roots);
1020 bool verifyParents();
1021 static bool verifyAllParents();
1041 OP_UndoLoad *myUndoLoad;
1046 short myDandROpsEqual;
1047 char myNameSortDirty;
1048 char myOpLoadedFlag;
1052 int myLastInputChanged;
1054 int myStashedCurrentNodeId;
1055 bool myIsClearingContentsOfEditableSubnodes;
1058 static bool theWarnDeprecatedOpsOnLoad;
UT_ValArray< OP_Node * > myOutputNodes
virtual bool load(UT_IStream &is, const char *ext="", const char *path=0)
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)
GLuint const GLchar * name
int getNparentInputs() const
virtual void clearAndDestroy()
virtual void cloneFromProxyRefNode(OP_Network *proxy)
virtual bool canDestroyNode()
Return true if it is safe at this time to destroy this node.
OP_OperatorTable * getOperatorTable() const
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLsizei GLenum GLenum const void * table
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
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()
virtual void runDelScript()
fpreal getChildrenScale() const
int64 getMemoryUsage(bool inclusive) const override
virtual OP_Node * getChild(const char *name, int *hint=0) const
OP_Node * myDisplayNodePtr
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)
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 GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
virtual void unpinChannels(bool recurse)
UT_SymbolMap< OP_OperatorTable * > OP_OperatorTableMap
OP_DotList & getDotList()
UT_String prefixReplaceStr
virtual OP_Network * createProxyRefNode(const char *path)
const GLuint GLenum const void * binary
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
virtual OP_ERROR getErrorSeverity()
virtual void setViewSetting(const char *)
GLuint const GLuint * names
static void setWarnDeprecatedOpsOnLoad(bool enable)
void notifyRenameReferences(const UT_String &full_from)
virtual OP_NetworkBoxItem * findItem(const char *const_path, OP_ItemTypeMask item_type=OP_ITEMTYPE_ALL)
bool getIsClearingContentsOfEditableSubnodes()
virtual void undisplayChannels(bool recurse)
GLuint GLuint GLsizei GLenum type
OP_Node * myRenderNodePtr
void pickRequest(int shift)
GLsizei const GLchar *const * path
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 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
FMT_CONSTEXPR bool find(Ptr first, Ptr last, T value, Ptr &out)
virtual int getDandROpsEqual()
OIIO_API bool copy(string_view from, string_view to, std::string &err)
virtual bool allowOperatorAsChild(OP_Operator *)
virtual void getActiveOperatorsDefinedByOTL(UT_Set< OP_Operator * > &active_operators) const
virtual bool getSaveWithVopnets()
void clearUndoFlags() override
virtual int updateDandROpsEqual(int=1)
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)
bool all(const vbool4 &v)
GLsizei const GLfloat * value
virtual OP_NetworkBox * findNetworkBox(const char *name)
OP_API const OP_OperatorTableMap & OPgetGlobalOperatorTables()
static const char * theChildTableName
virtual void clearUnreferencedInputs()
virtual OP_Dot * findDot(const char *const_path)