23 namespace SOP_InvokeEnums
35 using namespace UT::Literal;
67 if (inputpath != src.
inputpath)
return false;
83 for (
int i = 0; i < list.
entries(); i++)
103 myBlockpath =
""_UTsh;
118 if (myBlockpath != src.myBlockpath)
return false;
119 if (myInputs != src.myInputs)
return false;
120 if (myUnload != src.myUnload)
return false;
134 myBlockpath =
""_UTsh;
136 graph->
evalOpParm(myBlockpath, nodeidx,
"blockpath", time, 0);
140 graph->
evalOpParm(length, nodeidx,
"inputs", time, 0);
141 if (length < 0) length = 0;
142 myInputs.setSize(length);
149 auto && _curentry = myInputs(i);
151 _curentry.name =
""_UTsh;
153 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
154 _curentry.inputpath =
""_UTsh;
156 graph->
evalOpParmInst(_curentry.inputpath, nodeidx,
"inputpath#", parmidx, offsets, time, 0, 2-1);
164 graph->
evalOpParm(myUnload, nodeidx,
"unload", time, 0);
180 template <
typename T>
187 if (idx.
size() != instance.
size()+1)
192 coerceValue(value, myBlockpath);
196 coerceValue(value, myInputs.entries());
197 else if (instance[0] < myInputs.entries())
199 auto && _data = myInputs(instance[0]);
203 coerceValue(value, _data.name);
206 coerceValue(value, _data.inputpath);
213 coerceValue(value, myUnload);
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 template <
typename T>
258 if (idx.
size() != instance.
size()+1)
263 coerceValue(myBlockpath, ( ( value ) ));
269 coerceValue(newsize, value);
270 if (newsize < 0) newsize = 0;
271 myInputs.setSize(newsize);
277 myInputs.setSizeIfNeeded(instance[0]+1);
278 auto && _data = myInputs(instance[0]);
282 coerceValue(_data.name, value);
285 coerceValue(_data.inputpath, value);
292 coerceValue(myUnload, clampMinValue(0, clampMaxValue(2, value ) ));
299 { doSetParmValue(idx, instance, value); }
301 { doSetParmValue(idx, instance, value); }
303 { doSetParmValue(idx, instance, value); }
305 { doSetParmValue(idx, instance, value); }
307 { doSetParmValue(idx, instance, value); }
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
337 if (fieldnum.
size() < 1)
344 if (fieldnum.
size() == 1)
364 if (fieldnum.
size() < 1)
365 return PARM_UNSUPPORTED;
371 if (fieldnum.
size() == 1)
372 return PARM_MULTIPARM;
381 return PARM_UNSUPPORTED;
386 return PARM_UNSUPPORTED;
422 loadData(is, rampdata);
440 int typelen = colon - data.
buffer();
454 {
int64 iv =
v; UTwrite(os, &iv); }
456 { UTwrite<fpreal64>(os, &
v); }
458 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
460 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
461 UTwrite<fpreal64>(os, &v.
z()); }
463 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
464 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
476 if (s) s->save(ostr);
478 saveData(os, result);
485 ostr << s->getDataTypeToken();
490 saveData(os, result);
494 void save(std::ostream &os)
const
498 saveData(os, myBlockpath);
501 UTwrite(os, &length);
504 auto && _curentry = myInputs(i);
506 saveData(os, _curentry.name);
507 saveData(os, _curentry.inputpath);
511 saveData(os, myUnload);
524 loadData(is, myBlockpath);
528 myInputs.setSize(length);
531 auto && _curentry = myInputs(i);
533 loadData(is, _curentry.name);
534 loadData(is, _curentry.inputpath);
538 loadData(is, myUnload);
548 if (!thissop)
return getBlockpath();
550 OP_Utils::evalOpParm(result, thissop,
"blockpath", cookparms.
getCookTime(), 0);
558 if (!thissop)
return getInputs().entries();
560 OP_Utils::evalOpParm(result, thissop,
"inputs", cookparms.
getCookTime(), 0);
564 {
return opinstInputs_name(cookparms, &_idx); }
568 if (!thissop)
return (myInputs(_idx[0]).
name);
570 _parmidx[1-1] = _idx[1-1] + 0;
573 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
577 {
return opinstInputs_inputpath(cookparms, &_idx); }
581 if (!thissop)
return (myInputs(_idx[0]).inputpath);
583 _parmidx[1-1] = _idx[1-1] + 0;
586 OP_Utils::evalOpParmInst(result, thissop,
"inputpath#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
595 if (!thissop)
return getUnload();
597 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
SYS_FORCE_INLINE UT_StringHolder getToken(Unload enum_value)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void copyFrom(const OP_NodeParms *src) override
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
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)
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
LeafData & operator=(const LeafData &)=delete
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)
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