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
32 
34 {
35 public:
37  virtual ~SOP_GraphProxy();
38 
39  using NodeIdx = exint;
40 
41  virtual OP_Node *idxToNode(NodeIdx idx) const = 0;
42 
43  // Will only work with direct proxies, as indirect don't have an
44  // index for a node.
45  virtual NodeIdx nodeToIdx(const OP_Node *node) const = 0;
46  virtual UT_StringHolder getFullPath(NodeIdx idx) const = 0;
47  virtual UT_StringHolder getType(NodeIdx idx) const = 0;
48 
49  virtual bool validate(NodeIdx idx) const = 0;
50  virtual const SOP_NodeVerb *cookVerb(NodeIdx idx) const = 0;
51 
52  // Flag accessors
53  virtual bool getBypass(NodeIdx idx) const = 0;
54  virtual bool getHardLock(NodeIdx idx) const = 0;
55  virtual bool getUnload(NodeIdx idx) const = 0;
56 
57  // Topology
58  virtual int nInputs(NodeIdx idx) const = 0;
59  virtual int minInputs(NodeIdx idx) const = 0;
60  virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const = 0;
61  virtual NodeIdx getInputFollowingOutputs(NodeIdx idx, int input, DEP_MicroNode *depnode=0) const = 0;
62  virtual NodeIdx getOutputSop(NodeIdx idx, int output) const = 0;
63  virtual NodeIdx findNode(const UT_StringRef &path) const = 0;
64  virtual NodeIdx getSOPNode(NodeIdx idx, const UT_StringRef &path, bool addref=true) const = 0;
65  virtual bool isPaired(NodeIdx idx, NodeIdx pair) const = 0;
66  virtual int whichOutputIsFollowingIndirect(NodeIdx idx, NodeIdx target, int input_on_target) const = 0;
67  virtual int numSpareInputs(NodeIdx idx) const = 0;
68 
69  virtual NodeIdx getTemplateSOP(NodeIdx idx, fpreal t) const = 0;
70  virtual NodeIdx getFeedbackSOP(NodeIdx idx, fpreal t) const = 0;
71 
72  // Type tests
73  virtual bool isBlockBeginCompile(NodeIdx idx) const = 0;
74  virtual bool isBlockEndCompile(NodeIdx idx) const = 0;
75  virtual bool isBlockBeginFor(NodeIdx idx) const = 0;
76  virtual bool isBlockEndFor(NodeIdx idx) const = 0;
77  virtual bool isInvoke(NodeIdx idx) const = 0;
78  virtual bool isSubNet(NodeIdx idx) const = 0;
79  virtual bool isObjectMerge(NodeIdx idx) const = 0;
80 
81  // Parameter evaluation
82  virtual bool hasParm(NodeIdx node, const char *parmname) const = 0;
83  virtual void evalOpParm(
84  int64 &v, NodeIdx node, const char *parmname, fpreal time,
85  DEP_MicroNode *depnode) const = 0;
86  virtual void evalOpParm(
87  bool &v, NodeIdx node, const char *parmname, fpreal time,
88  DEP_MicroNode *depnode) const = 0;
89  virtual void evalOpParm(
90  fpreal64 &v, NodeIdx node, const char *parmname, fpreal time,
91  DEP_MicroNode *depnode) const = 0;
92  virtual void evalOpParm(
93  UT_Vector2D &v, NodeIdx node, const char *parmname, fpreal time,
94  DEP_MicroNode *depnode) const = 0;
95  virtual void evalOpParm(
96  UT_Vector3D &v, NodeIdx node, const char *parmname, fpreal time,
97  DEP_MicroNode *depnode) const = 0;
98  virtual void evalOpParm(
99  UT_Vector4D &v, NodeIdx node, const char *parmname, fpreal time,
100  DEP_MicroNode *depnode) const = 0;
101 
102  virtual void evalOpParm(
103  UT_Matrix2D &v, NodeIdx node, const char *parmname, fpreal time,
104  DEP_MicroNode *depnode) const = 0;
105  virtual void evalOpParm(
106  UT_Matrix3D &v, NodeIdx node, const char *parmname, fpreal time,
107  DEP_MicroNode *depnode) const = 0;
108  virtual void evalOpParm(
109  UT_Matrix4D &v, NodeIdx node, const char *parmname, fpreal time,
110  DEP_MicroNode *depnode) const = 0;
111 
112  virtual void evalOpParm(
113  UT_Vector2I &v, NodeIdx node, const char *parmname, fpreal time,
114  DEP_MicroNode *depnode) const = 0;
115  virtual void evalOpParm(
116  UT_Vector3I &v, NodeIdx node, const char *parmname, fpreal time,
117  DEP_MicroNode *depnode) const = 0;
118  virtual void evalOpParm(
119  UT_Vector4I &v, NodeIdx node, const char *parmname, fpreal time,
120  DEP_MicroNode *depnode) const = 0;
121  virtual void evalOpParm(
122  UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time,
123  DEP_MicroNode *depnode) const = 0;
124  virtual void evalOpParmRaw(
125  UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time,
126  DEP_MicroNode *depnode) const = 0;
127  virtual void evalOpParm(
128  UT_SharedPtr<UT_Ramp> &v, NodeIdx node, const char *parmname, fpreal time,
129  DEP_MicroNode *depnode) const = 0;
130  virtual void evalOpParm(
131  PRM_DataItemHandle &v, NodeIdx node, const char *parmname, fpreal time,
132  DEP_MicroNode *depnode) const = 0;
133 
134 
135  virtual void evalOpParmInst(
136  int64 &v, NodeIdx node, const char *parmname,
137  int *inst, fpreal time,
138  DEP_MicroNode *depnode) const = 0;
139  virtual void evalOpParmInst(
140  bool &v, NodeIdx node, const char *parmname,
141  int *inst, fpreal time,
142  DEP_MicroNode *depnode) const = 0;
143  virtual void evalOpParmInst(
144  fpreal64 &v, NodeIdx node, const char *parmname,
145  int *inst, fpreal time,
146  DEP_MicroNode *depnode) const = 0;
147  virtual void evalOpParmInst(
148  UT_Vector2D &v, NodeIdx node, const char *parmname,
149  int *inst, fpreal time,
150  DEP_MicroNode *depnode) const = 0;
151  virtual void evalOpParmInst(
152  UT_Vector3D &v, NodeIdx node, const char *parmname,
153  int *inst, fpreal time,
154  DEP_MicroNode *depnode) const = 0;
155  virtual void evalOpParmInst(
156  UT_Vector4D &v, NodeIdx node, const char *parmname,
157  int *inst, fpreal time,
158  DEP_MicroNode *depnode) const = 0;
159 
160  virtual void evalOpParmInst(
161  UT_Matrix2D &v, NodeIdx node, const char *parmname,
162  int *inst, fpreal time,
163  DEP_MicroNode *depnode) const = 0;
164  virtual void evalOpParmInst(
165  UT_Matrix3D &v, NodeIdx node, const char *parmname,
166  int *inst, fpreal time,
167  DEP_MicroNode *depnode) const = 0;
168  virtual void evalOpParmInst(
169  UT_Matrix4D &v, NodeIdx node, const char *parmname,
170  int *inst, fpreal time,
171  DEP_MicroNode *depnode) const = 0;
172 
173  virtual void evalOpParmInst(
174  UT_Vector2I &v, NodeIdx node, const char *parmname,
175  int *inst, fpreal time,
176  DEP_MicroNode *depnode) const = 0;
177  virtual void evalOpParmInst(
178  UT_Vector3I &v, NodeIdx node, const char *parmname,
179  int *inst, fpreal time,
180  DEP_MicroNode *depnode) const = 0;
181  virtual void evalOpParmInst(
182  UT_Vector4I &v, NodeIdx node, const char *parmname,
183  int *inst, fpreal time,
184  DEP_MicroNode *depnode) const = 0;
185 
186  virtual void evalOpParmInst(
187  UT_StringHolder &v, NodeIdx node, const char *parmname,
188  int *inst, fpreal time,
189  DEP_MicroNode *depnode) const = 0;
190  virtual void evalOpParmInst(
191  UT_SharedPtr<UT_Ramp> &v, NodeIdx node, const char *parmname,
192  int *inst, fpreal time,
193  DEP_MicroNode *depnode) const = 0;
194  virtual void evalOpParmInst(
195  PRM_DataItemHandle &v, NodeIdx node, const char *parmname,
196  int *inst, fpreal time,
197  DEP_MicroNode *depnode) const = 0;
198 };
199 
200 
201 
202 #endif
short * getInput(int size) override
GLenum GLenum GLenum input
Definition: glew.h:13879
SOP_API const SOP_GraphProxy * SOPdirectGraphProxy()
GT_API const UT_StringHolder time
GLenum target
Definition: glew.h:2865
int64 exint
Definition: SYS_Types.h:125
SOP_API const SOP_GraphProxy * SOPnewGeoGraphProxy(GU_ConstDetailHandle gdh)
Constructs a new geometry proxy with new semantics.
const GLdouble * v
Definition: glew.h:1391
double fpreal64
Definition: SYS_Types.h:201
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
long long int64
Definition: SYS_Types.h:116
GLsizei const GLchar *const * path
Definition: glew.h:6461
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.
GLdouble GLdouble t
Definition: glew.h:1398
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89