23 namespace SOP_AttribFromParmEnums
36 using namespace UT::Literal;
58 myCategory =
"*"_UTsh;
59 myName =
"parms"_UTsh;
60 myParmfilter =
"*"_UTsh;
61 myFlattenmultiparm =
false;
62 myFlattenramp =
false;
63 myEvaluateparms =
true;
64 myChannelPrims =
false;
65 myPackLockGeometry =
true;
66 myExplicitWires =
false;
67 myExplicitPorts =
false;
68 myUpdateOnMove =
false;
69 myUpdateOnRename =
false;
82 if (myMethod != src.myMethod)
return false;
83 if (myNodepath != src.myNodepath)
return false;
84 if (myCategory != src.myCategory)
return false;
85 if (myName != src.myName)
return false;
86 if (myParmfilter != src.myParmfilter)
return false;
87 if (myFlattenmultiparm != src.myFlattenmultiparm)
return false;
88 if (myFlattenramp != src.myFlattenramp)
return false;
89 if (myEvaluateparms != src.myEvaluateparms)
return false;
90 if (myChannelPrims != src.myChannelPrims)
return false;
91 if (myPackLockGeometry != src.myPackLockGeometry)
return false;
92 if (myExplicitWires != src.myExplicitWires)
return false;
93 if (myExplicitPorts != src.myExplicitPorts)
return false;
94 if (myUpdateOnMove != src.myUpdateOnMove)
return false;
95 if (myUpdateOnRename != src.myUpdateOnRename)
return false;
111 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
112 myNodepath =
""_UTsh;
114 graph->
evalOpParm(myNodepath, nodeidx,
"nodepath", time, 0);
115 myCategory =
"*"_UTsh;
117 graph->
evalOpParm(myCategory, nodeidx,
"category", time, 0);
118 myName =
"parms"_UTsh;
120 graph->
evalOpParm(myName, nodeidx,
"name", time, 0);
121 myParmfilter =
"*"_UTsh;
123 graph->
evalOpParm(myParmfilter, nodeidx,
"parmfilter", time, 0);
124 myFlattenmultiparm =
false;
126 graph->
evalOpParm(myFlattenmultiparm, nodeidx,
"flattenmultiparm", time, 0);
127 myFlattenramp =
false;
128 if (
true && ( (
true&&!(((getFlattenmultiparm()==1)))) ) )
129 graph->
evalOpParm(myFlattenramp, nodeidx,
"flattenramp", time, 0);
130 myEvaluateparms =
true;
132 graph->
evalOpParm(myEvaluateparms, nodeidx,
"evaluateparms", time, 0);
133 myChannelPrims =
false;
134 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getEvaluateparms()==1)))) ) )
135 graph->
evalOpParm(myChannelPrims, nodeidx,
"channelprims", time, 0);
136 myPackLockGeometry =
true;
138 graph->
evalOpParm(myPackLockGeometry, nodeidx,
"packlockgeometry", time, 0);
139 myExplicitWires =
false;
141 graph->
evalOpParm(myExplicitWires, nodeidx,
"explicitwires", time, 0);
142 myExplicitPorts =
false;
144 graph->
evalOpParm(myExplicitPorts, nodeidx,
"explicitports", time, 0);
145 myUpdateOnMove =
false;
147 graph->
evalOpParm(myUpdateOnMove, nodeidx,
"updateonmove", time, 0);
148 myUpdateOnRename =
false;
150 graph->
evalOpParm(myUpdateOnRename, nodeidx,
"updateonrename", time, 0);
166 template <
typename T>
173 if (idx.
size() != instance.
size()+1)
178 coerceValue(value, myMethod);
181 coerceValue(value, myNodepath);
184 coerceValue(value, myCategory);
187 coerceValue(value, myName);
190 coerceValue(value, myParmfilter);
193 coerceValue(value, myFlattenmultiparm);
196 coerceValue(value, myFlattenramp);
199 coerceValue(value, myEvaluateparms);
202 coerceValue(value, myChannelPrims);
205 coerceValue(value, myPackLockGeometry);
208 coerceValue(value, myExplicitWires);
211 coerceValue(value, myExplicitPorts);
214 coerceValue(value, myUpdateOnMove);
217 coerceValue(value, myUpdateOnRename);
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 template <
typename T>
262 if (idx.
size() != instance.
size()+1)
267 coerceValue(myMethod, clampMinValue(0, clampMaxValue(3, value ) ));
270 coerceValue(myNodepath, ( ( value ) ));
273 coerceValue(myCategory, ( ( value ) ));
276 coerceValue(myName, ( ( value ) ));
279 coerceValue(myParmfilter, ( ( value ) ));
282 coerceValue(myFlattenmultiparm, ( ( value ) ));
285 coerceValue(myFlattenramp, ( ( value ) ));
288 coerceValue(myEvaluateparms, ( ( value ) ));
291 coerceValue(myChannelPrims, ( ( value ) ));
294 coerceValue(myPackLockGeometry, ( ( value ) ));
297 coerceValue(myExplicitWires, ( ( value ) ));
300 coerceValue(myExplicitPorts, ( ( value ) ));
303 coerceValue(myUpdateOnMove, ( ( value ) ));
306 coerceValue(myUpdateOnRename, ( ( value ) ));
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
333 { doSetParmValue(idx, instance, value); }
349 if (fieldnum.
size() < 1)
364 return "flattenmultiparm";
366 return "flattenramp";
368 return "evaluateparms";
370 return "channelprims";
372 return "packlockgeometry";
374 return "explicitwires";
376 return "explicitports";
378 return "updateonmove";
380 return "updateonrename";
388 if (fieldnum.
size() < 1)
389 return PARM_UNSUPPORTED;
422 return PARM_UNSUPPORTED;
458 loadData(is, rampdata);
476 int typelen = colon - data.
buffer();
490 {
int64 iv =
v; UTwrite(os, &iv); }
492 { UTwrite<fpreal64>(os, &
v); }
494 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
496 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
497 UTwrite<fpreal64>(os, &v.
z()); }
499 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
500 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
512 if (s) s->save(ostr);
514 saveData(os, result);
521 ostr << s->getDataTypeToken();
526 saveData(os, result);
530 void save(std::ostream &os)
const
534 saveData(os, myMethod);
535 saveData(os, myNodepath);
536 saveData(os, myCategory);
537 saveData(os, myName);
538 saveData(os, myParmfilter);
539 saveData(os, myFlattenmultiparm);
540 saveData(os, myFlattenramp);
541 saveData(os, myEvaluateparms);
542 saveData(os, myChannelPrims);
543 saveData(os, myPackLockGeometry);
544 saveData(os, myExplicitWires);
545 saveData(os, myExplicitPorts);
546 saveData(os, myUpdateOnMove);
547 saveData(os, myUpdateOnRename);
560 loadData(is, myMethod);
561 loadData(is, myNodepath);
562 loadData(is, myCategory);
563 loadData(is, myName);
564 loadData(is, myParmfilter);
565 loadData(is, myFlattenmultiparm);
566 loadData(is, myFlattenramp);
567 loadData(is, myEvaluateparms);
568 loadData(is, myChannelPrims);
569 loadData(is, myPackLockGeometry);
570 loadData(is, myExplicitWires);
571 loadData(is, myExplicitPorts);
572 loadData(is, myUpdateOnMove);
573 loadData(is, myUpdateOnRename);
583 if (!thissop)
return getMethod();
585 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
593 if (!thissop)
return getNodepath();
595 OP_Utils::evalOpParm(result, thissop,
"nodepath", cookparms.
getCookTime(), 0);
603 if (!thissop)
return getCategory();
605 OP_Utils::evalOpParm(result, thissop,
"category", cookparms.
getCookTime(), 0);
613 if (!thissop)
return getName();
615 OP_Utils::evalOpParm(result, thissop,
"name", cookparms.
getCookTime(), 0);
623 if (!thissop)
return getParmfilter();
625 OP_Utils::evalOpParm(result, thissop,
"parmfilter", cookparms.
getCookTime(), 0);
633 if (!thissop)
return getFlattenmultiparm();
635 OP_Utils::evalOpParm(result, thissop,
"flattenmultiparm", cookparms.
getCookTime(), 0);
643 if (!thissop)
return getFlattenramp();
645 OP_Utils::evalOpParm(result, thissop,
"flattenramp", cookparms.
getCookTime(), 0);
653 if (!thissop)
return getEvaluateparms();
655 OP_Utils::evalOpParm(result, thissop,
"evaluateparms", cookparms.
getCookTime(), 0);
663 if (!thissop)
return getChannelPrims();
665 OP_Utils::evalOpParm(result, thissop,
"channelprims", cookparms.
getCookTime(), 0);
673 if (!thissop)
return getPackLockGeometry();
675 OP_Utils::evalOpParm(result, thissop,
"packlockgeometry", cookparms.
getCookTime(), 0);
683 if (!thissop)
return getExplicitWires();
685 OP_Utils::evalOpParm(result, thissop,
"explicitwires", cookparms.
getCookTime(), 0);
693 if (!thissop)
return getExplicitPorts();
695 OP_Utils::evalOpParm(result, thissop,
"explicitports", cookparms.
getCookTime(), 0);
703 if (!thissop)
return getUpdateOnMove();
705 OP_Utils::evalOpParm(result, thissop,
"updateonmove", cookparms.
getCookTime(), 0);
713 if (!thissop)
return getUpdateOnRename();
715 OP_Utils::evalOpParm(result, thissop,
"updateonrename", cookparms.
getCookTime(), 0);
725 bool myFlattenmultiparm;
727 bool myEvaluateparms;
729 bool myPackLockGeometry;
730 bool myExplicitWires;
731 bool myExplicitPorts;
733 bool myUpdateOnRename;
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
SOP_Node * getNode() const
bool getExplicitPorts() const
bool opUpdateOnRename(const SOP_NodeVerb::CookParms &cookparms) const
bool getUpdateOnMove() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
exint bread(int32 *buffer, exint asize=1)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setName(const UT_StringHolder &val)
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)
const OP_Context & context() const
static void loadData(UT_IStream &is, int64 &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void copyFrom(const OP_NodeParms *src) override
const UT_StringHolder & getCategory() const
UT_StringHolder opName(const SOP_NodeVerb::CookParms &cookparms) const
void setExplicitPorts(bool val)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, fpreal64 &v)
void setUpdateOnRename(bool val)
void setCategory(const UT_StringHolder &val)
**But if you need a result
bool opExplicitPorts(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, fpreal64 v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
const UT_StringHolder & getName() const
bool opEvaluateparms(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setEvaluateparms(bool val)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool getFlattenmultiparm() const
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
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setExplicitWires(bool val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool opExplicitWires(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setChannelPrims(bool val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setPackLockGeometry(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool operator==(const SOP_AttribFromParmParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
const UT_StringHolder & getNodepath() const
static void saveData(std::ostream &os, bool v)
const char * getNestParmName(TempIndex fieldnum) const override
bool getExplicitWires() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setMethod(Method val)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Vector4D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opNodepath(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
const UT_StringHolder & getParmfilter() const
bool operator!=(const SOP_AttribFromParmParms &src) const
bool opUpdateOnMove(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCategory(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
DEP_MicroNode * depnode() const
bool getFlattenramp() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setNodepath(const UT_StringHolder &val)
bool opPackLockGeometry(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool opChannelPrims(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool getUpdateOnRename() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opFlattenmultiparm(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
UT_StringHolder opParmfilter(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool getEvaluateparms() const
void setParmfilter(const UT_StringHolder &val)
const char * findChar(int c) const
bool opFlattenramp(const SOP_NodeVerb::CookParms &cookparms) const
void setUpdateOnMove(bool val)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool getPackLockGeometry() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setFlattenramp(bool val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void save(std::ostream &os) const
SOP_AttribFromParmParms()
bool getChannelPrims() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setFlattenmultiparm(bool val)
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept