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;
137 myBlockpath =
""_UTsh;
139 graph->
evalOpParm(myBlockpath, nodeidx,
"blockpath", time, graph->
isDirect()?
nullptr:depnode);
143 graph->
evalOpParm(length, nodeidx,
"inputs", time, graph->
isDirect()?
nullptr:depnode);
144 if (length < 0) length = 0;
145 myInputs.setSize(length);
152 auto && _curentry = myInputs(i);
154 _curentry.name =
""_UTsh;
156 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
157 _curentry.inputpath =
""_UTsh;
159 graph->
evalOpParmInst(_curentry.inputpath, nodeidx,
"inputpath#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
167 graph->
evalOpParm(myUnload, nodeidx,
"unload", time, graph->
isDirect()?
nullptr:depnode);
183 template <
typename T>
190 if (idx.
size() != instance.
size()+1)
195 coerceValue(value, myBlockpath);
199 coerceValue(value, myInputs.entries());
200 else if (instance[0] < myInputs.entries())
202 auto && _data = myInputs(instance[0]);
206 coerceValue(value, _data.name);
209 coerceValue(value, _data.inputpath);
216 coerceValue(value, myUnload);
232 { doGetParmValue(idx, instance, value); }
234 { doGetParmValue(idx, instance, value); }
236 { doGetParmValue(idx, instance, value); }
238 { doGetParmValue(idx, instance, value); }
240 { doGetParmValue(idx, instance, value); }
242 { doGetParmValue(idx, instance, value); }
244 { doGetParmValue(idx, instance, value); }
246 { doGetParmValue(idx, instance, value); }
248 { doGetParmValue(idx, instance, value); }
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 template <
typename T>
261 if (idx.
size() != instance.
size()+1)
266 coerceValue(myBlockpath, ( ( value ) ));
272 coerceValue(newsize, value);
273 if (newsize < 0) newsize = 0;
274 myInputs.setSize(newsize);
280 myInputs.setSizeIfNeeded(instance[0]+1);
281 auto && _data = myInputs(instance[0]);
285 coerceValue(_data.name, value);
288 coerceValue(_data.inputpath, value);
295 coerceValue(myUnload, clampMinValue(0, clampMaxValue(2, value ) ));
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
316 { doSetParmValue(idx, instance, value); }
318 { doSetParmValue(idx, instance, value); }
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
340 if (fieldnum.
size() < 1)
347 if (fieldnum.
size() == 1)
367 if (fieldnum.
size() < 1)
368 return PARM_UNSUPPORTED;
374 if (fieldnum.
size() == 1)
375 return PARM_MULTIPARM;
384 return PARM_UNSUPPORTED;
389 return PARM_UNSUPPORTED;
425 loadData(is, rampdata);
443 int typelen = colon - data.
buffer();
457 {
int64 iv =
v; UTwrite(os, &iv); }
459 { UTwrite<fpreal64>(os, &
v); }
461 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
463 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
464 UTwrite<fpreal64>(os, &v.
z()); }
466 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
467 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
479 if (s) s->save(ostr);
481 saveData(os, result);
488 ostr << s->getDataTypeToken();
493 saveData(os, result);
497 void save(std::ostream &os)
const
501 saveData(os, myBlockpath);
504 UTwrite(os, &length);
507 auto && _curentry = myInputs(i);
509 saveData(os, _curentry.name);
510 saveData(os, _curentry.inputpath);
514 saveData(os, myUnload);
527 loadData(is, myBlockpath);
531 myInputs.setSize(length);
534 auto && _curentry = myInputs(i);
536 loadData(is, _curentry.name);
537 loadData(is, _curentry.inputpath);
541 loadData(is, myUnload);
551 if (!thissop)
return getBlockpath();
553 OP_Utils::evalOpParm(result, thissop,
"blockpath", cookparms.
getCookTime(), 0);
561 if (!thissop)
return getInputs().entries();
563 OP_Utils::evalOpParm(result, thissop,
"inputs", cookparms.
getCookTime(), 0);
567 {
return opinstInputs_name(cookparms, &_idx); }
571 if (!thissop)
return (myInputs(_idx[0]).
name);
573 _parmidx[1-1] = _idx[1-1] + 0;
576 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
580 {
return opinstInputs_inputpath(cookparms, &_idx); }
584 if (!thissop)
return (myInputs(_idx[0]).inputpath);
586 _parmidx[1-1] = _idx[1-1] + 0;
589 OP_Utils::evalOpParmInst(result, thissop,
"inputpath#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
598 if (!thissop)
return getUnload();
600 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)
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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