23 namespace SOP_InvokeEnums
54 if (inputpath != src.
inputpath)
return false;
70 for (
int i = 0; i < list.
entries(); i++)
90 myBlockpath =
""_UTsh;
105 if (myBlockpath != src.myBlockpath)
return false;
106 if (myInputs != src.myInputs)
return false;
107 if (myUnload != src.myUnload)
return false;
121 myBlockpath =
""_UTsh;
123 graph->
evalOpParm(myBlockpath, nodeidx,
"blockpath", time, 0);
127 graph->
evalOpParm(length, nodeidx,
"inputs", time, 0);
128 if (length < 0) length = 0;
129 myInputs.setSize(length);
136 auto && _curentry = myInputs(i);
138 _curentry.name =
""_UTsh;
140 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
141 _curentry.inputpath =
""_UTsh;
143 graph->
evalOpParmInst(_curentry.inputpath, nodeidx,
"inputpath#", parmidx, offsets, time, 0, 2-1);
151 graph->
evalOpParm(myUnload, nodeidx,
"unload", time, 0);
167 template <
typename T>
174 if (idx.
size() != instance.
size()+1)
184 else if (instance[0] < myInputs.entries())
186 auto && _data = myInputs(instance[0]);
216 { doGetParmValue(idx, instance, value); }
218 { doGetParmValue(idx, instance, value); }
220 { doGetParmValue(idx, instance, value); }
222 { doGetParmValue(idx, instance, value); }
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 { doGetParmValue(idx, instance, value); }
230 { doGetParmValue(idx, instance, value); }
232 { doGetParmValue(idx, instance, value); }
234 { doGetParmValue(idx, instance, value); }
236 { doGetParmValue(idx, instance, value); }
238 template <
typename T>
245 if (idx.
size() != instance.
size()+1)
257 if (newsize < 0) newsize = 0;
258 myInputs.setSize(newsize);
264 myInputs.setSizeIfNeeded(instance[0]+1);
265 auto && _data = myInputs(instance[0]);
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
324 if (fieldnum.
size() < 1)
331 if (fieldnum.
size() == 1)
351 if (fieldnum.
size() < 1)
352 return PARM_UNSUPPORTED;
358 if (fieldnum.
size() == 1)
359 return PARM_MULTIPARM;
392 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
394 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
396 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
409 loadData(is, rampdata);
427 int typelen = colon - data.
buffer();
441 {
int64 iv =
v; UTwrite(os, &iv); }
443 { UTwrite<fpreal64>(os, &
v); }
445 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
447 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
448 UTwrite<fpreal64>(os, &v.
z()); }
450 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
451 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
463 if (s) s->save(ostr);
465 saveData(os, result);
472 ostr << s->getDataTypeToken();
477 saveData(os, result);
481 void save(std::ostream &os)
const
485 saveData(os, myBlockpath);
488 UTwrite(os, &length);
491 auto && _curentry = myInputs(i);
493 saveData(os, _curentry.name);
494 saveData(os, _curentry.inputpath);
498 saveData(os, myUnload);
511 loadData(is, myBlockpath);
515 myInputs.setSize(length);
518 auto && _curentry = myInputs(i);
520 loadData(is, _curentry.name);
521 loadData(is, _curentry.inputpath);
525 loadData(is, myUnload);
535 if (!thissop)
return getBlockpath();
537 OP_Utils::evalOpParm(result, thissop,
"blockpath", cookparms.
getCookTime(), 0);
545 if (!thissop)
return getInputs().entries();
547 OP_Utils::evalOpParm(result, thissop,
"inputs", cookparms.
getCookTime(), 0);
551 {
return opinstInputs_name(cookparms, &_idx); }
555 if (!thissop)
return (myInputs(_idx[0]).
name);
557 _parmidx[1-1] = _idx[1-1] + 0;
560 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
564 {
return opinstInputs_inputpath(cookparms, &_idx); }
568 if (!thissop)
return (myInputs(_idx[0]).inputpath);
570 _parmidx[1-1] = _idx[1-1] + 0;
573 OP_Utils::evalOpParmInst(result, thissop,
"inputpath#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
582 if (!thissop)
return getUnload();
584 OP_Utils::evalOpParm(result, thissop,
"unload", cookparms.
getCookTime(), 0);
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, int64 &v)
SOP_Node * getNode() const
bool operator!=(const SOP_InvokeParms &src) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void copyFrom(const OP_NodeParms *src) override
T clampMaxValue(fpreal maxvalue, const T &src) const
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, fpreal64 &v)
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void save(std::ostream &os) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
void setUnload(Unload val)
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder createString(const UT_Array< Inputs > &list) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
**But if you need a result
T clampMinValue(fpreal minvalue, const T &src) const
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
Unload opUnload(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & x() noexcept
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
void setInputs(const UT_Array< Inputs > &val)
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opinstInputs_inputpath(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opBlockpath(const SOP_NodeVerb::CookParms &cookparms) const
const UT_Array< Inputs > & getInputs() const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Vector3D v)
GLuint const GLchar * name
UT_StringHolder opinstInputs_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const UT_StringHolder & getBlockpath() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE void strcat(const char *src)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_StringHolder opInputs_inputpath(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
void setBlockpath(const UT_StringHolder &val)
static void saveData(std::ostream &os, fpreal64 v)
UT_StringHolder opInputs_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void coerceValue(T &result, const S &src) const
bool operator==(const SOP_InvokeParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, UT_StringHolder s)
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
void loadFromOpSubclass(const LoadParms &loadparms) override
exint opInputs(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept