23 namespace SOP_InvokeGraphEnums
34 using namespace UT::Literal;
53 using namespace UT::Literal;
73 using namespace UT::Literal;
118 for (
int i = 0; i < list.
entries(); i++)
138 myOutputGroup =
""_UTsh;
141 myInputGroup =
""_UTsh;
155 if (myMethod != src.myMethod)
return false;
156 if (myOutputType != src.myOutputType)
return false;
157 if (myOutputGroup != src.myOutputGroup)
return false;
158 if (myOutput != src.myOutput)
return false;
159 if (myInputs != src.myInputs)
return false;
160 if (myInputGroup != src.myInputGroup)
return false;
161 if (myUnload != src.myUnload)
return false;
182 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
185 graph->
evalOpParm(myOutputType, nodeidx,
"outputtype", time, graph->
isDirect()?
nullptr:depnode);
186 myOutputGroup =
""_UTsh;
187 if (
true && ( (
true&&!(((
int64(getOutputType())!=2)))) ) )
188 graph->
evalOpParm(myOutputGroup, nodeidx,
"outputgroup", time, graph->
isDirect()?
nullptr:depnode);
190 if (
true && ( (
true&&!(((
int64(getOutputType())!=3)))) ) )
191 graph->
evalOpParm(myOutput, nodeidx,
"output", time, graph->
isDirect()?
nullptr:depnode);
192 if (
true && ( (!(((
int64(getMethod())!=0)))) ) )
195 graph->
evalOpParm(length, nodeidx,
"inputs", time, graph->
isDirect()?
nullptr:depnode);
196 if (length < 0) length = 0;
197 myInputs.setSize(length);
204 auto && _curentry = myInputs(i);
206 _curentry.name =
""_UTsh;
207 if (
true && ( (!(((
int64(getMethod())!=0)))) ) && ( (
true&&!(((
int64(getMethod())!=0)))) ) )
208 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
214 myInputGroup =
""_UTsh;
215 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
216 graph->
evalOpParm(myInputGroup, nodeidx,
"inputgroup", time, graph->
isDirect()?
nullptr:depnode);
219 graph->
evalOpParm(myUnload, nodeidx,
"unload", time, graph->
isDirect()?
nullptr:depnode);
235 template <
typename T>
242 if (idx.
size() != instance.
size()+1)
247 coerceValue(value, myMethod);
250 coerceValue(value, myOutputType);
253 coerceValue(value, myOutputGroup);
256 coerceValue(value, myOutput);
260 coerceValue(value, myInputs.entries());
261 else if (instance[0] < myInputs.entries())
263 auto && _data = myInputs(instance[0]);
267 coerceValue(value, _data.name);
274 coerceValue(value, myInputGroup);
277 coerceValue(value, myUnload);
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 { doGetParmValue(idx, instance, value); }
301 { doGetParmValue(idx, instance, value); }
303 { doGetParmValue(idx, instance, value); }
305 { doGetParmValue(idx, instance, value); }
307 { doGetParmValue(idx, instance, value); }
309 { doGetParmValue(idx, instance, value); }
311 { doGetParmValue(idx, instance, value); }
313 { doGetParmValue(idx, instance, value); }
315 template <
typename T>
322 if (idx.
size() != instance.
size()+1)
327 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
330 coerceValue(myOutputType, clampMinValue(0, clampMaxValue(3, value ) ));
333 coerceValue(myOutputGroup, ( ( value ) ));
336 coerceValue(myOutput, ( ( value ) ));
342 coerceValue(newsize, value);
343 if (newsize < 0) newsize = 0;
344 myInputs.setSize(newsize);
350 myInputs.setSizeIfNeeded(instance[0]+1);
351 auto && _data = myInputs(instance[0]);
355 coerceValue(_data.name, value);
362 coerceValue(myInputGroup, ( ( value ) ));
365 coerceValue(myUnload, clampMinValue(0, clampMaxValue(2, value ) ));
372 { doSetParmValue(idx, instance, value); }
374 { doSetParmValue(idx, instance, value); }
376 { doSetParmValue(idx, instance, value); }
378 { doSetParmValue(idx, instance, value); }
380 { doSetParmValue(idx, instance, value); }
382 { doSetParmValue(idx, instance, value); }
384 { doSetParmValue(idx, instance, value); }
386 { doSetParmValue(idx, instance, value); }
388 { doSetParmValue(idx, instance, value); }
390 { doSetParmValue(idx, instance, value); }
392 { doSetParmValue(idx, instance, value); }
410 if (fieldnum.
size() < 1)
419 return "outputgroup";
423 if (fieldnum.
size() == 1)
443 if (fieldnum.
size() < 1)
444 return PARM_UNSUPPORTED;
456 if (fieldnum.
size() == 1)
457 return PARM_MULTIPARM;
464 return PARM_UNSUPPORTED;
471 return PARM_UNSUPPORTED;
507 loadData(is, rampdata);
525 int typelen = colon - data.
buffer();
539 {
int64 iv =
v; UTwrite(os, &iv); }
541 { UTwrite<fpreal64>(os, &
v); }
543 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
545 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
546 UTwrite<fpreal64>(os, &v.
z()); }
548 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
549 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
561 if (s) s->save(ostr);
563 saveData(os, result);
570 ostr << s->getDataTypeToken();
575 saveData(os, result);
579 void save(std::ostream &os)
const
583 saveData(os, myMethod);
584 saveData(os, myOutputType);
585 saveData(os, myOutputGroup);
586 saveData(os, myOutput);
589 UTwrite(os, &length);
592 auto && _curentry = myInputs(i);
594 saveData(os, _curentry.name);
598 saveData(os, myInputGroup);
599 saveData(os, myUnload);
612 loadData(is, myMethod);
613 loadData(is, myOutputType);
614 loadData(is, myOutputGroup);
615 loadData(is, myOutput);
619 myInputs.setSize(length);
622 auto && _curentry = myInputs(i);
624 loadData(is, _curentry.name);
628 loadData(is, myInputGroup);
629 loadData(is, myUnload);
639 if (!thissop)
return getMethod();
641 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
649 if (!thissop)
return getOutputType();
651 OP_Utils::evalOpParm(result, thissop,
"outputtype", cookparms.
getCookTime(), 0);
659 if (!thissop)
return getOutputGroup();
661 OP_Utils::evalOpParm(result, thissop,
"outputgroup", cookparms.
getCookTime(), 0);
669 if (!thissop)
return getOutput();
671 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getInputs().entries();
681 OP_Utils::evalOpParm(result, thissop,
"inputs", cookparms.
getCookTime(), 0);
685 {
return opinstInputs_name(cookparms, &_idx); }
689 if (!thissop)
return (myInputs(_idx[0]).
name);
691 _parmidx[1-1] = _idx[1-1] + 0;
694 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
703 if (!thissop)
return getInputGroup();
705 OP_Utils::evalOpParm(result, thissop,
"inputgroup", cookparms.
getCookTime(), 0);
713 if (!thissop)
return getUnload();
715 OP_Utils::evalOpParm(result, thissop,
"unload", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
GLenum GLuint GLenum GLsizei const GLchar * buf
static void loadData(UT_IStream &is, UT_Vector4I &v)
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opOutput(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
void setOutputGroup(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
exint getNestNumParms(TempIndex idx) const override
void setUnload(Unload val)
GLsizei const GLfloat * value
const UT_Array< Inputs > & getInputs() const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
UT_StringHolder opInputs_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GLuint GLsizei GLsizei * length
const UT_StringHolder & getOutput() const
An output stream object that owns its own string buffer storage.
UT_StringHolder opOutputGroup(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &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.
void setMethod(Method val)
static void saveData(std::ostream &os, int64 v)
void setInputGroup(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
OutputType opOutputType(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, fpreal64 v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
void setOutput(const UT_StringHolder &val)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
exint opInputs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
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
OutputType getOutputType() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setOutputType(OutputType val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, int64 &v)
Unload opUnload(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator==(const SOP_InvokeGraphParms &src) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
GLuint const GLchar * name
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE void strcat(const char *src)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
UT_StringHolder createString(const UT_Array< Inputs > &list) const
GT_API const UT_StringHolder version
void save(std::ostream &os) const
static void loadData(UT_IStream &is, fpreal64 &v)
exint entries() const
Alias of size(). size() is preferred.
const UT_StringHolder & getOutputGroup() const
static void saveData(std::ostream &os, UT_Vector3D v)
bool operator!=(const SOP_InvokeGraphParms &src) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setInputs(const UT_Array< Inputs > &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Utility class for containing a color ramp.
ParmType getNestParmType(TempIndex fieldnum) const override
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, UT_Matrix2D &v)
UT_StringHolder opInputGroup(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
void loadFromOpSubclass(const LoadParms &loadparms) override
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const UT_StringHolder & getInputGroup() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Vector2I &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
UT_StringHolder opinstInputs_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_Vector2D &v)