23 namespace SOP_PackInjectEnums
34 using namespace UT::Literal;
53 using namespace UT::Literal;
77 myMatchAttrib =
"name"_UTsh;
78 mySrcAttrib =
"name"_UTsh;
79 myIgnoremissing =
true;
80 myPreservetype =
true;
93 if (myGroup != src.myGroup)
return false;
94 if (myMethod != src.myMethod)
return false;
95 if (myCollate != src.myCollate)
return false;
96 if (mySource != src.mySource)
return false;
97 if (myMatchAttrib != src.myMatchAttrib)
return false;
98 if (mySrcAttrib != src.mySrcAttrib)
return false;
99 if (myIgnoremissing != src.myIgnoremissing)
return false;
100 if (myPreservetype != src.myPreservetype)
return false;
117 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
120 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
122 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
123 graph->
evalOpParm(myCollate, nodeidx,
"collate", time, 0);
125 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getCollate())!=0)))) ) )
126 graph->
evalOpParm(mySource, nodeidx,
"source", time, 0);
127 myMatchAttrib =
"name"_UTsh;
128 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getCollate())==1)&&(
int64(getCollate())==0)))) ) )
129 graph->
evalOpParm(myMatchAttrib, nodeidx,
"matchattrib", time, 0);
130 mySrcAttrib =
"name"_UTsh;
131 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getCollate())!=3)))) ) )
132 graph->
evalOpParm(mySrcAttrib, nodeidx,
"srcattrib", time, 0);
133 myIgnoremissing =
true;
134 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
135 graph->
evalOpParm(myIgnoremissing, nodeidx,
"ignoremissing", time, 0);
136 myPreservetype =
true;
137 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
138 graph->
evalOpParm(myPreservetype, nodeidx,
"preservetype", time, 0);
154 template <
typename T>
161 if (idx.
size() != instance.
size()+1)
166 coerceValue(value, myGroup);
169 coerceValue(value, myMethod);
172 coerceValue(value, myCollate);
175 coerceValue(value, mySource);
178 coerceValue(value, myMatchAttrib);
181 coerceValue(value, mySrcAttrib);
184 coerceValue(value, myIgnoremissing);
187 coerceValue(value, myPreservetype);
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 template <
typename T>
232 if (idx.
size() != instance.
size()+1)
237 coerceValue(myGroup, ( ( value ) ));
240 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
243 coerceValue(myCollate, clampMinValue(0, clampMaxValue(3, value ) ));
246 coerceValue(mySource, ( ( value ) ));
249 coerceValue(myMatchAttrib, ( ( value ) ));
252 coerceValue(mySrcAttrib, ( ( value ) ));
255 coerceValue(myIgnoremissing, ( ( value ) ));
258 coerceValue(myPreservetype, ( ( value ) ));
265 { doSetParmValue(idx, instance, value); }
267 { doSetParmValue(idx, instance, value); }
269 { doSetParmValue(idx, instance, value); }
271 { doSetParmValue(idx, instance, value); }
273 { doSetParmValue(idx, instance, value); }
275 { doSetParmValue(idx, instance, value); }
277 { doSetParmValue(idx, instance, value); }
279 { doSetParmValue(idx, instance, value); }
281 { doSetParmValue(idx, instance, value); }
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
301 if (fieldnum.
size() < 1)
314 return "matchattrib";
318 return "ignoremissing";
320 return "preservetype";
328 if (fieldnum.
size() < 1)
329 return PARM_UNSUPPORTED;
350 return PARM_UNSUPPORTED;
386 loadData(is, rampdata);
404 int typelen = colon - data.
buffer();
418 {
int64 iv =
v; UTwrite(os, &iv); }
420 { UTwrite<fpreal64>(os, &
v); }
422 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
424 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
425 UTwrite<fpreal64>(os, &v.
z()); }
427 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
428 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
440 if (s) s->save(ostr);
442 saveData(os, result);
449 ostr << s->getDataTypeToken();
454 saveData(os, result);
458 void save(std::ostream &os)
const
462 saveData(os, myGroup);
463 saveData(os, myMethod);
464 saveData(os, myCollate);
465 saveData(os, mySource);
466 saveData(os, myMatchAttrib);
467 saveData(os, mySrcAttrib);
468 saveData(os, myIgnoremissing);
469 saveData(os, myPreservetype);
482 loadData(is, myGroup);
483 loadData(is, myMethod);
484 loadData(is, myCollate);
485 loadData(is, mySource);
486 loadData(is, myMatchAttrib);
487 loadData(is, mySrcAttrib);
488 loadData(is, myIgnoremissing);
489 loadData(is, myPreservetype);
499 if (!thissop)
return getGroup();
501 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
509 if (!thissop)
return getMethod();
511 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
519 if (!thissop)
return getCollate();
521 OP_Utils::evalOpParm(result, thissop,
"collate", cookparms.
getCookTime(), 0);
531 OP_Utils::evalOpParm(result, thissop,
"source", cookparms.
getCookTime(), 0);
539 if (!thissop)
return getMatchAttrib();
541 OP_Utils::evalOpParm(result, thissop,
"matchattrib", cookparms.
getCookTime(), 0);
549 if (!thissop)
return getSrcAttrib();
551 OP_Utils::evalOpParm(result, thissop,
"srcattrib", cookparms.
getCookTime(), 0);
559 if (!thissop)
return getIgnoremissing();
561 OP_Utils::evalOpParm(result, thissop,
"ignoremissing", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getPreservetype();
571 OP_Utils::evalOpParm(result, thissop,
"preservetype", cookparms.
getCookTime(), 0);
582 bool myIgnoremissing;
bool opPreservetype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, fpreal64 &v)
SOP_Node * getNode() const
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setPreservetype(bool val)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
const OP_Context & context() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
void setCollate(Collate val)
bool operator==(const SOP_PackInjectParms &src) const
SYS_FORCE_INLINE const char * buffer() const
bool operator!=(const SOP_PackInjectParms &src) const
static void saveData(std::ostream &os, bool v)
An output stream object that owns its own string buffer storage.
**But if you need a result
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void loadFromOpSubclass(const LoadParms &loadparms) override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, UT_StringHolder s)
void setGroup(const UT_StringHolder &val)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const UT_StringHolder & getSrcAttrib() const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setMatchAttrib(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
bool opIgnoremissing(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
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
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool getIgnoremissing() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_StringHolder opMatchAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
bool getPreservetype() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
const UT_StringHolder & getMatchAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_StringHolder opSrcAttrib(const SOP_NodeVerb::CookParms &cookparms) const
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setSource(int64 val)
exint getNestNumParms(TempIndex idx) const override
DEP_MicroNode * depnode() const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setSrcAttrib(const UT_StringHolder &val)
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, bool &v)
int64 opSource(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setIgnoremissing(bool val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setMethod(Method val)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
Collate getCollate() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
Collate opCollate(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector4D v)