12 #ifndef __OP_Utils_h__
13 #define __OP_Utils_h__
35 bool checktoplevelnode,
38 bool checktoplevelnode,
61 const char *context_name);
68 bool include_me =
true);
70 bool include_me =
true);
110 static inline void evalOpParm(
115 v = node->
evalInt(parmname, 0, time);
117 static inline void evalOpParm(
118 bool &v,
const OP_Node *node,
const char *parmname,
fpreal time,
122 v = node->
evalInt(parmname, 0, time);
124 static inline void evalOpParm(
131 static inline void evalOpParm(
140 static inline void evalOpParm(
151 static inline void evalOpParm(
165 static inline void evalOpParm(
168 {
for (
int r = 0;
r < 2;
r++)
170 for (
int c = 0;
c < 2;
c++)
177 static inline void evalOpParm(
180 {
for (
int r = 0;
r < 3;
r++)
182 for (
int c = 0;
c < 3;
c++)
189 static inline void evalOpParm(
192 {
for (
int r = 0;
r < 4;
r++)
194 for (
int c = 0;
c < 4;
c++)
202 static void inline evalOpParm(
208 v.
x() = node->
evalInt(parmname, 0, time);
209 v.
y() = node->
evalInt(parmname, 1, time);
211 static void inline evalOpParm(
218 v.
x() = node->
evalInt(parmname, 0, time);
219 v.
y() = node->
evalInt(parmname, 1, time);
220 v.
z() = node->
evalInt(parmname, 2, time);
222 static void inline evalOpParm(
230 v.
x() = node->
evalInt(parmname, 0, time);
231 v.
y() = node->
evalInt(parmname, 1, time);
232 v.
z() = node->
evalInt(parmname, 2, time);
233 v.
w() = node->
evalInt(parmname, 3, time);
235 static void inline evalOpParm(
242 static void inline evalOpParmRaw(
249 static void inline evalOpParm(
258 static void inline evalOpParm(
263 v = node->
evalData(parmname, 0, time);
267 static void inline evalOpParmInst(
269 const int *inst,
fpreal time,
274 v = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
276 static void inline evalOpParmInst(
277 bool &v,
const OP_Node *node,
const char *parmname,
278 const int *inst,
fpreal time,
283 v = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
285 static void inline evalOpParmInst(
287 const int *inst,
fpreal time,
294 static void inline evalOpParmInst(
296 const int *inst,
fpreal time,
305 static void inline evalOpParmInst(
307 const int *inst,
fpreal time,
318 static void inline evalOpParmInst(
320 const int *inst,
fpreal time,
334 static void inline evalOpParmInst(
336 const int *inst,
fpreal time,
339 {
for (
int r = 0;
r < 2;
r++)
341 for (
int c = 0;
c < 2;
c++)
348 static void inline evalOpParmInst(
350 const int *inst,
fpreal time,
353 {
for (
int r = 0;
r < 3;
r++)
355 for (
int c = 0;
c < 3;
c++)
362 static void inline evalOpParmInst(
364 const int *inst,
fpreal time,
367 {
for (
int r = 0;
r < 4;
r++)
369 for (
int c = 0;
c < 4;
c++)
377 static void inline evalOpParmInst(
379 const int *inst,
fpreal time,
385 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
386 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
388 static void inline evalOpParmInst(
390 const int *inst,
fpreal time,
397 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
398 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
399 v.
z() = node->
evalIntInst(parmname, inst, 2, time, nestlevel);
401 static void inline evalOpParmInst(
403 const int *inst,
fpreal time,
411 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
412 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
413 v.
z() = node->
evalIntInst(parmname, inst, 2, time, nestlevel);
414 v.
w() = node->
evalIntInst(parmname, inst, 3, time, nestlevel);
417 static void inline evalOpParmInst(
419 const int *inst,
fpreal time,
426 static void inline evalOpParmInst(
428 const int *inst,
fpreal time,
438 static void inline evalOpParmInst(
440 const int *inst,
fpreal time,
445 v = node->
evalDataInst(parmname, inst, 0, time, nestlevel);
464 virtual void onNotifyOPPythonResult(
PY_Result const &
result,
char const * script_source,
char const * script_path) = 0;
void adoptFromString(UT_String &str)
OP_API void OPmarkRootNodes(UT_BitArray &roots, const OP_NodeList &nodes, bool assume_picked)
OP_API bool OPconvertOrWarnExternalReferences(OP_Node *node, bool checktoplevelnode, UT_WorkBuffer &err)
OP_API OP_Node * OPfindOpInput(OP_Node *op, const char *find_op_type, bool include_me=true)
OP_API void OPaddVopSubnetMask(const UT_StringRef &name)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void addExplicitInput(DEP_MicroNode &inp, bool check_dup)
Methods for manipulating explicit edges.
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
constexpr SYS_FORCE_INLINE T & z() noexcept
fpreal evalFloat(int pi, int vi, fpreal t) const
**But if you need a result
OP_API bool OPconvertOrWarnExternalOverrides(OP_Node *node, bool checktoplevelnode, UT_WorkBuffer &err)
constexpr SYS_FORCE_INLINE T & x() noexcept
OP_API bool OPisStandInShaderParm(const PRM_Template &parm)
constexpr SYS_FORCE_INLINE T & x() noexcept
PRM_Parm & getParm(int i)
OP_API bool OPmatchesShaderContextTag(const PRM_Template &parm, const char *context_name)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
void evalString(UT_String &val, int pi, int vi, fpreal t) const
OP_API void OPgetVopSubnetMask(OP_Node *node, UT_String &vopnetmask)
PRM_DataItemHandle evalDataInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
OP_API void OPtopologicalSort(UT_IntArray &order, const OP_NodeList &nodes, const UT_BitArray *roots=nullptr)
GLdouble GLdouble GLint GLint order
OP_API bool OPhasShaderContextTag(const PRM_Template *list, int start=0, int end=-1)
OP_API bool OPisPotentialShaderParm(const PRM_Template &parm)
OP_API void notifyPythonResultClients(PY_Result const &result, char const *script_source, char const *script_path)
fpreal evalFloatInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
GLuint const GLchar * name
PRM_DataItemHandle evalData(int pi, int vi, fpreal t) const
OP_API bool OPcheckForVopnetDefinedNodes(OP_Node *node, UT_WorkBuffer &err)
void evalStringRaw(UT_String &val, int pi, int vi, fpreal t) const
OP_API void OPcreateStickyNoteAboutCachedCode(OP_Network *subnet)
void evalStringInst(const UT_StringRef &name, const int *inst, UT_String &val, int vi, fpreal t, int nestlevel=1) const
OP_API bool OPisLegacyShaderParm(const PRM_Template &parm, OP_Node *owner)
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
OP_API void OPwarnBadRefs(UT_WorkBuffer &msg, const UT_StringArray &badrefs)
UT_WeakPtr< PythonResultClient > WPtr
void updateRampFromMultiParm(fpreal t, const PRM_Parm &m, UT_Ramp &ramp, bool *time_dep=NULL, DEP_MicroNode *depnode=NULL) const
OP_API void registerPythonResultClient(PythonResultClient::WPtr result_client)
exint evalInt(int pi, int vi, fpreal t) const
exint evalIntInst(const UT_StringRef &name, const int *inst, int vi, fpreal t, int nestlevel=1) const
GLdouble GLdouble GLdouble y2
PRM_Parm * getParmPtrInst(const UT_StringRef &parm_name, const int *instance, int nest_level)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE PRM_ParmList * getParmList()
OP_API void OPgetItemBounds(fpreal &x1, fpreal &y1, fpreal &x2, fpreal &y2, const OP_NetworkBoxItemList &items)
OP_API bool OPcheckForVopnetsUsedOutside(OP_Node *node, OP_NodeList *badvopnets)
std::weak_ptr< T > UT_WeakPtr
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
bool hasParm(const UT_StringRef &name) const
constexpr SYS_FORCE_INLINE T & x() noexcept