HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_GraphProxy.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_GraphProxy.h ( OP Library, C++)
7  *
8  * COMMENTS:
9  * Allows the idea of a OP_Node network to be abstracted from
10  * actual OP_Node *s.
11  */
12 
13 #ifndef __OP_GraphProxy_h__
14 #define __OP_GraphProxy_h__
15 
16 #include "OP_API.h"
17 #include "OP_Node.h"
18 #include "OP_NodeParms.h"
19 #include <DEP/DEP_TimedMicroNode.h>
20 
22 class OP_GraphProxy;
23 class SOP_NodeVerb;
24 
25 /// Returns singleton proxy for our OP_Director network.
26 /// This uses getUniqueId() as the indices
28 
29 /// Sets the global direct graph proxy, used for registration.
30 OP_API void OPsetDirectGraphProxy(const OP_GraphProxy *proxy);
31 
33 {
34 public:
35  OP_GraphProxy();
36  virtual ~OP_GraphProxy();
37 
38  using NodeIdx = exint;
39 
40  virtual OP_Node *idxToNode(NodeIdx idx) const = 0;
41 
42  // Will only work with direct proxies, as indirect don't have an
43  // index for a node.
44  virtual NodeIdx nodeToIdx(const OP_Node *node) const = 0;
45  virtual UT_StringHolder getFullPath(NodeIdx idx) const = 0;
46  virtual UT_StringHolder getType(NodeIdx idx) const = 0;
47 
48  virtual bool validate(NodeIdx idx) const = 0;
49  virtual const SOP_NodeVerb *cookVerb(NodeIdx idx) const = 0;
50 
51  // Flag accessors
52  virtual bool getBypass(NodeIdx idx) const = 0;
53  virtual bool getHardLock(NodeIdx idx) const = 0;
54  virtual bool getUnload(NodeIdx idx) const = 0;
55 
56  virtual bool getLockedGeometry(NodeIdx idx, GU_ConstDetailHandle *handle) const = 0;
57 
58  // Topology
59  virtual int nInputs(NodeIdx idx) const = 0;
60  virtual int minInputs(NodeIdx idx) const = 0;
61  virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const = 0;
62  virtual NodeIdx getInputFollowingOutputs(NodeIdx idx, int input, DEP_MicroNode *depnode=0) const = 0;
63  virtual NodeIdx getOutputSop(NodeIdx idx, int output) const = 0;
64  virtual NodeIdx findNode(const UT_StringRef &path) const = 0;
65  virtual NodeIdx getSOPNode(NodeIdx idx, const UT_StringRef &path, bool addref=true) const = 0;
66  virtual bool isPaired(NodeIdx idx, NodeIdx pair) const = 0;
67  virtual int whichOutputIsFollowingIndirect(NodeIdx idx, NodeIdx target, int input_on_target) const = 0;
68  virtual int numSpareInputs(NodeIdx idx) const = 0;
69  // Gets the spare input using 0-based number.
70  virtual bool hasSpareInput(NodeIdx idx, int input, fpreal t, DEP_MicroNode *depnode) const = 0;
71  virtual NodeIdx getSpareInput(NodeIdx idx, int input, fpreal t, DEP_MicroNode *depnode) const = 0;
72  // Input number of parm override, in -1 base.
73  virtual int getParmOverrideInput(NodeIdx idx, fpreal time, DEP_MicroNode *depnode) const = 0;
74 
75  virtual NodeIdx getTemplateSOP(NodeIdx idx, fpreal t) const = 0;
76  virtual NodeIdx getFeedbackSOP(NodeIdx idx, fpreal t) const = 0;
77 
78  // Type tests
79  virtual bool isBlockBeginCompile(NodeIdx idx) const = 0;
80  virtual bool isBlockEndCompile(NodeIdx idx) const = 0;
81  virtual bool isBlockBeginFor(NodeIdx idx) const = 0;
82  virtual bool isBlockEndFor(NodeIdx idx) const = 0;
83  virtual bool isInvoke(NodeIdx idx) const = 0;
84  virtual bool isSubNet(NodeIdx idx) const = 0;
85  virtual bool isObjectMerge(NodeIdx idx) const = 0;
86 
87  // Parameter evaluation
88  virtual bool hasParm(NodeIdx node, const char *parmname) const = 0;
89  virtual void evalOpParm(
90  int64 &v, NodeIdx node, const char *parmname, fpreal time,
91  DEP_MicroNode *depnode) const = 0;
92  virtual void evalOpParm(
93  bool &v, NodeIdx node, const char *parmname, fpreal time,
94  DEP_MicroNode *depnode) const = 0;
95  virtual void evalOpParm(
96  fpreal64 &v, NodeIdx node, const char *parmname, fpreal time,
97  DEP_MicroNode *depnode) const = 0;
98  virtual void evalOpParm(
99  UT_Vector2D &v, NodeIdx node, const char *parmname, fpreal time,
100  DEP_MicroNode *depnode) const = 0;
101  virtual void evalOpParm(
102  UT_Vector3D &v, NodeIdx node, const char *parmname, fpreal time,
103  DEP_MicroNode *depnode) const = 0;
104  virtual void evalOpParm(
105  UT_Vector4D &v, NodeIdx node, const char *parmname, fpreal time,
106  DEP_MicroNode *depnode) const = 0;
107 
108  virtual void evalOpParm(
109  UT_Matrix2D &v, NodeIdx node, const char *parmname, fpreal time,
110  DEP_MicroNode *depnode) const = 0;
111  virtual void evalOpParm(
112  UT_Matrix3D &v, NodeIdx node, const char *parmname, fpreal time,
113  DEP_MicroNode *depnode) const = 0;
114  virtual void evalOpParm(
115  UT_Matrix4D &v, NodeIdx node, const char *parmname, fpreal time,
116  DEP_MicroNode *depnode) const = 0;
117 
118  virtual void evalOpParm(
119  UT_Vector2I &v, NodeIdx node, const char *parmname, fpreal time,
120  DEP_MicroNode *depnode) const = 0;
121  virtual void evalOpParm(
122  UT_Vector3I &v, NodeIdx node, const char *parmname, fpreal time,
123  DEP_MicroNode *depnode) const = 0;
124  virtual void evalOpParm(
125  UT_Vector4I &v, NodeIdx node, const char *parmname, fpreal time,
126  DEP_MicroNode *depnode) const = 0;
127  virtual void evalOpParm(
128  UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time,
129  DEP_MicroNode *depnode) const = 0;
130  virtual void evalOpParmRaw(
131  UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time,
132  DEP_MicroNode *depnode) const = 0;
133  virtual void evalOpParm(
134  UT_SharedPtr<UT_Ramp> &v, NodeIdx node, const char *parmname, fpreal time,
135  DEP_MicroNode *depnode) const = 0;
136  virtual void evalOpParm(
137  PRM_DataItemHandle &v, NodeIdx node, const char *parmname, fpreal time,
138  DEP_MicroNode *depnode) const = 0;
139 
140  virtual void evalOpParmInst(
141  int64 &v, NodeIdx node, const char *parmname,
142  const int *inst, const int *offsets, fpreal time,
143  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
144  virtual void evalOpParmInst(
145  bool &v, NodeIdx node, const char *parmname,
146  const int *inst, const int *offsets, fpreal time,
147  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
148  virtual void evalOpParmInst(
149  fpreal64 &v, NodeIdx node, const char *parmname,
150  const int *inst, const int *offsets, fpreal time,
151  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
152  virtual void evalOpParmInst(
153  UT_Vector2D &v, NodeIdx node, const char *parmname,
154  const int *inst, const int *offsets, fpreal time,
155  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
156  virtual void evalOpParmInst(
157  UT_Vector3D &v, NodeIdx node, const char *parmname,
158  const int *inst, const int *offsets, fpreal time,
159  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
160  virtual void evalOpParmInst(
161  UT_Vector4D &v, NodeIdx node, const char *parmname,
162  const int *inst, const int *offsets, fpreal time,
163  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
164 
165  virtual void evalOpParmInst(
166  UT_Matrix2D &v, NodeIdx node, const char *parmname,
167  const int *inst, const int *offsets, fpreal time,
168  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
169  virtual void evalOpParmInst(
170  UT_Matrix3D &v, NodeIdx node, const char *parmname,
171  const int *inst, const int *offsets, fpreal time,
172  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
173  virtual void evalOpParmInst(
174  UT_Matrix4D &v, NodeIdx node, const char *parmname,
175  const int *inst, const int *offsets, fpreal time,
176  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
177 
178  virtual void evalOpParmInst(
179  UT_Vector2I &v, NodeIdx node, const char *parmname,
180  const int *inst, const int *offsets, fpreal time,
181  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
182  virtual void evalOpParmInst(
183  UT_Vector3I &v, NodeIdx node, const char *parmname,
184  const int *inst, const int *offsets, fpreal time,
185  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
186  virtual void evalOpParmInst(
187  UT_Vector4I &v, NodeIdx node, const char *parmname,
188  const int *inst, const int *offsets, fpreal time,
189  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
190 
191  virtual void evalOpParmInst(
192  UT_StringHolder &v, NodeIdx node, const char *parmname,
193  const int *inst, const int *offsets, fpreal time,
194  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
195  virtual void evalOpParmInst(
196  UT_SharedPtr<UT_Ramp> &v, NodeIdx node, const char *parmname,
197  const int *inst, const int *offsets, fpreal time,
198  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
199  virtual void evalOpParmInst(
200  PRM_DataItemHandle &v, NodeIdx node, const char *parmname,
201  const int *inst, const int *offsets, fpreal time,
202  DEP_MicroNode *depnode, int nestlevel=1) const = 0;
203 };
204 
205 
206 
207 #endif
short * getInput(int size) override
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int64 exint
Definition: SYS_Types.h:125
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
double fpreal64
Definition: SYS_Types.h:201
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
long long int64
Definition: SYS_Types.h:116
GLenum target
Definition: glcorearb.h:1667
GLdouble t
Definition: glad.h:2397
fpreal64 fpreal
Definition: SYS_Types.h:277
#define OP_API
Definition: OP_API.h:10
OP_API const OP_GraphProxy * OPdirectGraphProxy()
OP_API void OPsetDirectGraphProxy(const OP_GraphProxy *proxy)
Sets the global direct graph proxy, used for registration.
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97