22 using namespace UT::Literal;
25 namespace SOP_WindingNumberEnums
44 myQueryPoints =
""_sh;
47 myAttrib =
"winding_number"_sh;
48 myAsSolidAngle =
false;
50 myFullAccuracy =
false;
61 if (myQueryPoints != src.myQueryPoints)
return false;
62 if (myMeshPrims != src.myMeshPrims)
return false;
63 if (myType != src.myType)
return false;
64 if (myAttrib != src.myAttrib)
return false;
65 if (myAsSolidAngle != src.myAsSolidAngle)
return false;
66 if (myNegate != src.myNegate)
return false;
67 if (myFullAccuracy != src.myFullAccuracy)
return false;
68 if (myAccuracyScale != src.myAccuracyScale)
return false;
82 myQueryPoints =
""_sh;
84 graph->
evalOpParm(myQueryPoints, nodeidx,
"querypoints", time, 0);
87 graph->
evalOpParm(myMeshPrims, nodeidx,
"meshprims", time, 0);
90 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
91 myAttrib =
"winding_number"_sh;
93 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
94 myAsSolidAngle =
false;
96 graph->
evalOpParm(myAsSolidAngle, nodeidx,
"assolidangle", time, 0);
99 graph->
evalOpParm(myNegate, nodeidx,
"negate", time, 0);
100 myFullAccuracy =
false;
102 graph->
evalOpParm(myFullAccuracy, nodeidx,
"fullaccuracy", time, 0);
104 if (
true && ( (
true&&!(((getFullAccuracy()==1)))) ) )
105 graph->
evalOpParm(myAccuracyScale, nodeidx,
"accuracyscale", time, 0);
121 template <
typename T>
128 if (idx.
size() != instance.
size()+1)
133 coerceValue(value, myQueryPoints);
136 coerceValue(value, myMeshPrims);
139 coerceValue(value, myType);
142 coerceValue(value, myAttrib);
145 coerceValue(value, myAsSolidAngle);
148 coerceValue(value, myNegate);
151 coerceValue(value, myFullAccuracy);
154 coerceValue(value, myAccuracyScale);
161 { doGetParmValue(idx, instance, value); }
163 { doGetParmValue(idx, instance, value); }
165 { doGetParmValue(idx, instance, value); }
167 { doGetParmValue(idx, instance, value); }
169 { doGetParmValue(idx, instance, value); }
171 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
190 if (idx.
size() != instance.
size()+1)
195 coerceValue(myQueryPoints, ( ( value ) ));
198 coerceValue(myMeshPrims, ( ( value ) ));
201 coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
204 coerceValue(myAttrib, ( ( value ) ));
207 coerceValue(myAsSolidAngle, ( ( value ) ));
210 coerceValue(myNegate, ( ( value ) ));
213 coerceValue(myFullAccuracy, ( ( value ) ));
216 coerceValue(myAccuracyScale, clampMinValue(1, ( value ) ));
223 { doSetParmValue(idx, instance, value); }
225 { doSetParmValue(idx, instance, value); }
227 { doSetParmValue(idx, instance, value); }
229 { doSetParmValue(idx, instance, value); }
231 { doSetParmValue(idx, instance, value); }
233 { doSetParmValue(idx, instance, value); }
235 { doSetParmValue(idx, instance, value); }
237 { doSetParmValue(idx, instance, value); }
239 { doSetParmValue(idx, instance, value); }
241 { doSetParmValue(idx, instance, value); }
243 { doSetParmValue(idx, instance, value); }
259 if (fieldnum.
size() < 1)
264 return "querypoints";
272 return "assolidangle";
276 return "fullaccuracy";
278 return "accuracyscale";
286 if (fieldnum.
size() < 1)
287 return PARM_UNSUPPORTED;
308 return PARM_UNSUPPORTED;
344 loadData(is, rampdata);
362 int typelen = colon - data.
buffer();
376 {
int64 iv =
v; UTwrite(os, &iv); }
378 { UTwrite<fpreal64>(os, &
v); }
380 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
382 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
383 UTwrite<fpreal64>(os, &v.
z()); }
385 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
386 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
398 if (s) s->save(ostr);
400 saveData(os, result);
407 ostr << s->getDataTypeToken();
412 saveData(os, result);
416 void save(std::ostream &os)
const
420 saveData(os, myQueryPoints);
421 saveData(os, myMeshPrims);
422 saveData(os, myType);
423 saveData(os, myAttrib);
424 saveData(os, myAsSolidAngle);
425 saveData(os, myNegate);
426 saveData(os, myFullAccuracy);
427 saveData(os, myAccuracyScale);
440 loadData(is, myQueryPoints);
441 loadData(is, myMeshPrims);
442 loadData(is, myType);
443 loadData(is, myAttrib);
444 loadData(is, myAsSolidAngle);
445 loadData(is, myNegate);
446 loadData(is, myFullAccuracy);
447 loadData(is, myAccuracyScale);
457 if (!thissop)
return getQueryPoints();
459 OP_Utils::evalOpParm(result, thissop,
"querypoints", cookparms.
getCookTime(), 0);
467 if (!thissop)
return getMeshPrims();
469 OP_Utils::evalOpParm(result, thissop,
"meshprims", cookparms.
getCookTime(), 0);
477 if (!thissop)
return getType();
479 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
487 if (!thissop)
return getAttrib();
489 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
497 if (!thissop)
return getAsSolidAngle();
499 OP_Utils::evalOpParm(result, thissop,
"assolidangle", cookparms.
getCookTime(), 0);
507 if (!thissop)
return getNegate();
509 OP_Utils::evalOpParm(result, thissop,
"negate", cookparms.
getCookTime(), 0);
517 if (!thissop)
return getFullAccuracy();
519 OP_Utils::evalOpParm(result, thissop,
"fullaccuracy", cookparms.
getCookTime(), 0);
527 if (!thissop)
return getAccuracyScale();
529 OP_Utils::evalOpParm(result, thissop,
"accuracyscale", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, UT_Matrix2D v)
void setFullAccuracy(bool val)
SOP_Node * getNode() const
fpreal64 getAccuracyScale() const
const UT_StringHolder & getAttrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setAsSolidAngle(bool val)
~SOP_WindingNumberParms() override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
const UT_StringHolder & getMeshPrims() const
bool load(UT_IStream &is)
void setAttrib(const UT_StringHolder &val)
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
const SOP_GraphProxy * graph() const
bool getAsSolidAngle() const
void loadFromOpSubclass(const LoadParms &loadparms) 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)
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
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
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
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
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 buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setAccuracyScale(fpreal64 val)
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
DEP_MicroNode * depnode() const
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
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)
void copyFrom(const SOP_NodeParms *src) override
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
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)
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)
const OP_Context & context() const
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)
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