23 namespace SOP_SoftPeakEnums
37 using namespace UT::Literal;
59 using namespace UT::Literal;
79 using namespace UT::Literal;
101 myApplyrolloff =
false;
102 myDistattr =
""_UTsh;
106 myKernel =
"wyvill"_UTsh;
108 myUpdatenmls =
false;
109 myUpdateaffectednmls =
true;
110 myVisualizefalloff = 2;
111 myLeadptattr =
""_UTsh;
124 if (myGroup != src.myGroup)
return false;
125 if (myDist != src.myDist)
return false;
126 if (myDistmetric != src.myDistmetric)
return false;
127 if (myApplyrolloff != src.myApplyrolloff)
return false;
128 if (myDistattr != src.myDistattr)
return false;
129 if (myRad != src.myRad)
return false;
130 if (myType != src.myType)
return false;
131 if (myTandeg != src.myTandeg)
return false;
132 if (myKernel != src.myKernel)
return false;
133 if (myLeadnml != src.myLeadnml)
return false;
134 if (myUpdatenmls != src.myUpdatenmls)
return false;
135 if (myUpdateaffectednmls != src.myUpdateaffectednmls)
return false;
136 if (myVisualizefalloff != src.myVisualizefalloff)
return false;
137 if (myLeadptattr != src.myLeadptattr)
return false;
155 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
158 graph->
evalOpParm(myDist, nodeidx,
"dist", time, 0);
161 graph->
evalOpParm(myDistmetric, nodeidx,
"distmetric", time, 0);
162 myApplyrolloff =
false;
163 if (
true && ( (
true&&!(((
int64(getDistmetric())!=0)))) ) )
164 graph->
evalOpParm(myApplyrolloff, nodeidx,
"applyrolloff", time, 0);
165 myDistattr =
""_UTsh;
166 if (
true && ( (
true&&!(((
int64(getDistmetric())!=0)))) ) )
167 graph->
evalOpParm(myDistattr, nodeidx,
"distattr", time, 0);
169 if (
true && ( (
true&&!(((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
170 graph->
evalOpParm(myRad, nodeidx,
"rad", time, 0);
172 if (
true && ( (
true&&!(((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
173 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
175 if (
true && ( (
true&&!(((
int64(getType())!=2))||((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
176 graph->
evalOpParm(myTandeg, nodeidx,
"tandeg", time, 0);
177 myKernel =
"wyvill"_UTsh;
178 if (
true && ( (
true&&!(((
int64(getType())!=3))||((
int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
179 graph->
evalOpParm(myKernel, nodeidx,
"kernel", time, 0);
182 graph->
evalOpParm(myLeadnml, nodeidx,
"leadnml", time, 0);
183 myUpdatenmls =
false;
185 graph->
evalOpParm(myUpdatenmls, nodeidx,
"updatenmls", time, 0);
186 myUpdateaffectednmls =
true;
187 if (
true && ( (
true&&!(((getUpdatenmls()==1)))) ) )
188 graph->
evalOpParm(myUpdateaffectednmls, nodeidx,
"updateaffectednmls", time, 0);
189 myVisualizefalloff = 2;
191 graph->
evalOpParm(myVisualizefalloff, nodeidx,
"visualizefalloff", time, 0);
192 myLeadptattr =
""_UTsh;
193 if (
true && ( (
true&&!(((
int64(getDistmetric())!=0))||((getLeadnml()==0)))) ) )
194 graph->
evalOpParm(myLeadptattr, nodeidx,
"leadptattr", time, 0);
210 template <
typename T>
217 if (idx.
size() != instance.
size()+1)
222 coerceValue(value, myGroup);
225 coerceValue(value, myDist);
228 coerceValue(value, myDistmetric);
231 coerceValue(value, myApplyrolloff);
234 coerceValue(value, myDistattr);
237 coerceValue(value, myRad);
240 coerceValue(value, myType);
243 coerceValue(value, myTandeg);
246 coerceValue(value, myKernel);
249 coerceValue(value, myLeadnml);
252 coerceValue(value, myUpdatenmls);
255 coerceValue(value, myUpdateaffectednmls);
258 coerceValue(value, myVisualizefalloff);
261 coerceValue(value, myLeadptattr);
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 template <
typename T>
306 if (idx.
size() != instance.
size()+1)
311 coerceValue(myGroup, ( ( value ) ));
314 coerceValue(myDist, ( ( value ) ));
317 coerceValue(myDistmetric, clampMinValue(0, clampMaxValue(4, value ) ));
320 coerceValue(myApplyrolloff, ( ( value ) ));
323 coerceValue(myDistattr, ( ( value ) ));
326 coerceValue(myRad, clampMinValue(0, ( value ) ));
329 coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
332 coerceValue(myTandeg, ( ( value ) ));
335 coerceValue(myKernel, ( ( value ) ));
338 coerceValue(myLeadnml, ( ( value ) ));
341 coerceValue(myUpdatenmls, ( ( value ) ));
344 coerceValue(myUpdateaffectednmls, ( ( value ) ));
347 coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
350 coerceValue(myLeadptattr, ( ( value ) ));
357 { doSetParmValue(idx, instance, value); }
359 { doSetParmValue(idx, instance, value); }
361 { doSetParmValue(idx, instance, value); }
363 { doSetParmValue(idx, instance, value); }
365 { doSetParmValue(idx, instance, value); }
367 { doSetParmValue(idx, instance, value); }
369 { doSetParmValue(idx, instance, value); }
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, value); }
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
393 if (fieldnum.
size() < 1)
404 return "applyrolloff";
420 return "updateaffectednmls";
422 return "visualizefalloff";
432 if (fieldnum.
size() < 1)
433 return PARM_UNSUPPORTED;
466 return PARM_UNSUPPORTED;
502 loadData(is, rampdata);
520 int typelen = colon - data.
buffer();
534 {
int64 iv =
v; UTwrite(os, &iv); }
536 { UTwrite<fpreal64>(os, &
v); }
538 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
540 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
541 UTwrite<fpreal64>(os, &v.
z()); }
543 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
544 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
556 if (s) s->save(ostr);
558 saveData(os, result);
565 ostr << s->getDataTypeToken();
570 saveData(os, result);
574 void save(std::ostream &os)
const
578 saveData(os, myGroup);
579 saveData(os, myDist);
580 saveData(os, myDistmetric);
581 saveData(os, myApplyrolloff);
582 saveData(os, myDistattr);
584 saveData(os, myType);
585 saveData(os, myTandeg);
586 saveData(os, myKernel);
587 saveData(os, myLeadnml);
588 saveData(os, myUpdatenmls);
589 saveData(os, myUpdateaffectednmls);
590 saveData(os, myVisualizefalloff);
591 saveData(os, myLeadptattr);
604 loadData(is, myGroup);
605 loadData(is, myDist);
606 loadData(is, myDistmetric);
607 loadData(is, myApplyrolloff);
608 loadData(is, myDistattr);
610 loadData(is, myType);
611 loadData(is, myTandeg);
612 loadData(is, myKernel);
613 loadData(is, myLeadnml);
614 loadData(is, myUpdatenmls);
615 loadData(is, myUpdateaffectednmls);
616 loadData(is, myVisualizefalloff);
617 loadData(is, myLeadptattr);
627 if (!thissop)
return getGroup();
629 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getDist();
639 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getDistmetric();
649 OP_Utils::evalOpParm(result, thissop,
"distmetric", cookparms.
getCookTime(), 0);
657 if (!thissop)
return getApplyrolloff();
659 OP_Utils::evalOpParm(result, thissop,
"applyrolloff", cookparms.
getCookTime(), 0);
667 if (!thissop)
return getDistattr();
669 OP_Utils::evalOpParm(result, thissop,
"distattr", cookparms.
getCookTime(), 0);
677 if (!thissop)
return getRad();
679 OP_Utils::evalOpParm(result, thissop,
"rad", cookparms.
getCookTime(), 0);
687 if (!thissop)
return getType();
689 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
697 if (!thissop)
return getTandeg();
699 OP_Utils::evalOpParm(result, thissop,
"tandeg", cookparms.
getCookTime(), 0);
707 if (!thissop)
return getKernel();
709 OP_Utils::evalOpParm(result, thissop,
"kernel", cookparms.
getCookTime(), 0);
717 if (!thissop)
return getLeadnml();
719 OP_Utils::evalOpParm(result, thissop,
"leadnml", cookparms.
getCookTime(), 0);
727 if (!thissop)
return getUpdatenmls();
729 OP_Utils::evalOpParm(result, thissop,
"updatenmls", cookparms.
getCookTime(), 0);
737 if (!thissop)
return getUpdateaffectednmls();
739 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
747 if (!thissop)
return getVisualizefalloff();
749 OP_Utils::evalOpParm(result, thissop,
"visualizefalloff", cookparms.
getCookTime(), 0);
757 if (!thissop)
return getLeadptattr();
759 OP_Utils::evalOpParm(result, thissop,
"leadptattr", cookparms.
getCookTime(), 0);
775 bool myUpdateaffectednmls;
776 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
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
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)
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
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
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)
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
static void loadData(UT_IStream &is, UT_Vector3D &v)
DEP_MicroNode * depnode() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
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
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
SYS_FORCE_INLINE UT_StringHolder getToken(Distmetric enum_value)
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
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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