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;
136 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
139 graph->
evalOpParm(myGroupType, nodeidx,
"grouptype", time, graph->
isDirect()?
nullptr:depnode);
140 myUsePieceAttrib =
false;
142 graph->
evalOpParm(myUsePieceAttrib, nodeidx,
"usepieceattrib", time, graph->
isDirect()?
nullptr:depnode);
143 myPieceAttrib =
"name"_UTsh;
144 if (
true && ( (
true&&!(((getUsePieceAttrib()==0)))) ) )
145 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, graph->
isDirect()?
nullptr:depnode);
147 if (
true && ( (
true&&!(((getUsePieceAttrib()==0))||((getUsePieceAttrib()==0)))) ) )
148 graph->
evalOpParm(myPieceMode, nodeidx,
"piecemode", time, graph->
isDirect()?
nullptr:depnode);
149 myAttribname =
"index"_UTsh;
151 graph->
evalOpParm(myAttribname, nodeidx,
"attribname", time, graph->
isDirect()?
nullptr:depnode);
154 graph->
evalOpParm(myAttribType, nodeidx,
"attribtype", time, graph->
isDirect()?
nullptr:depnode);
155 myPrefix =
"piece"_UTsh;
156 if (
true && ( (
true&&!(((
int64(getAttribType())!=1))||((
int64(getAttribType())!=1)))) ) )
157 graph->
evalOpParm(myPrefix, nodeidx,
"prefix", time, graph->
isDirect()?
nullptr:depnode);
173 template <
typename T>
180 if (idx.
size() != instance.
size()+1)
185 coerceValue(value, myGroup);
188 coerceValue(value, myGroupType);
191 coerceValue(value, myUsePieceAttrib);
194 coerceValue(value, myPieceAttrib);
197 coerceValue(value, myPieceMode);
200 coerceValue(value, myAttribname);
203 coerceValue(value, myAttribType);
206 coerceValue(value, myPrefix);
222 { doGetParmValue(idx, instance, value); }
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 { doGetParmValue(idx, instance, value); }
230 { doGetParmValue(idx, instance, value); }
232 { doGetParmValue(idx, instance, value); }
234 { doGetParmValue(idx, instance, value); }
236 { doGetParmValue(idx, instance, value); }
238 { doGetParmValue(idx, instance, value); }
240 { doGetParmValue(idx, instance, value); }
242 { doGetParmValue(idx, instance, value); }
244 template <
typename T>
251 if (idx.
size() != instance.
size()+1)
256 coerceValue(myGroup, ( ( value ) ));
259 coerceValue(myGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
262 coerceValue(myUsePieceAttrib, ( ( value ) ));
265 coerceValue(myPieceAttrib, ( ( value ) ));
268 coerceValue(myPieceMode, clampMinValue(0, clampMaxValue(1, value ) ));
271 coerceValue(myAttribname, ( ( value ) ));
274 coerceValue(myAttribType, clampMinValue(0, clampMaxValue(1, value ) ));
277 coerceValue(myPrefix, ( ( value ) ));
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
320 if (fieldnum.
size() < 1)
329 return "usepieceattrib";
331 return "pieceattrib";
347 if (fieldnum.
size() < 1)
348 return PARM_UNSUPPORTED;
369 return PARM_UNSUPPORTED;
405 loadData(is, rampdata);
423 int typelen = colon - data.
buffer();
437 {
int64 iv =
v; UTwrite(os, &iv); }
439 { UTwrite<fpreal64>(os, &
v); }
441 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
443 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
444 UTwrite<fpreal64>(os, &v.
z()); }
446 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
447 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
459 if (s) s->save(ostr);
461 saveData(os, result);
468 ostr << s->getDataTypeToken();
473 saveData(os, result);
477 void save(std::ostream &os)
const
481 saveData(os, myGroup);
482 saveData(os, myGroupType);
483 saveData(os, myUsePieceAttrib);
484 saveData(os, myPieceAttrib);
485 saveData(os, myPieceMode);
486 saveData(os, myAttribname);
487 saveData(os, myAttribType);
488 saveData(os, myPrefix);
501 loadData(is, myGroup);
502 loadData(is, myGroupType);
503 loadData(is, myUsePieceAttrib);
504 loadData(is, myPieceAttrib);
505 loadData(is, myPieceMode);
506 loadData(is, myAttribname);
507 loadData(is, myAttribType);
508 loadData(is, myPrefix);
518 if (!thissop)
return getGroup();
520 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
528 if (!thissop)
return getGroupType();
530 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
538 if (!thissop)
return getUsePieceAttrib();
540 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
548 if (!thissop)
return getPieceAttrib();
550 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
558 if (!thissop)
return getPieceMode();
560 OP_Utils::evalOpParm(result, thissop,
"piecemode", cookparms.
getCookTime(), 0);
568 if (!thissop)
return getAttribname();
570 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
578 if (!thissop)
return getAttribType();
580 OP_Utils::evalOpParm(result, thissop,
"attribtype", cookparms.
getCookTime(), 0);
588 if (!thissop)
return getPrefix();
590 OP_Utils::evalOpParm(result, thissop,
"prefix", cookparms.
getCookTime(), 0);
597 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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
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