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;
120 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
123 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
125 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
126 graph->
evalOpParm(myCollate, nodeidx,
"collate", time, graph->
isDirect()?
nullptr:depnode);
128 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getCollate())!=0)))) ) )
129 graph->
evalOpParm(mySource, nodeidx,
"source", time, graph->
isDirect()?
nullptr:depnode);
130 myMatchAttrib =
"name"_UTsh;
131 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getCollate())==1)&&(
int64(getCollate())==0)))) ) )
132 graph->
evalOpParm(myMatchAttrib, nodeidx,
"matchattrib", time, graph->
isDirect()?
nullptr:depnode);
133 mySrcAttrib =
"name"_UTsh;
134 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getCollate())!=3)))) ) )
135 graph->
evalOpParm(mySrcAttrib, nodeidx,
"srcattrib", time, graph->
isDirect()?
nullptr:depnode);
136 myIgnoremissing =
true;
137 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
138 graph->
evalOpParm(myIgnoremissing, nodeidx,
"ignoremissing", time, graph->
isDirect()?
nullptr:depnode);
139 myPreservetype =
true;
140 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
141 graph->
evalOpParm(myPreservetype, nodeidx,
"preservetype", time, graph->
isDirect()?
nullptr:depnode);
157 template <
typename T>
164 if (idx.
size() != instance.
size()+1)
169 coerceValue(value, myGroup);
172 coerceValue(value, myMethod);
175 coerceValue(value, myCollate);
178 coerceValue(value, mySource);
181 coerceValue(value, myMatchAttrib);
184 coerceValue(value, mySrcAttrib);
187 coerceValue(value, myIgnoremissing);
190 coerceValue(value, myPreservetype);
206 { doGetParmValue(idx, instance, value); }
208 { doGetParmValue(idx, instance, value); }
210 { doGetParmValue(idx, instance, value); }
212 { doGetParmValue(idx, instance, value); }
214 { doGetParmValue(idx, instance, value); }
216 { doGetParmValue(idx, instance, value); }
218 { doGetParmValue(idx, instance, value); }
220 { doGetParmValue(idx, instance, value); }
222 { doGetParmValue(idx, instance, value); }
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 template <
typename T>
235 if (idx.
size() != instance.
size()+1)
240 coerceValue(myGroup, ( ( value ) ));
243 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
246 coerceValue(myCollate, clampMinValue(0, clampMaxValue(3, value ) ));
249 coerceValue(mySource, ( ( value ) ));
252 coerceValue(myMatchAttrib, ( ( value ) ));
255 coerceValue(mySrcAttrib, ( ( value ) ));
258 coerceValue(myIgnoremissing, ( ( value ) ));
261 coerceValue(myPreservetype, ( ( value ) ));
268 { doSetParmValue(idx, instance, value); }
270 { doSetParmValue(idx, instance, value); }
272 { doSetParmValue(idx, instance, value); }
274 { doSetParmValue(idx, instance, value); }
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
304 if (fieldnum.
size() < 1)
317 return "matchattrib";
321 return "ignoremissing";
323 return "preservetype";
331 if (fieldnum.
size() < 1)
332 return PARM_UNSUPPORTED;
353 return PARM_UNSUPPORTED;
389 loadData(is, rampdata);
407 int typelen = colon - data.
buffer();
421 {
int64 iv =
v; UTwrite(os, &iv); }
423 { UTwrite<fpreal64>(os, &
v); }
425 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
427 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
428 UTwrite<fpreal64>(os, &v.
z()); }
430 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
431 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
443 if (s) s->save(ostr);
445 saveData(os, result);
452 ostr << s->getDataTypeToken();
457 saveData(os, result);
461 void save(std::ostream &os)
const
465 saveData(os, myGroup);
466 saveData(os, myMethod);
467 saveData(os, myCollate);
468 saveData(os, mySource);
469 saveData(os, myMatchAttrib);
470 saveData(os, mySrcAttrib);
471 saveData(os, myIgnoremissing);
472 saveData(os, myPreservetype);
485 loadData(is, myGroup);
486 loadData(is, myMethod);
487 loadData(is, myCollate);
488 loadData(is, mySource);
489 loadData(is, myMatchAttrib);
490 loadData(is, mySrcAttrib);
491 loadData(is, myIgnoremissing);
492 loadData(is, myPreservetype);
502 if (!thissop)
return getGroup();
504 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
512 if (!thissop)
return getMethod();
514 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
522 if (!thissop)
return getCollate();
524 OP_Utils::evalOpParm(result, thissop,
"collate", cookparms.
getCookTime(), 0);
534 OP_Utils::evalOpParm(result, thissop,
"source", cookparms.
getCookTime(), 0);
542 if (!thissop)
return getMatchAttrib();
544 OP_Utils::evalOpParm(result, thissop,
"matchattrib", cookparms.
getCookTime(), 0);
552 if (!thissop)
return getSrcAttrib();
554 OP_Utils::evalOpParm(result, thissop,
"srcattrib", cookparms.
getCookTime(), 0);
562 if (!thissop)
return getIgnoremissing();
564 OP_Utils::evalOpParm(result, thissop,
"ignoremissing", cookparms.
getCookTime(), 0);
572 if (!thissop)
return getPreservetype();
574 OP_Utils::evalOpParm(result, thissop,
"preservetype", cookparms.
getCookTime(), 0);
585 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)
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setIgnoremissing(bool val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
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)