23 namespace SOP_SoftPeakEnums
34 using namespace UT::Literal;
54 using namespace UT::Literal;
76 using namespace UT::Literal;
96 using namespace UT::Literal;
117 myEnablemaskattrib = 0;
118 myMaskattrib =
"mask"_UTsh;
121 myApplyrolloff =
false;
122 myDistattr =
""_UTsh;
126 myKernel =
"wyvill"_UTsh;
128 myUpdatenmls =
false;
129 myUpdateaffectednmls =
true;
130 myVisualizefalloff = 2;
131 myLeadptattr =
""_UTsh;
144 if (myGroup != src.myGroup)
return false;
145 if (myMask != src.myMask)
return false;
146 if (myEnablemaskattrib != src.myEnablemaskattrib)
return false;
147 if (myMaskattrib != src.myMaskattrib)
return false;
148 if (myDist != src.myDist)
return false;
149 if (myDistmetric != src.myDistmetric)
return false;
150 if (myApplyrolloff != src.myApplyrolloff)
return false;
151 if (myDistattr != src.myDistattr)
return false;
152 if (myRad != src.myRad)
return false;
153 if (myType != src.myType)
return false;
154 if (myTandeg != src.myTandeg)
return false;
155 if (myKernel != src.myKernel)
return false;
156 if (myLeadnml != src.myLeadnml)
return false;
157 if (myUpdatenmls != src.myUpdatenmls)
return false;
158 if (myUpdateaffectednmls != src.myUpdateaffectednmls)
return false;
159 if (myVisualizefalloff != src.myVisualizefalloff)
return false;
160 if (myLeadptattr != src.myLeadptattr)
return false;
182 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
186 myEnablemaskattrib = 0;
188 graph->
evalOpParm(myEnablemaskattrib, nodeidx,
"enablemaskattrib", time, graph->
isDirect()?
nullptr:depnode);
189 myMaskattrib =
"mask"_UTsh;
190 if (
true && ( (
true&&!(((
int64(getEnablemaskattrib())==0)))) ) )
191 graph->
evalOpParm(myMaskattrib, nodeidx,
"maskattrib", time, graph->
isDirect()?
nullptr:depnode);
197 graph->
evalOpParm(myDistmetric, nodeidx,
"distmetric", time, graph->
isDirect()?
nullptr:depnode);
198 myApplyrolloff =
false;
199 if (
true && ( (
true&&!(((
int64(getDistmetric())!=0)))) ) )
200 graph->
evalOpParm(myApplyrolloff, nodeidx,
"applyrolloff", time, graph->
isDirect()?
nullptr:depnode);
201 myDistattr =
""_UTsh;
202 if (
true && ( (
true&&!(((
int64(getDistmetric())!=0)))) ) )
203 graph->
evalOpParm(myDistattr, nodeidx,
"distattr", time, graph->
isDirect()?
nullptr:depnode);
205 if (
true && ( (
true&&!(((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
208 if (
true && ( (
true&&!(((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
211 if (
true && ( (
true&&!(((
int64(getType())!=2))||((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
212 graph->
evalOpParm(myTandeg, nodeidx,
"tandeg", time, graph->
isDirect()?
nullptr:depnode);
213 myKernel =
"wyvill"_UTsh;
214 if (
true && ( (
true&&!(((
int64(getType())!=3))||((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
215 graph->
evalOpParm(myKernel, nodeidx,
"kernel", time, graph->
isDirect()?
nullptr:depnode);
218 graph->
evalOpParm(myLeadnml, nodeidx,
"leadnml", time, graph->
isDirect()?
nullptr:depnode);
219 myUpdatenmls =
false;
221 graph->
evalOpParm(myUpdatenmls, nodeidx,
"updatenmls", time, graph->
isDirect()?
nullptr:depnode);
222 myUpdateaffectednmls =
true;
223 if (
true && ( (
true&&!(((getUpdatenmls()==1)))) ) )
224 graph->
evalOpParm(myUpdateaffectednmls, nodeidx,
"updateaffectednmls", time, graph->
isDirect()?
nullptr:depnode);
225 myVisualizefalloff = 2;
227 graph->
evalOpParm(myVisualizefalloff, nodeidx,
"visualizefalloff", time, graph->
isDirect()?
nullptr:depnode);
228 myLeadptattr =
""_UTsh;
229 if (
true && ( (
true&&!(((
int64(getDistmetric())!=0))||((getLeadnml()==0)))) ) )
230 graph->
evalOpParm(myLeadptattr, nodeidx,
"leadptattr", time, graph->
isDirect()?
nullptr:depnode);
246 template <
typename T>
253 if (idx.
size() != instance.
size()+1)
258 coerceValue(value, myGroup);
261 coerceValue(value, myMask);
264 coerceValue(value, myEnablemaskattrib);
267 coerceValue(value, myMaskattrib);
270 coerceValue(value, myDist);
273 coerceValue(value, myDistmetric);
276 coerceValue(value, myApplyrolloff);
279 coerceValue(value, myDistattr);
282 coerceValue(value, myRad);
285 coerceValue(value, myType);
288 coerceValue(value, myTandeg);
291 coerceValue(value, myKernel);
294 coerceValue(value, myLeadnml);
297 coerceValue(value, myUpdatenmls);
300 coerceValue(value, myUpdateaffectednmls);
303 coerceValue(value, myVisualizefalloff);
306 coerceValue(value, myLeadptattr);
322 { doGetParmValue(idx, instance, value); }
324 { doGetParmValue(idx, instance, value); }
326 { doGetParmValue(idx, instance, value); }
328 { doGetParmValue(idx, instance, value); }
330 { doGetParmValue(idx, instance, value); }
332 { doGetParmValue(idx, instance, value); }
334 { doGetParmValue(idx, instance, value); }
336 { doGetParmValue(idx, instance, value); }
338 { doGetParmValue(idx, instance, value); }
340 { doGetParmValue(idx, instance, value); }
342 { doGetParmValue(idx, instance, value); }
344 template <
typename T>
351 if (idx.
size() != instance.
size()+1)
356 coerceValue(myGroup, ( ( value ) ));
359 coerceValue(myMask, ( ( value ) ));
362 coerceValue(myEnablemaskattrib, clampMinValue(0, clampMaxValue(1, value ) ));
365 coerceValue(myMaskattrib, ( ( value ) ));
368 coerceValue(myDist, ( ( value ) ));
371 coerceValue(myDistmetric, clampMinValue(0, clampMaxValue(4, value ) ));
374 coerceValue(myApplyrolloff, ( ( value ) ));
377 coerceValue(myDistattr, ( ( value ) ));
380 coerceValue(myRad, clampMinValue(0, ( value ) ));
383 coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
386 coerceValue(myTandeg, ( ( value ) ));
389 coerceValue(myKernel, ( ( value ) ));
392 coerceValue(myLeadnml, ( ( value ) ));
395 coerceValue(myUpdatenmls, ( ( value ) ));
398 coerceValue(myUpdateaffectednmls, ( ( value ) ));
401 coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
404 coerceValue(myLeadptattr, ( ( value ) ));
411 { doSetParmValue(idx, instance, value); }
413 { doSetParmValue(idx, instance, value); }
415 { doSetParmValue(idx, instance, value); }
417 { doSetParmValue(idx, instance, value); }
419 { doSetParmValue(idx, instance, value); }
421 { doSetParmValue(idx, instance, value); }
423 { doSetParmValue(idx, instance, value); }
425 { doSetParmValue(idx, instance, value); }
427 { doSetParmValue(idx, instance, value); }
429 { doSetParmValue(idx, instance, value); }
431 { doSetParmValue(idx, instance, value); }
447 if (fieldnum.
size() < 1)
456 return "enablemaskattrib";
464 return "applyrolloff";
480 return "updateaffectednmls";
482 return "visualizefalloff";
492 if (fieldnum.
size() < 1)
493 return PARM_UNSUPPORTED;
532 return PARM_UNSUPPORTED;
568 loadData(is, rampdata);
586 int typelen = colon - data.
buffer();
600 {
int64 iv =
v; UTwrite(os, &iv); }
602 { UTwrite<fpreal64>(os, &
v); }
604 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
606 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
607 UTwrite<fpreal64>(os, &v.
z()); }
609 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
610 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
622 if (s) s->save(ostr);
624 saveData(os, result);
631 ostr << s->getDataTypeToken();
636 saveData(os, result);
640 void save(std::ostream &os)
const
644 saveData(os, myGroup);
645 saveData(os, myMask);
646 saveData(os, myEnablemaskattrib);
647 saveData(os, myMaskattrib);
648 saveData(os, myDist);
649 saveData(os, myDistmetric);
650 saveData(os, myApplyrolloff);
651 saveData(os, myDistattr);
653 saveData(os, myType);
654 saveData(os, myTandeg);
655 saveData(os, myKernel);
656 saveData(os, myLeadnml);
657 saveData(os, myUpdatenmls);
658 saveData(os, myUpdateaffectednmls);
659 saveData(os, myVisualizefalloff);
660 saveData(os, myLeadptattr);
673 loadData(is, myGroup);
674 loadData(is, myMask);
675 loadData(is, myEnablemaskattrib);
676 loadData(is, myMaskattrib);
677 loadData(is, myDist);
678 loadData(is, myDistmetric);
679 loadData(is, myApplyrolloff);
680 loadData(is, myDistattr);
682 loadData(is, myType);
683 loadData(is, myTandeg);
684 loadData(is, myKernel);
685 loadData(is, myLeadnml);
686 loadData(is, myUpdatenmls);
687 loadData(is, myUpdateaffectednmls);
688 loadData(is, myVisualizefalloff);
689 loadData(is, myLeadptattr);
699 if (!thissop)
return getGroup();
701 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getMask();
711 OP_Utils::evalOpParm(result, thissop,
"mask", cookparms.
getCookTime(), 0);
719 if (!thissop)
return getEnablemaskattrib();
721 OP_Utils::evalOpParm(result, thissop,
"enablemaskattrib", cookparms.
getCookTime(), 0);
729 if (!thissop)
return getMaskattrib();
731 OP_Utils::evalOpParm(result, thissop,
"maskattrib", cookparms.
getCookTime(), 0);
739 if (!thissop)
return getDist();
741 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
749 if (!thissop)
return getDistmetric();
751 OP_Utils::evalOpParm(result, thissop,
"distmetric", cookparms.
getCookTime(), 0);
759 if (!thissop)
return getApplyrolloff();
761 OP_Utils::evalOpParm(result, thissop,
"applyrolloff", cookparms.
getCookTime(), 0);
769 if (!thissop)
return getDistattr();
771 OP_Utils::evalOpParm(result, thissop,
"distattr", cookparms.
getCookTime(), 0);
779 if (!thissop)
return getRad();
781 OP_Utils::evalOpParm(result, thissop,
"rad", cookparms.
getCookTime(), 0);
789 if (!thissop)
return getType();
791 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
799 if (!thissop)
return getTandeg();
801 OP_Utils::evalOpParm(result, thissop,
"tandeg", cookparms.
getCookTime(), 0);
809 if (!thissop)
return getKernel();
811 OP_Utils::evalOpParm(result, thissop,
"kernel", cookparms.
getCookTime(), 0);
819 if (!thissop)
return getLeadnml();
821 OP_Utils::evalOpParm(result, thissop,
"leadnml", cookparms.
getCookTime(), 0);
829 if (!thissop)
return getUpdatenmls();
831 OP_Utils::evalOpParm(result, thissop,
"updatenmls", cookparms.
getCookTime(), 0);
839 if (!thissop)
return getUpdateaffectednmls();
841 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
849 if (!thissop)
return getVisualizefalloff();
851 OP_Utils::evalOpParm(result, thissop,
"visualizefalloff", cookparms.
getCookTime(), 0);
859 if (!thissop)
return getLeadptattr();
861 OP_Utils::evalOpParm(result, thissop,
"leadptattr", cookparms.
getCookTime(), 0);
868 int64 myEnablemaskattrib;
880 bool myUpdateaffectednmls;
881 int64 myVisualizefalloff;
Distmetric getDistmetric() const
const char * getNestParmName(TempIndex fieldnum) const override
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setVisualizefalloff(Visualizefalloff val)
void setDistmetric(Distmetric val)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool opUpdateaffectednmls(const SOP_NodeVerb::CookParms &cookparms) const
void setMask(fpreal64 val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setTandeg(UT_Vector2D val)
UT_Vector2T< fpreal64 > UT_Vector2D
GLsizei const GLfloat * value
bool operator==(const SOP_SoftPeakParms &src) const
fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
bool load(UT_IStream &is)
SYS_FORCE_INLINE const char * buffer() const
UT_StringHolder opLeadptattr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opMaskattrib(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
**But if you need a result
void setUpdateaffectednmls(bool val)
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setGroup(const UT_StringHolder &val)
bool opLeadnml(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, UT_StringHolder s)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_Vector2D getTandeg() const
static void loadData(UT_IStream &is, fpreal64 &v)
bool opUpdatenmls(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
void save(std::ostream &os) const
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_Vector2D opTandeg(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_StringHolder & getMaskattrib() const
Enablemaskattrib opEnablemaskattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opApplyrolloff(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getDistattr() const
const OP_GraphProxy * graph() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setKernel(const UT_StringHolder &val)
bool getUpdateaffectednmls() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, bool &v)
Enablemaskattrib getEnablemaskattrib() const
bool getUpdatenmls() const
bool getApplyrolloff() const
Distmetric opDistmetric(const SOP_NodeVerb::CookParms &cookparms) const
void setRad(fpreal64 val)
Visualizefalloff getVisualizefalloff() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setUpdatenmls(bool val)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opKernel(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Vector3D v)
void setApplyrolloff(bool val)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, fpreal64 v)
const UT_StringHolder & getLeadptattr() const
void setEnablemaskattrib(Enablemaskattrib val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
DEP_MicroNode * depnode() const
void setMaskattrib(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
fpreal64 opMask(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
UT_StringHolder opDistattr(const SOP_NodeVerb::CookParms &cookparms) const
Visualizefalloff opVisualizefalloff(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
virtual UT_StringHolder baseGetSignature() const
const UT_StringHolder & getGroup() const
void setDist(fpreal64 val)
fpreal getCookTime() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, int64 v)
const char * findChar(int c) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setLeadptattr(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getKernel() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool operator!=(const SOP_SoftPeakParms &src) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, UT_Vector4D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Enablemaskattrib enum_value)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setDistattr(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setLeadnml(bool val)
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept