23 namespace SOP_WireEnums
34 using namespace UT::Literal;
55 myScaleAttrib =
"pscale"_UTsh;
71 if (myGroup != src.myGroup)
return false;
72 if (myRadius != src.myRadius)
return false;
73 if (myUseScaleAttrib != src.myUseScaleAttrib)
return false;
74 if (myScaleAttrib != src.myScaleAttrib)
return false;
75 if (myCorners != src.myCorners)
return false;
76 if (myCaps != src.myCaps)
return false;
77 if (myRemove != src.myRemove)
return false;
93 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
96 graph->
evalOpParm(myRadius, nodeidx,
"radius", time, 0);
99 graph->
evalOpParm(myUseScaleAttrib, nodeidx,
"usescaleattrib", time, 0);
100 myScaleAttrib =
"pscale"_UTsh;
101 if (
true && ( (
true&&!(((
int64(getUseScaleAttrib())==0)))) ) )
102 graph->
evalOpParm(myScaleAttrib, nodeidx,
"scaleattrib", time, 0);
105 graph->
evalOpParm(myCorners, nodeidx,
"corners", time, 0);
108 graph->
evalOpParm(myCaps, nodeidx,
"caps", time, 0);
111 graph->
evalOpParm(myRemove, nodeidx,
"remove", time, 0);
127 template <
typename T>
134 if (idx.
size() != instance.
size()+1)
139 coerceValue(value, myGroup);
142 coerceValue(value, myRadius);
145 coerceValue(value, myUseScaleAttrib);
148 coerceValue(value, myScaleAttrib);
151 coerceValue(value, myCorners);
154 coerceValue(value, myCaps);
157 coerceValue(value, myRemove);
173 { doGetParmValue(idx, instance, value); }
175 { doGetParmValue(idx, instance, value); }
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 { doGetParmValue(idx, instance, value); }
183 { doGetParmValue(idx, instance, value); }
185 { doGetParmValue(idx, instance, value); }
187 { doGetParmValue(idx, instance, value); }
189 { doGetParmValue(idx, instance, value); }
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 template <
typename T>
202 if (idx.
size() != instance.
size()+1)
207 coerceValue(myGroup, ( ( value ) ));
210 coerceValue(myRadius, ( ( value ) ));
213 coerceValue(myUseScaleAttrib, clampMinValue(0, clampMaxValue(1, value ) ));
216 coerceValue(myScaleAttrib, ( ( value ) ));
219 coerceValue(myCorners, ( ( value ) ));
222 coerceValue(myCaps, ( ( value ) ));
225 coerceValue(myRemove, ( ( 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 "usescaleattrib";
279 return "scaleattrib";
293 if (fieldnum.
size() < 1)
294 return PARM_UNSUPPORTED;
313 return PARM_UNSUPPORTED;
349 loadData(is, rampdata);
367 int typelen = colon - data.
buffer();
381 {
int64 iv =
v; UTwrite(os, &iv); }
383 { UTwrite<fpreal64>(os, &
v); }
385 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
387 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
388 UTwrite<fpreal64>(os, &v.
z()); }
390 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
391 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
403 if (s) s->save(ostr);
405 saveData(os, result);
412 ostr << s->getDataTypeToken();
417 saveData(os, result);
421 void save(std::ostream &os)
const
425 saveData(os, myGroup);
426 saveData(os, myRadius);
427 saveData(os, myUseScaleAttrib);
428 saveData(os, myScaleAttrib);
429 saveData(os, myCorners);
430 saveData(os, myCaps);
431 saveData(os, myRemove);
444 loadData(is, myGroup);
445 loadData(is, myRadius);
446 loadData(is, myUseScaleAttrib);
447 loadData(is, myScaleAttrib);
448 loadData(is, myCorners);
449 loadData(is, myCaps);
450 loadData(is, myRemove);
460 if (!thissop)
return getGroup();
462 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
470 if (!thissop)
return getRadius();
472 OP_Utils::evalOpParm(result, thissop,
"radius", cookparms.
getCookTime(), 0);
480 if (!thissop)
return getUseScaleAttrib();
482 OP_Utils::evalOpParm(result, thissop,
"usescaleattrib", cookparms.
getCookTime(), 0);
490 if (!thissop)
return getScaleAttrib();
492 OP_Utils::evalOpParm(result, thissop,
"scaleattrib", cookparms.
getCookTime(), 0);
500 if (!thissop)
return getCorners();
502 OP_Utils::evalOpParm(result, thissop,
"corners", cookparms.
getCookTime(), 0);
510 if (!thissop)
return getCaps();
512 OP_Utils::evalOpParm(result, thissop,
"caps", cookparms.
getCookTime(), 0);
520 if (!thissop)
return getRemove();
522 OP_Utils::evalOpParm(result, thissop,
"remove", cookparms.
getCookTime(), 0);
529 int64 myUseScaleAttrib;
const char * getNestParmName(TempIndex fieldnum) const override
bool operator!=(const SOP_WireParms &src) const
fpreal64 opRadius(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
void setUseScaleAttrib(UseScaleAttrib val)
static void loadData(UT_IStream &is, fpreal64 &v)
void setGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opRemove(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opScaleAttrib(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, bool 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.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, int64 &v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UseScaleAttrib getUseScaleAttrib() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, int64 v)
exint getNestNumParms(TempIndex idx) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(UseScaleAttrib enum_value)
UseScaleAttrib opUseScaleAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
DEP_MicroNode * depnode() const
void copyFrom(const OP_NodeParms *src) override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
bool opCorners(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const char * findChar(int c) const
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & y() noexcept
fpreal64 getRadius() const
void setCorners(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opCaps(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool operator==(const SOP_WireParms &src) const
static void saveData(std::ostream &os, UT_Vector2D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
const UT_StringHolder & getScaleAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setScaleAttrib(const UT_StringHolder &val)
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setRadius(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept