20 using namespace UT::Literal;
23 namespace SOP_EnumerateEnums
53 myUsePieceAttrib =
false;
54 myPieceAttrib =
"name"_sh;
56 myAttribname =
"index"_sh;
58 myPrefix =
"piece"_sh;
68 if (myGroup != src.myGroup)
return false;
69 if (myGroupType != src.myGroupType)
return false;
70 if (myUsePieceAttrib != src.myUsePieceAttrib)
return false;
71 if (myPieceAttrib != src.myPieceAttrib)
return false;
72 if (myPieceMode != src.myPieceMode)
return false;
73 if (myAttribname != src.myAttribname)
return false;
74 if (myAttribType != src.myAttribType)
return false;
75 if (myPrefix != src.myPrefix)
return false;
93 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
96 graph->
evalOpParm(myGroupType, nodeidx,
"grouptype", time, 0);
97 myUsePieceAttrib =
false;
99 graph->
evalOpParm(myUsePieceAttrib, nodeidx,
"usepieceattrib", time, 0);
100 myPieceAttrib =
"name"_sh;
101 if (
true && ( (!(((getUsePieceAttrib()==0)))) ) )
102 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, 0);
104 if (
true && ( (!(((getUsePieceAttrib()==0))||((getUsePieceAttrib()==0)))) ) )
105 graph->
evalOpParm(myPieceMode, nodeidx,
"piecemode", time, 0);
106 myAttribname =
"index"_sh;
108 graph->
evalOpParm(myAttribname, nodeidx,
"attribname", time, 0);
111 graph->
evalOpParm(myAttribType, nodeidx,
"attribtype", time, 0);
112 myPrefix =
"piece"_sh;
113 if (
true && ( (!(((
int64(getAttribType())!=1))||((
int64(getAttribType())!=1)))) ) )
114 graph->
evalOpParm(myPrefix, nodeidx,
"prefix", time, 0);
130 template <
typename T>
137 if (idx.
size() != instance.
size()+1)
142 coerceValue(value, myGroup);
145 coerceValue(value, myGroupType);
148 coerceValue(value, myUsePieceAttrib);
151 coerceValue(value, myPieceAttrib);
154 coerceValue(value, myPieceMode);
157 coerceValue(value, myAttribname);
160 coerceValue(value, myAttribType);
163 coerceValue(value, myPrefix);
170 { doGetParmValue(idx, instance, value); }
172 { doGetParmValue(idx, instance, value); }
174 { doGetParmValue(idx, instance, value); }
176 { doGetParmValue(idx, instance, value); }
178 { doGetParmValue(idx, instance, value); }
180 { doGetParmValue(idx, instance, value); }
182 { doGetParmValue(idx, instance, value); }
184 { doGetParmValue(idx, instance, value); }
186 { doGetParmValue(idx, instance, value); }
188 { doGetParmValue(idx, instance, value); }
190 { doGetParmValue(idx, instance, value); }
192 template <
typename T>
199 if (idx.
size() != instance.
size()+1)
204 coerceValue(myGroup, value);
207 coerceValue(myGroupType, value);
210 coerceValue(myUsePieceAttrib, value);
213 coerceValue(myPieceAttrib, value);
216 coerceValue(myPieceMode, value);
219 coerceValue(myAttribname, value);
222 coerceValue(myAttribType, value);
225 coerceValue(myPrefix, value);
232 { doSetParmValue(idx, instance, value); }
234 { doSetParmValue(idx, instance, value); }
236 { doSetParmValue(idx, instance, value); }
238 { doSetParmValue(idx, instance, value); }
240 { doSetParmValue(idx, instance, value); }
242 { doSetParmValue(idx, instance, value); }
244 { doSetParmValue(idx, instance, value); }
246 { doSetParmValue(idx, instance, value); }
248 { doSetParmValue(idx, instance, value); }
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, value); }
268 if (fieldnum.
size() < 1)
277 return "usepieceattrib";
279 return "pieceattrib";
295 if (fieldnum.
size() < 1)
296 return PARM_UNSUPPORTED;
317 return PARM_UNSUPPORTED;
353 loadData(is, rampdata);
371 int typelen = colon - data.
buffer();
385 {
int64 iv =
v; UTwrite(os, &iv); }
387 { UTwrite<fpreal64>(os, &
v); }
389 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
391 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
392 UTwrite<fpreal64>(os, &v.
z()); }
394 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
395 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
407 if (s) s->save(ostr);
409 saveData(os, result);
416 ostr << s->getDataTypeToken();
421 saveData(os, result);
425 void save(std::ostream &os)
const
429 saveData(os, myGroup);
430 saveData(os, myGroupType);
431 saveData(os, myUsePieceAttrib);
432 saveData(os, myPieceAttrib);
433 saveData(os, myPieceMode);
434 saveData(os, myAttribname);
435 saveData(os, myAttribType);
436 saveData(os, myPrefix);
449 loadData(is, myGroup);
450 loadData(is, myGroupType);
451 loadData(is, myUsePieceAttrib);
452 loadData(is, myPieceAttrib);
453 loadData(is, myPieceMode);
454 loadData(is, myAttribname);
455 loadData(is, myAttribType);
456 loadData(is, myPrefix);
466 if (!thissop)
return getGroup();
468 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
476 if (!thissop)
return getGroupType();
478 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
486 if (!thissop)
return getUsePieceAttrib();
488 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
496 if (!thissop)
return getPieceAttrib();
498 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
506 if (!thissop)
return getPieceMode();
508 OP_Utils::evalOpParm(result, thissop,
"piecemode", cookparms.
getCookTime(), 0);
516 if (!thissop)
return getAttribname();
518 OP_Utils::evalOpParm(result, thissop,
"attribname", cookparms.
getCookTime(), 0);
526 if (!thissop)
return getAttribType();
528 OP_Utils::evalOpParm(result, thissop,
"attribtype", cookparms.
getCookTime(), 0);
536 if (!thissop)
return getPrefix();
538 OP_Utils::evalOpParm(result, thissop,
"prefix", cookparms.
getCookTime(), 0);
545 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
GLuint const GLfloat * val
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)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_StringHolder opPrefix(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() 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
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)
void setGroup(const UT_StringHolder &val)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, bool &v)
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 copyFrom(const SOP_NodeParms *src) 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
typedef INT(WINAPI *PFNWGLGETGPUINFOAMDPROC)(UINT id
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.
GLint GLenum GLsizei GLint GLsizei const void * data
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)
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
DEP_MicroNode * depnode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const 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)
Utility class for containing a color ramp.
GLdouble GLdouble GLdouble r
static void saveData(std::ostream &os, fpreal64 v)
~SOP_EnumerateParms() override
static void loadData(UT_IStream &is, UT_Vector3D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
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
UT_StringHolder opAttribname(const SOP_NodeVerb::CookParms &cookparms) const
void setUsePieceAttrib(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
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
GLsizei const GLfloat * value
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
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, int64 v)
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override