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;
179 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
182 graph->
evalOpParm(myOutputType, nodeidx,
"outputtype", time, 0);
183 myOutputGroup =
""_UTsh;
184 if (
true && ( (
true&&!(((
int64(getOutputType())!=2)))) ) )
185 graph->
evalOpParm(myOutputGroup, nodeidx,
"outputgroup", time, 0);
187 if (
true && ( (
true&&!(((
int64(getOutputType())!=3)))) ) )
188 graph->
evalOpParm(myOutput, nodeidx,
"output", time, 0);
189 if (
true && ( (!(((
int64(getMethod())!=0)))) ) )
192 graph->
evalOpParm(length, nodeidx,
"inputs", time, 0);
193 if (length < 0) length = 0;
194 myInputs.setSize(length);
201 auto && _curentry = myInputs(i);
203 _curentry.name =
""_UTsh;
204 if (
true && ( (!(((
int64(getMethod())!=0)))) ) && ( (
true&&!(((
int64(getMethod())!=0)))) ) )
205 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
211 myInputGroup =
""_UTsh;
212 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
213 graph->
evalOpParm(myInputGroup, nodeidx,
"inputgroup", time, 0);
216 graph->
evalOpParm(myUnload, nodeidx,
"unload", time, 0);
232 template <
typename T>
239 if (idx.
size() != instance.
size()+1)
244 coerceValue(value, myMethod);
247 coerceValue(value, myOutputType);
250 coerceValue(value, myOutputGroup);
253 coerceValue(value, myOutput);
257 coerceValue(value, myInputs.entries());
258 else if (instance[0] < myInputs.entries())
260 auto && _data = myInputs(instance[0]);
264 coerceValue(value, _data.name);
271 coerceValue(value, myInputGroup);
274 coerceValue(value, myUnload);
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 { doGetParmValue(idx, instance, value); }
298 { doGetParmValue(idx, instance, value); }
300 { doGetParmValue(idx, instance, value); }
302 { doGetParmValue(idx, instance, value); }
304 { doGetParmValue(idx, instance, value); }
306 { doGetParmValue(idx, instance, value); }
308 { doGetParmValue(idx, instance, value); }
310 { doGetParmValue(idx, instance, value); }
312 template <
typename T>
319 if (idx.
size() != instance.
size()+1)
324 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
327 coerceValue(myOutputType, clampMinValue(0, clampMaxValue(3, value ) ));
330 coerceValue(myOutputGroup, ( ( value ) ));
333 coerceValue(myOutput, ( ( value ) ));
339 coerceValue(newsize, value);
340 if (newsize < 0) newsize = 0;
341 myInputs.setSize(newsize);
347 myInputs.setSizeIfNeeded(instance[0]+1);
348 auto && _data = myInputs(instance[0]);
352 coerceValue(_data.name, value);
359 coerceValue(myInputGroup, ( ( value ) ));
362 coerceValue(myUnload, clampMinValue(0, clampMaxValue(2, value ) ));
369 { doSetParmValue(idx, instance, value); }
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, value); }
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
383 { doSetParmValue(idx, instance, value); }
385 { doSetParmValue(idx, instance, value); }
387 { doSetParmValue(idx, instance, value); }
389 { doSetParmValue(idx, instance, value); }
407 if (fieldnum.
size() < 1)
416 return "outputgroup";
420 if (fieldnum.
size() == 1)
440 if (fieldnum.
size() < 1)
441 return PARM_UNSUPPORTED;
453 if (fieldnum.
size() == 1)
454 return PARM_MULTIPARM;
461 return PARM_UNSUPPORTED;
468 return PARM_UNSUPPORTED;
504 loadData(is, rampdata);
522 int typelen = colon - data.
buffer();
536 {
int64 iv =
v; UTwrite(os, &iv); }
538 { UTwrite<fpreal64>(os, &
v); }
540 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
542 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
543 UTwrite<fpreal64>(os, &v.
z()); }
545 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
546 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
558 if (s) s->save(ostr);
560 saveData(os, result);
567 ostr << s->getDataTypeToken();
572 saveData(os, result);
576 void save(std::ostream &os)
const
580 saveData(os, myMethod);
581 saveData(os, myOutputType);
582 saveData(os, myOutputGroup);
583 saveData(os, myOutput);
586 UTwrite(os, &length);
589 auto && _curentry = myInputs(i);
591 saveData(os, _curentry.name);
595 saveData(os, myInputGroup);
596 saveData(os, myUnload);
609 loadData(is, myMethod);
610 loadData(is, myOutputType);
611 loadData(is, myOutputGroup);
612 loadData(is, myOutput);
616 myInputs.setSize(length);
619 auto && _curentry = myInputs(i);
621 loadData(is, _curentry.name);
625 loadData(is, myInputGroup);
626 loadData(is, myUnload);
636 if (!thissop)
return getMethod();
638 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
646 if (!thissop)
return getOutputType();
648 OP_Utils::evalOpParm(result, thissop,
"outputtype", cookparms.
getCookTime(), 0);
656 if (!thissop)
return getOutputGroup();
658 OP_Utils::evalOpParm(result, thissop,
"outputgroup", cookparms.
getCookTime(), 0);
666 if (!thissop)
return getOutput();
668 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
676 if (!thissop)
return getInputs().entries();
678 OP_Utils::evalOpParm(result, thissop,
"inputs", cookparms.
getCookTime(), 0);
682 {
return opinstInputs_name(cookparms, &_idx); }
686 if (!thissop)
return (myInputs(_idx[0]).
name);
688 _parmidx[1-1] = _idx[1-1] + 0;
691 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
700 if (!thissop)
return getInputGroup();
702 OP_Utils::evalOpParm(result, thissop,
"inputgroup", cookparms.
getCookTime(), 0);
710 if (!thissop)
return getUnload();
712 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)
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
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)
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)
UT_StringHolder opinstInputs_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)