23 namespace SOP_WindingNumberEnums
36 using namespace UT::Literal;
56 myQueryPoints =
""_UTsh;
57 myMeshPrims =
""_UTsh;
59 myAttrib =
"winding_number"_UTsh;
60 myAsSolidAngle =
false;
62 myFullAccuracy =
false;
76 if (myQueryPoints != src.myQueryPoints)
return false;
77 if (myMeshPrims != src.myMeshPrims)
return false;
78 if (myType != src.myType)
return false;
79 if (myAttrib != src.myAttrib)
return false;
80 if (myAsSolidAngle != src.myAsSolidAngle)
return false;
81 if (myNegate != src.myNegate)
return false;
82 if (myFullAccuracy != src.myFullAccuracy)
return false;
83 if (myAccuracyScale != src.myAccuracyScale)
return false;
97 myQueryPoints =
""_UTsh;
99 graph->
evalOpParm(myQueryPoints, nodeidx,
"querypoints", time, 0);
100 myMeshPrims =
""_UTsh;
102 graph->
evalOpParm(myMeshPrims, nodeidx,
"meshprims", time, 0);
105 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
106 myAttrib =
"winding_number"_UTsh;
108 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
109 myAsSolidAngle =
false;
111 graph->
evalOpParm(myAsSolidAngle, nodeidx,
"assolidangle", time, 0);
114 graph->
evalOpParm(myNegate, nodeidx,
"negate", time, 0);
115 myFullAccuracy =
false;
117 graph->
evalOpParm(myFullAccuracy, nodeidx,
"fullaccuracy", time, 0);
119 if (
true && ( (
true&&!(((getFullAccuracy()==1)))) ) )
120 graph->
evalOpParm(myAccuracyScale, nodeidx,
"accuracyscale", time, 0);
136 template <
typename T>
143 if (idx.
size() != instance.
size()+1)
148 coerceValue(value, myQueryPoints);
151 coerceValue(value, myMeshPrims);
154 coerceValue(value, myType);
157 coerceValue(value, myAttrib);
160 coerceValue(value, myAsSolidAngle);
163 coerceValue(value, myNegate);
166 coerceValue(value, myFullAccuracy);
169 coerceValue(value, myAccuracyScale);
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 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 template <
typename T>
214 if (idx.
size() != instance.
size()+1)
219 coerceValue(myQueryPoints, ( ( value ) ));
222 coerceValue(myMeshPrims, ( ( value ) ));
225 coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
228 coerceValue(myAttrib, ( ( value ) ));
231 coerceValue(myAsSolidAngle, ( ( value ) ));
234 coerceValue(myNegate, ( ( value ) ));
237 coerceValue(myFullAccuracy, ( ( value ) ));
240 coerceValue(myAccuracyScale, clampMinValue(1, ( value ) ));
247 { doSetParmValue(idx, instance, value); }
249 { doSetParmValue(idx, instance, value); }
251 { doSetParmValue(idx, instance, value); }
253 { doSetParmValue(idx, instance, value); }
255 { doSetParmValue(idx, instance, value); }
257 { doSetParmValue(idx, instance, value); }
259 { doSetParmValue(idx, instance, value); }
261 { doSetParmValue(idx, instance, value); }
263 { doSetParmValue(idx, instance, value); }
265 { doSetParmValue(idx, instance, value); }
267 { doSetParmValue(idx, instance, value); }
283 if (fieldnum.
size() < 1)
288 return "querypoints";
296 return "assolidangle";
300 return "fullaccuracy";
302 return "accuracyscale";
310 if (fieldnum.
size() < 1)
311 return PARM_UNSUPPORTED;
332 return PARM_UNSUPPORTED;
368 loadData(is, rampdata);
386 int typelen = colon - data.
buffer();
400 {
int64 iv =
v; UTwrite(os, &iv); }
402 { UTwrite<fpreal64>(os, &
v); }
404 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
406 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
407 UTwrite<fpreal64>(os, &v.
z()); }
409 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
410 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
422 if (s) s->save(ostr);
424 saveData(os, result);
431 ostr << s->getDataTypeToken();
436 saveData(os, result);
440 void save(std::ostream &os)
const
444 saveData(os, myQueryPoints);
445 saveData(os, myMeshPrims);
446 saveData(os, myType);
447 saveData(os, myAttrib);
448 saveData(os, myAsSolidAngle);
449 saveData(os, myNegate);
450 saveData(os, myFullAccuracy);
451 saveData(os, myAccuracyScale);
464 loadData(is, myQueryPoints);
465 loadData(is, myMeshPrims);
466 loadData(is, myType);
467 loadData(is, myAttrib);
468 loadData(is, myAsSolidAngle);
469 loadData(is, myNegate);
470 loadData(is, myFullAccuracy);
471 loadData(is, myAccuracyScale);
481 if (!thissop)
return getQueryPoints();
483 OP_Utils::evalOpParm(result, thissop,
"querypoints", cookparms.
getCookTime(), 0);
491 if (!thissop)
return getMeshPrims();
493 OP_Utils::evalOpParm(result, thissop,
"meshprims", cookparms.
getCookTime(), 0);
501 if (!thissop)
return getType();
503 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
511 if (!thissop)
return getAttrib();
513 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
521 if (!thissop)
return getAsSolidAngle();
523 OP_Utils::evalOpParm(result, thissop,
"assolidangle", cookparms.
getCookTime(), 0);
531 if (!thissop)
return getNegate();
533 OP_Utils::evalOpParm(result, thissop,
"negate", cookparms.
getCookTime(), 0);
541 if (!thissop)
return getFullAccuracy();
543 OP_Utils::evalOpParm(result, thissop,
"fullaccuracy", cookparms.
getCookTime(), 0);
551 if (!thissop)
return getAccuracyScale();
553 OP_Utils::evalOpParm(result, thissop,
"accuracyscale", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, UT_Matrix2D v)
void setFullAccuracy(bool val)
void copyFrom(const OP_NodeParms *src) override
SOP_Node * getNode() const
fpreal64 getAccuracyScale() const
const UT_StringHolder & getAttrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &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
void setAsSolidAngle(bool val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const UT_StringHolder & getMeshPrims() const
bool load(UT_IStream &is)
void setAttrib(const UT_StringHolder &val)
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_StringHolder opQueryPoints(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
bool getAsSolidAngle() const
void loadFromOpSubclass(const LoadParms &loadparms) override
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
An output stream object that owns its own string buffer storage.
const UT_StringHolder & getQueryPoints() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
**But if you need a result
bool operator==(const SOP_WindingNumberParms &src) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator!=(const SOP_WindingNumberParms &src) const
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void save(std::ostream &os) const
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool getFullAccuracy() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_StringHolder opMeshPrims(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setAccuracyScale(fpreal64 val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
fpreal64 opAccuracyScale(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
bool opAsSolidAngle(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
DEP_MicroNode * depnode() const
ParmType getNestParmType(TempIndex fieldnum) const override
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
fpreal getCookTime() const
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, bool v)
void setQueryPoints(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool opNegate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, int64 &v)
bool opFullAccuracy(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setMeshPrims(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override