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