12 #ifndef __OP_Utils_h__
13 #define __OP_Utils_h__
36 bool checktoplevelnode,
39 bool checktoplevelnode,
62 const char *context_name);
67 bool check_time_dependent =
true);
75 bool print_when_non_graphical =
true);
78 bool include_me =
true);
80 bool include_me =
true);
122 const char *parm_token,
126 const char *parm_token,
130 const char *parm_token);
135 static inline void evalOpParm(
140 v = node->
evalInt(parmname, 0, time);
142 static inline void evalOpParm(
143 bool &v,
const OP_Node *node,
const char *parmname,
fpreal time,
147 v = node->
evalInt(parmname, 0, time);
149 static inline void evalOpParm(
156 static inline void evalOpParm(
165 static inline void evalOpParm(
176 static inline void evalOpParm(
190 static inline void evalOpParm(
193 {
for (
int r = 0;
r < 2;
r++)
195 for (
int c = 0;
c < 2;
c++)
202 static inline void evalOpParm(
205 {
for (
int r = 0;
r < 3;
r++)
207 for (
int c = 0;
c < 3;
c++)
214 static inline void evalOpParm(
217 {
for (
int r = 0;
r < 4;
r++)
219 for (
int c = 0;
c < 4;
c++)
227 static void inline evalOpParm(
233 v.
x() = node->
evalInt(parmname, 0, time);
234 v.
y() = node->
evalInt(parmname, 1, time);
236 static void inline evalOpParm(
243 v.
x() = node->
evalInt(parmname, 0, time);
244 v.
y() = node->
evalInt(parmname, 1, time);
245 v.
z() = node->
evalInt(parmname, 2, time);
247 static void inline evalOpParm(
255 v.
x() = node->
evalInt(parmname, 0, time);
256 v.
y() = node->
evalInt(parmname, 1, time);
257 v.
z() = node->
evalInt(parmname, 2, time);
258 v.
w() = node->
evalInt(parmname, 3, time);
260 static void inline evalOpParm(
267 static void inline evalOpParmRaw(
274 static void inline evalOpParm(
283 static void inline evalOpParm(
288 v = node->
evalData(parmname, 0, time);
292 static void inline evalOpParmInst(
294 const int *inst,
fpreal time,
299 v = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
301 static void inline evalOpParmInst(
302 bool &v,
const OP_Node *node,
const char *parmname,
303 const int *inst,
fpreal time,
308 v = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
310 static void inline evalOpParmInst(
312 const int *inst,
fpreal time,
319 static void inline evalOpParmInst(
321 const int *inst,
fpreal time,
330 static void inline evalOpParmInst(
332 const int *inst,
fpreal time,
343 static void inline evalOpParmInst(
345 const int *inst,
fpreal time,
359 static void inline evalOpParmInst(
361 const int *inst,
fpreal time,
364 {
for (
int r = 0;
r < 2;
r++)
366 for (
int c = 0;
c < 2;
c++)
373 static void inline evalOpParmInst(
375 const int *inst,
fpreal time,
378 {
for (
int r = 0;
r < 3;
r++)
380 for (
int c = 0;
c < 3;
c++)
387 static void inline evalOpParmInst(
389 const int *inst,
fpreal time,
392 {
for (
int r = 0;
r < 4;
r++)
394 for (
int c = 0;
c < 4;
c++)
402 static void inline evalOpParmInst(
404 const int *inst,
fpreal time,
410 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
411 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
413 static void inline evalOpParmInst(
415 const int *inst,
fpreal time,
422 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
423 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
424 v.
z() = node->
evalIntInst(parmname, inst, 2, time, nestlevel);
426 static void inline evalOpParmInst(
428 const int *inst,
fpreal time,
436 v.
x() = node->
evalIntInst(parmname, inst, 0, time, nestlevel);
437 v.
y() = node->
evalIntInst(parmname, inst, 1, time, nestlevel);
438 v.
z() = node->
evalIntInst(parmname, inst, 2, time, nestlevel);
439 v.
w() = node->
evalIntInst(parmname, inst, 3, time, nestlevel);
442 static void inline evalOpParmInst(
444 const int *inst,
fpreal time,
451 static void inline evalOpParmInst(
453 const int *inst,
fpreal time,
463 static void inline evalOpParmInst(
465 const int *inst,
fpreal time,
470 v = node->
evalDataInst(parmname, inst, 0, time, nestlevel);
489 virtual void onNotifyOPPythonResult(
PY_Result const &
result,
char const * script_source,
char const * script_path) = 0;
506 template <
typename FN,
typename T>
516 fn(
false, owner, pn);
527 fn(
false, owner, pn);
535 if (newop==
op && newparm==parm && newvecidx==vi)
537 fn(
false, owner, pn);
542 T *newowner = (
T*)newop;
543 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
OP_API void OPclearDefaultParmRange(OP_Node &node, const char *parm_token)
void getChannelToken(UT_String &thestrref, int index=0) const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
**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)
OP_API bool OPgetDefaultParmRange(const OP_Node &node, const char *parm_token, fpreal &min, fpreal &max)
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.
OP_API bool OPisShaderParmAtDefaultValue(const PRM_Parm &parm, bool check_time_dependent=true)
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
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
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
OP_API void OPsetDefaultParmRange(OP_Node &node, const char *parm_token, fpreal min, fpreal max)
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