23 namespace SOP_AttribFillEnums
35 using namespace UT::Literal;
63 myUnreachableval = -1;
76 if (myMode != src.myMode)
return false;
77 if (myAttrib != src.myAttrib)
return false;
78 if (mySource != src.mySource)
return false;
79 if (myWeights != src.myWeights)
return false;
80 if (mySpeed != src.mySpeed)
return false;
81 if (myBoundary != src.myBoundary)
return false;
82 if (myMindist != src.myMindist)
return false;
83 if (myMinspeed != src.myMinspeed)
return false;
84 if (myTimestep != src.myTimestep)
return false;
85 if (myUnreachableval != src.myUnreachableval)
return false;
101 graph->
evalOpParm(myMode, nodeidx,
"mode", time, 0);
104 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
106 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
107 graph->
evalOpParm(mySource, nodeidx,
"source", time, 0);
109 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
110 graph->
evalOpParm(myWeights, nodeidx,
"weights", time, 0);
112 if (
true && ( (
true&&!(((
int64(getMode())!=0)&&(
int64(getMode())!=2)))) ) )
113 graph->
evalOpParm(mySpeed, nodeidx,
"speed", time, 0);
114 myBoundary =
""_UTsh;
116 graph->
evalOpParm(myBoundary, nodeidx,
"boundary", time, 0);
118 if (
true && ( (
true&&!(((
int64(getMode())!=1)&&(
int64(getMode())!=2)))) ) )
119 graph->
evalOpParm(myMindist, nodeidx,
"mindist", time, 0);
121 if (
true && ( (
true&&!(((
int64(getMode())!=2)))) ) )
122 graph->
evalOpParm(myMinspeed, nodeidx,
"minspeed", time, 0);
124 if (
true && ( (
true&&!(((
int64(getMode())!=2)))) ) )
125 graph->
evalOpParm(myTimestep, nodeidx,
"timestep", time, 0);
126 myUnreachableval = -1;
127 if (
true && ( (
true&&!(((
int64(getMode())!=0)))) ) )
128 graph->
evalOpParm(myUnreachableval, nodeidx,
"unreachableval", time, 0);
144 template <
typename T>
151 if (idx.
size() != instance.
size()+1)
156 coerceValue(value, myMode);
159 coerceValue(value, myAttrib);
162 coerceValue(value, mySource);
165 coerceValue(value, myWeights);
168 coerceValue(value, mySpeed);
171 coerceValue(value, myBoundary);
174 coerceValue(value, myMindist);
177 coerceValue(value, myMinspeed);
180 coerceValue(value, myTimestep);
183 coerceValue(value, myUnreachableval);
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 template <
typename T>
228 if (idx.
size() != instance.
size()+1)
233 coerceValue(myMode, clampMinValue(0, clampMaxValue(2, value ) ));
236 coerceValue(myAttrib, ( ( value ) ));
239 coerceValue(mySource, ( ( value ) ));
242 coerceValue(myWeights, ( ( value ) ));
245 coerceValue(mySpeed, ( ( value ) ));
248 coerceValue(myBoundary, ( ( value ) ));
251 coerceValue(myMindist, clampMinValue(0, ( value ) ));
254 coerceValue(myMinspeed, clampMinValue(0, ( value ) ));
257 coerceValue(myTimestep, clampMinValue(0, ( value ) ));
260 coerceValue(myUnreachableval, ( ( value ) ));
267 { doSetParmValue(idx, instance, value); }
269 { doSetParmValue(idx, instance, value); }
271 { doSetParmValue(idx, instance, value); }
273 { doSetParmValue(idx, instance, value); }
275 { doSetParmValue(idx, instance, value); }
277 { doSetParmValue(idx, instance, value); }
279 { doSetParmValue(idx, instance, value); }
281 { doSetParmValue(idx, instance, value); }
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
287 { doSetParmValue(idx, instance, value); }
303 if (fieldnum.
size() < 1)
326 return "unreachableval";
334 if (fieldnum.
size() < 1)
335 return PARM_UNSUPPORTED;
360 return PARM_UNSUPPORTED;
396 loadData(is, rampdata);
414 int typelen = colon - data.
buffer();
428 {
int64 iv =
v; UTwrite(os, &iv); }
430 { UTwrite<fpreal64>(os, &
v); }
432 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
434 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
435 UTwrite<fpreal64>(os, &v.
z()); }
437 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
438 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
450 if (s) s->save(ostr);
452 saveData(os, result);
459 ostr << s->getDataTypeToken();
464 saveData(os, result);
468 void save(std::ostream &os)
const
472 saveData(os, myMode);
473 saveData(os, myAttrib);
474 saveData(os, mySource);
475 saveData(os, myWeights);
476 saveData(os, mySpeed);
477 saveData(os, myBoundary);
478 saveData(os, myMindist);
479 saveData(os, myMinspeed);
480 saveData(os, myTimestep);
481 saveData(os, myUnreachableval);
494 loadData(is, myMode);
495 loadData(is, myAttrib);
496 loadData(is, mySource);
497 loadData(is, myWeights);
498 loadData(is, mySpeed);
499 loadData(is, myBoundary);
500 loadData(is, myMindist);
501 loadData(is, myMinspeed);
502 loadData(is, myTimestep);
503 loadData(is, myUnreachableval);
513 if (!thissop)
return getMode();
515 OP_Utils::evalOpParm(result, thissop,
"mode", cookparms.
getCookTime(), 0);
523 if (!thissop)
return getAttrib();
525 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
535 OP_Utils::evalOpParm(result, thissop,
"source", cookparms.
getCookTime(), 0);
543 if (!thissop)
return getWeights();
545 OP_Utils::evalOpParm(result, thissop,
"weights", cookparms.
getCookTime(), 0);
553 if (!thissop)
return getSpeed();
555 OP_Utils::evalOpParm(result, thissop,
"speed", cookparms.
getCookTime(), 0);
563 if (!thissop)
return getBoundary();
565 OP_Utils::evalOpParm(result, thissop,
"boundary", cookparms.
getCookTime(), 0);
573 if (!thissop)
return getMindist();
575 OP_Utils::evalOpParm(result, thissop,
"mindist", cookparms.
getCookTime(), 0);
583 if (!thissop)
return getMinspeed();
585 OP_Utils::evalOpParm(result, thissop,
"minspeed", cookparms.
getCookTime(), 0);
593 if (!thissop)
return getTimestep();
595 OP_Utils::evalOpParm(result, thissop,
"timestep", cookparms.
getCookTime(), 0);
603 if (!thissop)
return getUnreachableval();
605 OP_Utils::evalOpParm(result, thissop,
"unreachableval", cookparms.
getCookTime(), 0);
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 opMindist(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opSpeed(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
fpreal64 opMinspeed(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const UT_StringHolder & getAttrib() const
static void saveData(std::ostream &os, UT_StringHolder s)
void setMinspeed(fpreal64 val)
Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
void setUnreachableval(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_StringHolder &v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
void setMindist(fpreal64 val)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
fpreal64 opUnreachableval(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opSource(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool operator!=(const SOP_AttribFillParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
**But if you need a result
const UT_StringHolder & getBoundary() const
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
exint getNestNumParms(TempIndex idx) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
fpreal64 opTimestep(const SOP_NodeVerb::CookParms &cookparms) const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, int64 v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
const UT_StringHolder & getWeights() const
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void save(std::ostream &os) const
UT_StringHolder opWeights(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, fpreal64 v)
fpreal64 getMindist() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
fpreal64 getUnreachableval() const
void setBoundary(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, int64 &v)
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Vector2D v)
bool operator==(const SOP_AttribFillParms &src) const
bool isParmColorRamp(exint idx) const override
const UT_StringHolder & getSpeed() const
fpreal64 getMinspeed() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setTimestep(fpreal64 val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GT_API const UT_StringHolder version
void setWeights(const UT_StringHolder &val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setSource(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
void setAttrib(const UT_StringHolder &val)
Utility class for containing a color ramp.
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
UT_StringHolder opBoundary(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const UT_StringHolder & getSource() const
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
const char * findChar(int c) const
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(Mode enum_value)
fpreal64 getTimestep() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setSpeed(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, fpreal64 &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept