12 #ifndef __OP_Utils_h__
13 #define __OP_Utils_h__
36 bool checktoplevelnode,
39 bool checktoplevelnode,
62 const char *context_name);
73 bool print_when_non_graphical =
true);
76 bool include_me =
true);
78 bool include_me =
true);
118 static inline void evalOpParm(
123 v = node->
evalInt(parmname, 0, time);
125 static inline void evalOpParm(
126 bool &v,
const OP_Node *node,
const char *parmname,
fpreal time,
130 v = node->
evalInt(parmname, 0, time);
132 static inline void evalOpParm(
139 static inline void evalOpParm(
148 static inline void evalOpParm(
159 static inline void evalOpParm(
173 static inline void evalOpParm(
176 {
for (
int r = 0;
r < 2;
r++)
178 for (
int c = 0;
c < 2;
c++)
185 static inline void evalOpParm(
188 {
for (
int r = 0;
r < 3;
r++)
190 for (
int c = 0;
c < 3;
c++)
197 static inline void evalOpParm(
200 {
for (
int r = 0;
r < 4;
r++)
202 for (
int c = 0;
c < 4;
c++)
210 static void inline evalOpParm(
216 v.
x() = node->
evalInt(parmname, 0, time);
217 v.
y() = node->
evalInt(parmname, 1, time);
219 static void inline evalOpParm(
226 v.
x() = node->
evalInt(parmname, 0, time);
227 v.
y() = node->
evalInt(parmname, 1, time);
228 v.
z() = node->
evalInt(parmname, 2, time);
230 static void inline evalOpParm(
238 v.
x() = node->
evalInt(parmname, 0, time);
239 v.
y() = node->
evalInt(parmname, 1, time);
240 v.
z() = node->
evalInt(parmname, 2, time);
241 v.
w() = node->
evalInt(parmname, 3, time);
243 static void inline evalOpParm(
250 static void inline evalOpParmRaw(
257 static void inline evalOpParm(
266 static void inline evalOpParm(
271 v = node->
evalData(parmname, 0, time);
275 static void inline evalOpParmInst(
277 const int *inst,
fpreal time,
282 v = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
284 static void inline evalOpParmInst(
285 bool &v,
const OP_Node *node,
const char *parmname,
286 const int *inst,
fpreal time,
291 v = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
293 static void inline evalOpParmInst(
295 const int *inst,
fpreal time,
302 static void inline evalOpParmInst(
304 const int *inst,
fpreal time,
313 static void inline evalOpParmInst(
315 const int *inst,
fpreal time,
326 static void inline evalOpParmInst(
328 const int *inst,
fpreal time,
342 static void inline evalOpParmInst(
344 const int *inst,
fpreal time,
347 {
for (
int r = 0;
r < 2;
r++)
349 for (
int c = 0;
c < 2;
c++)
356 static void inline evalOpParmInst(
358 const int *inst,
fpreal time,
361 {
for (
int r = 0;
r < 3;
r++)
363 for (
int c = 0;
c < 3;
c++)
370 static void inline evalOpParmInst(
372 const int *inst,
fpreal time,
375 {
for (
int r = 0;
r < 4;
r++)
377 for (
int c = 0;
c < 4;
c++)
385 static void inline evalOpParmInst(
387 const int *inst,
fpreal time,
393 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
394 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
396 static void inline evalOpParmInst(
398 const int *inst,
fpreal time,
405 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
406 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
407 v.
z() = node->
evalIntInst(parmname, inst, 2, time, nestlevel);
409 static void inline evalOpParmInst(
411 const int *inst,
fpreal time,
419 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
420 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
421 v.
z() = node->
evalIntInst(parmname, inst, 2, time, nestlevel);
422 v.
w() = node->
evalIntInst(parmname, inst, 3, time, nestlevel);
425 static void inline evalOpParmInst(
427 const int *inst,
fpreal time,
434 static void inline evalOpParmInst(
436 const int *inst,
fpreal time,
446 static void inline evalOpParmInst(
448 const int *inst,
fpreal time,
453 v = node->
evalDataInst(parmname, inst, 0, time, nestlevel);
472 virtual void onNotifyOPPythonResult(
PY_Result const &
result,
char const * script_source,
char const * script_path) = 0;
489 template <
typename FN,
typename T>
499 fn(
false, owner, pn);
510 fn(
false, owner, pn);
518 if (newop==
op && newparm==parm && newvecidx==vi)
520 fn(
false, owner, pn);
525 T *newowner = (
T*)newop;
526 fn(
true, newowner, newpn);
GLuint GLsizei const GLchar * message
void adoptFromString(UT_String &str)
OP_API void OPmarkRootNodes(UT_BitArray &roots, const OP_NodeList &nodes, bool assume_picked)
PRM_Parm * getParmPtr(const UT_StringRef &theparmname, int &theparmidx)
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
void getChannelToken(UT_String &thestrref, int index=0) const
**But if you need a result
OP_API void OPdisplayUIMessage(const char *message, UT_ErrorSeverity severity=UT_ERROR_MESSAGE, bool print_when_non_graphical=true)
bool OPfollowChannelRefFn(const OP_FollowChanRefsOptions &opt, T *owner, const UT_StringHolder &pn, FN &&fn)
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
static void followChannelReferences(const OP_FollowChanRefsOptions &opt, OP_Node *&newop, PRM_Parm *&newparm, int &newvecidx)
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)
__hostdev__ constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Utility class for containing a color ramp.
void updateRampFromMultiParm(fpreal t, const PRM_Parm &m, UT_Ramp &ramp, bool *time_dep=nullptr, DEP_MicroNode *depnode=nullptr) const
constexpr SYS_FORCE_INLINE T & w() noexcept
OP_API void OPwarnBadRefs(UT_WorkBuffer &msg, const UT_StringArray &badrefs)
UT_WeakPtr< PythonResultClient > WPtr
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
int getParmIndex(const PRM_Parm *parm) 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
constexpr SYS_FORCE_INLINE T & y() noexcept
bool hasParm(const UT_StringRef &name) const
constexpr SYS_FORCE_INLINE T & x() noexcept