23 namespace SOP_EnumerateEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
70 using namespace UT::Literal;
90 myUsePieceAttrib =
false;
91 myPieceAttrib =
"name"_UTsh;
93 myAttribname =
"index"_UTsh;
95 myPrefix =
"piece"_UTsh;
108 if (myGroup != src.myGroup)
return false;
109 if (myGroupType != src.myGroupType)
return false;
110 if (myUsePieceAttrib != src.myUsePieceAttrib)
return false;
111 if (myPieceAttrib != src.myPieceAttrib)
return false;
112 if (myPieceMode != src.myPieceMode)
return false;
113 if (myAttribname != src.myAttribname)
return false;
114 if (myAttribType != src.myAttribType)
return false;
115 if (myPrefix != src.myPrefix)
return false;
133 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
136 graph->
evalOpParm(myGroupType, nodeidx,
"grouptype", time, 0);
137 myUsePieceAttrib =
false;
139 graph->
evalOpParm(myUsePieceAttrib, nodeidx,
"usepieceattrib", time, 0);
140 myPieceAttrib =
"name"_UTsh;
141 if (
true && ( (
true&&!(((getUsePieceAttrib()==0)))) ) )
142 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, 0);
144 if (
true && ( (
true&&!(((getUsePieceAttrib()==0))||((getUsePieceAttrib()==0)))) ) )
145 graph->
evalOpParm(myPieceMode, nodeidx,
"piecemode", time, 0);
146 myAttribname =
"index"_UTsh;
148 graph->
evalOpParm(myAttribname, nodeidx,
"attribname", time, 0);
151 graph->
evalOpParm(myAttribType, nodeidx,
"attribtype", time, 0);
152 myPrefix =
"piece"_UTsh;
153 if (
true && ( (
true&&!(((
int64(getAttribType())!=1))||((
int64(getAttribType())!=1)))) ) )
154 graph->
evalOpParm(myPrefix, nodeidx,
"prefix", time, 0);
170 template <
typename T>
177 if (idx.
size() != instance.
size()+1)
182 coerceValue(value, myGroup);
185 coerceValue(value, myGroupType);
188 coerceValue(value, myUsePieceAttrib);
191 coerceValue(value, myPieceAttrib);
194 coerceValue(value, myPieceMode);
197 coerceValue(value, myAttribname);
200 coerceValue(value, myAttribType);
203 coerceValue(value, myPrefix);
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 template <
typename T>
248 if (idx.
size() != instance.
size()+1)
253 coerceValue(myGroup, ( ( value ) ));
256 coerceValue(myGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
259 coerceValue(myUsePieceAttrib, ( ( value ) ));
262 coerceValue(myPieceAttrib, ( ( value ) ));
265 coerceValue(myPieceMode, clampMinValue(0, clampMaxValue(1, value ) ));
268 coerceValue(myAttribname, ( ( value ) ));
271 coerceValue(myAttribType, clampMinValue(0, clampMaxValue(1, value ) ));
274 coerceValue(myPrefix, ( ( value ) ));
281 { doSetParmValue(idx, instance, value); }
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
287 { doSetParmValue(idx, instance, value); }
289 { doSetParmValue(idx, instance, value); }
291 { doSetParmValue(idx, instance, value); }
293 { doSetParmValue(idx, instance, value); }
295 { doSetParmValue(idx, instance, value); }
297 { doSetParmValue(idx, instance, value); }
299 { doSetParmValue(idx, instance, value); }
301 { doSetParmValue(idx, instance, value); }
317 if (fieldnum.
size() < 1)
326 return "usepieceattrib";
328 return "pieceattrib";
344 if (fieldnum.
size() < 1)
345 return PARM_UNSUPPORTED;
366 return PARM_UNSUPPORTED;
402 loadData(is, rampdata);
420 int typelen = colon - data.
buffer();
434 {
int64 iv =
v; UTwrite(os, &iv); }
436 { UTwrite<fpreal64>(os, &
v); }
438 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
440 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
441 UTwrite<fpreal64>(os, &v.
z()); }
443 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
444 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
456 if (s) s->save(ostr);
458 saveData(os, result);
465 ostr << s->getDataTypeToken();
470 saveData(os, result);
474 void save(std::ostream &os)
const
478 saveData(os, myGroup);
479 saveData(os, myGroupType);
480 saveData(os, myUsePieceAttrib);
481 saveData(os, myPieceAttrib);
482 saveData(os, myPieceMode);
483 saveData(os, myAttribname);
484 saveData(os, myAttribType);
485 saveData(os, myPrefix);
498 loadData(is, myGroup);
499 loadData(is, myGroupType);
500 loadData(is, myUsePieceAttrib);
501 loadData(is, myPieceAttrib);
502 loadData(is, myPieceMode);
503 loadData(is, myAttribname);
504 loadData(is, myAttribType);
505 loadData(is, myPrefix);
515 if (!thissop)
return getGroup();
517 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
525 if (!thissop)
return getGroupType();
527 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
535 if (!thissop)
return getUsePieceAttrib();
537 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
545 if (!thissop)
return getPieceAttrib();
547 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
555 if (!thissop)
return getPieceMode();
557 OP_Utils::evalOpParm(result, thissop,
"piecemode", cookparms.
getCookTime(), 0);
565 if (!thissop)
return getAttribname();
567 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
575 if (!thissop)
return getAttribType();
577 OP_Utils::evalOpParm(result, thissop,
"attribtype", cookparms.
getCookTime(), 0);
585 if (!thissop)
return getPrefix();
587 OP_Utils::evalOpParm(result, thissop,
"prefix", cookparms.
getCookTime(), 0);
594 bool myUsePieceAttrib;
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, UT_Vector2D v)
void setPieceMode(PieceMode val)
SOP_Node * getNode() const
void setAttribname(const UT_StringHolder &val)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const UT_StringHolder & getPrefix() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool getUsePieceAttrib() const
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
GroupType getGroupType() const
static void saveData(std::ostream &os, UT_Matrix2D v)
const OP_Context & context() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_StringHolder opPrefix(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setPrefix(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
An output stream object that owns its own string buffer storage.
PieceMode getPieceMode() const
bool opUsePieceAttrib(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
bool isParmColorRamp(exint idx) const override
void setGroupType(GroupType val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, bool &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
const UT_StringHolder & getPieceAttrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setAttribType(AttribType val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(GroupType enum_value)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
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_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator!=(const SOP_EnumerateParms &src) const
ParmType getNestParmType(TempIndex fieldnum) const override
void save(std::ostream &os) const
AttribType opAttribType(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
const UT_StringHolder & getAttribname() const
AttribType getAttribType() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setPieceAttrib(const UT_StringHolder &val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool operator==(const SOP_EnumerateParms &src) const
fpreal getCookTime() const
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
GroupType opGroupType(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opAttribname(const SOP_NodeVerb::CookParms &cookparms) const
void setUsePieceAttrib(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
PieceMode opPieceMode(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPieceAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, int64 v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override