HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_GraphProxyDirect.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_GraphProxyDirect.h (OP Library, C++)
7  *
8  * COMMENTS:
9  * An implementation of a graph proxy, to be subclassed and
10  * further implemented depending on the node class. This is
11  * a direct graph proxy meaning that it deals with nodes.
12  */
13 
14 #include "OP_GraphProxy.h"
15 #include <DEP/DEP_TimedMicroNode.h>
16 
17 //
18 // Graph Proxy Direct, this ties directly to the normal OP_Director
19 // node network
20 //
21 
22 // Implements everything except for getLockedGeometry, isPaired, getSpareInput
23 // and all the is<NodeType>
24 // because there are no real default cases that make sense for them,
25 // as each separate OP would likely have its own version of these functions
26 
28 {
29 public:
31 
33  ~OP_GraphProxyDirect() override {}
34 
35  bool isDirect() const override { return true; }
36  OP_Node *idxToNode(NodeIdx idx) const override;
37 
38  NodeIdx nodeToIdx(const OP_Node *node) const override;
39  UT_StringHolder getFullPath(NodeIdx idx) const override;
40  UT_StringHolder getType(NodeIdx idx) const override;
41 
42  // Micronode accessors
43  DEP_MicroNode *getEventMicroNode(NodeIdx idx, OP_EventType e) const override;
44  DEP_MicroNode *getFlagMicroNode(NodeIdx idx) const override;
45 
46  bool validate(NodeIdx idx) const override;
47  const SOP_NodeVerb *cookVerb(NodeIdx idx) const override;
48 
49  // COP specific accessors
50  // Gets the type of the ports for the cop node
51  // defaults to returning COP_Type::COP_TYPE_UNDEF and nullptr
52  int getCOPSignatureCount(NodeIdx idx) const override;
53  int getCOPInputCableSize(NodeIdx idx, OP_InputIdx input) const override;
54  int getCOPOutputCableSize(NodeIdx idx, OP_OutputIdx output) const override;
55  int getCOPNodeInputType(NodeIdx idx, OP_InputIdx input_port_idx, int sig_idx) const override;
56  int getCOPNodeOutputType(NodeIdx idx, OP_OutputIdx output_port_idx, int sig_idx) const override;
57  bool isCOPOutputNull(NodeIdx idx, OP_OutputIdx output_port_idx, int sig_idx) const override;
58  DEP_MicroNode *getCOPSignatureMicroNode(NodeIdx idx) const override;
59  const COP_Verb *getCOPVerb(NodeIdx idx) const override;
60  int getCOPNumInputs(NodeIdx idx) const override;
61  int getCOPNumOutputs(NodeIdx idx) const override;
62  bool getCOPAlwaysBypass(NodeIdx idx) const override;
63  void getCOPInputName(NodeIdx idx, UT_String& name, OP_InputIdx input_idx) const override;
64  NodeIdx getCOPSubNetOutputNode(NodeIdx idx) const override;
65  bool addCOPSignatureError(NodeIdx idx, UT_ErrorManager& error) const override;
66  COP_NodeOutputPort getCOPBypassPort(NodeIdx idx, UT_ErrorManager& error, DEP_MicroNode* dep, OP_OutputIdx port_index, int sig_index) const override;
67  COP_NodeOutputPort getCOPOutputPortFromInput(NodeIdx idx, OP_InputIdx input, int sig_index, bool markused) const override;
68 
69  // Flags
70  bool getBypass(NodeIdx idx) const override;
71  bool getHardLock(NodeIdx idx) const override;
72  bool getUnload(NodeIdx idx) const override;
73 
74  // Topology
75  int nInputs(NodeIdx idx) const override;
76  int minInputs(NodeIdx idx) const override;
77  NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused) const override;
78  NodeIdx getInputFollowingOutputs(NodeIdx idx, OP_InputIdx input, DEP_MicroNode *depnode=0) const override;
79  NodeIdx getOutputSop(NodeIdx idx, OP_OutputIdx output) const override;
80  NodeIdx findNode(const UT_StringRef &path) const override;
81  NodeIdx findRelativeNode(NodeIdx cwd, const UT_StringRef &path) const override;
82  NodeIdx getSOPNode(NodeIdx idx, const UT_StringRef &path, bool addref=true) const override;
83 
84  OP_OutputIdx whichOutputIsFollowingIndirect(NodeIdx idx, NodeIdx targetidx, OP_InputIdx input_on_target) const override;
85  int numSpareInputs(NodeIdx idx) const override;
86 
87  NodeIdx getParentNode(NodeIdx idx) const override;
88  void getPathWithSubnet(NodeIdx idx, UT_String &str) const override;
89 
90  bool hasSpareInput(NodeIdx idx, int input, fpreal t, DEP_MicroNode *depnode) const override;
91  int getParmOverrideInput(NodeIdx idx, fpreal time, DEP_MicroNode *depnode) const override;
92 
93  NodeIdx getTemplateSOP(NodeIdx idx, fpreal t) const override;
94  NodeIdx getFeedbackSOP(NodeIdx idx, fpreal t) const override;
95 
96  bool hasParm(NodeIdx noderef, const char *parmname) const override;
97 
98 #define CREATE_EVALOP(TYPE) \
99  void evalOpParm( \
100  TYPE &v, NodeIdx noderef, const char *parmname, fpreal time, \
101  DEP_MicroNode *depnode) const override; \
102  void evalOpParmInst( \
103  TYPE &v, NodeIdx noderef, const char *parmname, \
104  const int *inst, const int * /*offsets*/, fpreal time, \
105  DEP_MicroNode *depnode, int nestlevel) const override; \
106 /**/
108  CREATE_EVALOP(bool);
122 #undef CREATE_EVALOP
123 
124  void evalOpParmRaw(
125  UT_StringHolder &v, NodeIdx noderef, const char *parmname, fpreal time,
126  DEP_MicroNode *depnode) const override;
127 };
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
virtual NodeIdx getParentNode(NodeIdx idx) const =0
virtual NodeIdx findNode(const UT_StringRef &path) const =0
virtual UT_StringHolder getType(NodeIdx idx) const =0
virtual COP_NodeOutputPort getCOPOutputPortFromInput(NodeIdx idx, OP_InputIdx input, int sig_index, bool markused=false) const =0
virtual NodeIdx getCOPSubNetOutputNode(NodeIdx idx) const =0
virtual const COP_Verb * getCOPVerb(NodeIdx idx) const =0
virtual NodeIdx getOutputSop(NodeIdx idx, OP_OutputIdx output) const =0
virtual bool validate(NodeIdx idx) const =0
virtual int getCOPNodeOutputType(NodeIdx idx, OP_OutputIdx output_port_idx, int sig_idx) const =0
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int OP_InputIdx
Definition: OP_DataTypes.h:184
virtual OP_OutputIdx whichOutputIsFollowingIndirect(NodeIdx idx, NodeIdx target, OP_InputIdx input_on_target) const =0
virtual void evalOpParmRaw(UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
virtual bool getHardLock(NodeIdx idx) const =0
bool isDirect() const override
Direct proxies mirror actual nodes:
virtual int getCOPOutputCableSize(NodeIdx idx, OP_OutputIdx output) const =0
virtual bool hasParm(NodeIdx node, const char *parmname) const =0
virtual DEP_MicroNode * getCOPSignatureMicroNode(NodeIdx idx) const =0
virtual NodeIdx nodeToIdx(const OP_Node *node) const =0
virtual COP_NodeOutputPort getCOPBypassPort(NodeIdx idx, UT_ErrorManager &error, DEP_MicroNode *dep, OP_OutputIdx port_index, int sig_index) const =0
< returns > If no error
Definition: snippets.dox:2
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
virtual void getPathWithSubnet(NodeIdx idx, UT_String &str) const =0
virtual int getCOPNumOutputs(NodeIdx idx) const =0
virtual bool hasSpareInput(NodeIdx idx, int input, fpreal t, DEP_MicroNode *depnode) const =0
virtual void getCOPInputName(NodeIdx idx, UT_String &name, OP_InputIdx input_idx) const =0
virtual int getCOPNodeInputType(NodeIdx idx, OP_InputIdx input_port_idx, int sig_idx) const =0
virtual int getCOPNumInputs(NodeIdx idx) const =0
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
virtual DEP_MicroNode * getEventMicroNode(NodeIdx idx, OP_EventType e) const =0
virtual bool isCOPOutputNull(NodeIdx idx, OP_OutputIdx output_port_idx, int sig_idx) const =0
virtual NodeIdx getTemplateSOP(NodeIdx idx, fpreal t) const =0
virtual int getCOPSignatureCount(NodeIdx idx) const =0
long long int64
Definition: SYS_Types.h:116
virtual int getParmOverrideInput(NodeIdx idx, fpreal time, DEP_MicroNode *depnode) const =0
virtual int numSpareInputs(NodeIdx idx) const =0
virtual bool addCOPSignatureError(NodeIdx idx, UT_ErrorManager &error) const =0
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual int getCOPInputCableSize(NodeIdx idx, OP_InputIdx input) const =0
GLdouble t
Definition: glad.h:2397
virtual int nInputs(NodeIdx idx) const =0
#define CREATE_EVALOP(TYPE)
virtual bool getBypass(NodeIdx idx) const =0
virtual NodeIdx getInputFollowingOutputs(NodeIdx idx, OP_InputIdx input, DEP_MicroNode *depnode=0) const =0
fpreal64 fpreal
Definition: SYS_Types.h:283
virtual NodeIdx getSOPNode(NodeIdx idx, const UT_StringRef &path, bool addref=true) const =0
#define OP_API
Definition: OP_API.h:10
virtual DEP_MicroNode * getFlagMicroNode(NodeIdx idx) const =0
OP_EventType
Definition: OP_Value.h:22
A global error manager scope.
int OP_OutputIdx
Definition: OP_DataTypes.h:185
virtual NodeIdx findRelativeNode(NodeIdx cwd, const UT_StringRef &path) const =0
virtual bool getCOPAlwaysBypass(NodeIdx idx) const =0
virtual const SOP_NodeVerb * cookVerb(NodeIdx idx) const =0
virtual UT_StringHolder getFullPath(NodeIdx idx) const =0
virtual int minInputs(NodeIdx idx) const =0
virtual bool getUnload(NodeIdx idx) const =0
virtual NodeIdx getFeedbackSOP(NodeIdx idx, fpreal t) const =0
virtual OP_Node * idxToNode(NodeIdx idx) const =0