23 namespace SOP_AttribInterpolateEnums
36 using namespace UT::Literal;
57 using namespace UT::Literal;
76 using namespace UT::Literal;
96 myNumberattrib =
"sourceprim"_UTsh;
97 myWeightsattrib =
"sourceprimuv"_UTsh;
98 myPointattribs =
"*"_UTsh;
99 myVertattribs =
""_UTsh;
100 myPrimattribs =
""_UTsh;
101 myDetailattribs =
""_UTsh;
102 myMatchgroups =
true;
103 myComputeweights =
false;
104 myComputenumberstype = 1;
105 myComputednumbersattrib =
"sourcevtxnums"_UTsh;
106 myComputedweightsattrib =
"sourcevtxweights"_UTsh;
124 if (myTotype != src.myTotype)
return false;
125 if (myInterpby != src.myInterpby)
return false;
126 if (myNumberattrib != src.myNumberattrib)
return false;
127 if (myWeightsattrib != src.myWeightsattrib)
return false;
128 if (myPointattribs != src.myPointattribs)
return false;
129 if (myVertattribs != src.myVertattribs)
return false;
130 if (myPrimattribs != src.myPrimattribs)
return false;
131 if (myDetailattribs != src.myDetailattribs)
return false;
132 if (myMatchgroups != src.myMatchgroups)
return false;
133 if (myComputeweights != src.myComputeweights)
return false;
134 if (myComputenumberstype != src.myComputenumberstype)
return false;
135 if (myComputednumbersattrib != src.myComputednumbersattrib)
return false;
136 if (myComputedweightsattrib != src.myComputedweightsattrib)
return false;
137 if (myPrescale != src.myPrescale)
return false;
138 if (myNormalize != src.myNormalize)
return false;
139 if (myThreshold != src.myThreshold)
return false;
140 if (myBlend != src.myBlend)
return false;
141 if (myGroup != src.myGroup)
return false;
159 graph->
evalOpParm(myTotype, nodeidx,
"totype", time, 0);
162 graph->
evalOpParm(myInterpby, nodeidx,
"interpby", time, 0);
163 myNumberattrib =
"sourceprim"_UTsh;
165 graph->
evalOpParm(myNumberattrib, nodeidx,
"numberattrib", time, 0);
166 myWeightsattrib =
"sourceprimuv"_UTsh;
168 graph->
evalOpParm(myWeightsattrib, nodeidx,
"weightsattrib", time, 0);
169 myPointattribs =
"*"_UTsh;
170 if (
true && ( (
true&&!(((
int64(getInterpby())==3)))) ) )
171 graph->
evalOpParm(myPointattribs, nodeidx,
"pointattribs", time, 0);
172 myVertattribs =
""_UTsh;
173 if (
true && ( (
true&&!(((
int64(getInterpby())==3))||((
int64(getInterpby())==1)))) ) )
174 graph->
evalOpParm(myVertattribs, nodeidx,
"vertattribs", time, 0);
175 myPrimattribs =
""_UTsh;
176 if (
true && ( (
true&&!(((
int64(getInterpby())==1)))) ) )
177 graph->
evalOpParm(myPrimattribs, nodeidx,
"primattribs", time, 0);
178 myDetailattribs =
""_UTsh;
180 graph->
evalOpParm(myDetailattribs, nodeidx,
"detailattribs", time, 0);
181 myMatchgroups =
true;
183 graph->
evalOpParm(myMatchgroups, nodeidx,
"matchgroups", time, 0);
184 myComputeweights =
false;
185 if (
true && ( (
true&&!(((
int64(getInterpby())!=0)))) ) )
186 graph->
evalOpParm(myComputeweights, nodeidx,
"computeweights", time, 0);
187 myComputenumberstype = 1;
188 if (
true && ( (
true&&!(((
int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
189 graph->
evalOpParm(myComputenumberstype, nodeidx,
"computenumberstype", time, 0);
190 myComputednumbersattrib =
"sourcevtxnums"_UTsh;
191 if (
true && ( (
true&&!(((
int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
192 graph->
evalOpParm(myComputednumbersattrib, nodeidx,
"computednumbersattrib", time, 0);
193 myComputedweightsattrib =
"sourcevtxweights"_UTsh;
194 if (
true && ( (
true&&!(((
int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
195 graph->
evalOpParm(myComputedweightsattrib, nodeidx,
"computedweightsattrib", time, 0);
198 graph->
evalOpParm(myPrescale, nodeidx,
"prescale", time, 0);
201 graph->
evalOpParm(myNormalize, nodeidx,
"normalize", time, 0);
203 if (
true && ( (
true&&!(((getNormalize()==0)))) ) )
204 graph->
evalOpParm(myThreshold, nodeidx,
"threshold", time, 0);
206 if (
true && ( (
true&&!(((getNormalize()==0)))) ) )
207 graph->
evalOpParm(myBlend, nodeidx,
"blend", time, 0);
209 if (
true && ( (
true&&!(((
int64(getTotype())==3)))) ) )
210 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
226 template <
typename T>
233 if (idx.
size() != instance.
size()+1)
238 coerceValue(value, myTotype);
241 coerceValue(value, myInterpby);
244 coerceValue(value, myNumberattrib);
247 coerceValue(value, myWeightsattrib);
250 coerceValue(value, myPointattribs);
253 coerceValue(value, myVertattribs);
256 coerceValue(value, myPrimattribs);
259 coerceValue(value, myDetailattribs);
262 coerceValue(value, myMatchgroups);
265 coerceValue(value, myComputeweights);
268 coerceValue(value, myComputenumberstype);
271 coerceValue(value, myComputednumbersattrib);
274 coerceValue(value, myComputedweightsattrib);
277 coerceValue(value, myPrescale);
280 coerceValue(value, myNormalize);
283 coerceValue(value, myThreshold);
286 coerceValue(value, myBlend);
289 coerceValue(value, myGroup);
305 { doGetParmValue(idx, instance, value); }
307 { doGetParmValue(idx, instance, value); }
309 { doGetParmValue(idx, instance, value); }
311 { doGetParmValue(idx, instance, value); }
313 { doGetParmValue(idx, instance, value); }
315 { doGetParmValue(idx, instance, value); }
317 { doGetParmValue(idx, instance, value); }
319 { doGetParmValue(idx, instance, value); }
321 { doGetParmValue(idx, instance, value); }
323 { doGetParmValue(idx, instance, value); }
325 { doGetParmValue(idx, instance, value); }
327 template <
typename T>
334 if (idx.
size() != instance.
size()+1)
339 coerceValue(myTotype, clampMinValue(0, clampMaxValue(3, value ) ));
342 coerceValue(myInterpby, clampMinValue(0, clampMaxValue(3, value ) ));
345 coerceValue(myNumberattrib, ( ( value ) ));
348 coerceValue(myWeightsattrib, ( ( value ) ));
351 coerceValue(myPointattribs, ( ( value ) ));
354 coerceValue(myVertattribs, ( ( value ) ));
357 coerceValue(myPrimattribs, ( ( value ) ));
360 coerceValue(myDetailattribs, ( ( value ) ));
363 coerceValue(myMatchgroups, ( ( value ) ));
366 coerceValue(myComputeweights, ( ( value ) ));
369 coerceValue(myComputenumberstype, clampMinValue(0, clampMaxValue(1, value ) ));
372 coerceValue(myComputednumbersattrib, ( ( value ) ));
375 coerceValue(myComputedweightsattrib, ( ( value ) ));
378 coerceValue(myPrescale, clampMinValue(0, ( value ) ));
381 coerceValue(myNormalize, ( ( value ) ));
384 coerceValue(myThreshold, clampMinValue(0, clampMaxValue(1, value ) ));
387 coerceValue(myBlend, clampMinValue(0, clampMaxValue(1, value ) ));
390 coerceValue(myGroup, ( ( value ) ));
397 { doSetParmValue(idx, instance, value); }
399 { doSetParmValue(idx, instance, value); }
401 { doSetParmValue(idx, instance, value); }
403 { doSetParmValue(idx, instance, value); }
405 { doSetParmValue(idx, instance, value); }
407 { doSetParmValue(idx, instance, value); }
409 { doSetParmValue(idx, instance, value); }
411 { doSetParmValue(idx, instance, value); }
413 { doSetParmValue(idx, instance, value); }
415 { doSetParmValue(idx, instance, value); }
417 { doSetParmValue(idx, instance, value); }
433 if (fieldnum.
size() < 1)
442 return "numberattrib";
444 return "weightsattrib";
446 return "pointattribs";
448 return "vertattribs";
450 return "primattribs";
452 return "detailattribs";
454 return "matchgroups";
456 return "computeweights";
458 return "computenumberstype";
460 return "computednumbersattrib";
462 return "computedweightsattrib";
480 if (fieldnum.
size() < 1)
481 return PARM_UNSUPPORTED;
522 return PARM_UNSUPPORTED;
558 loadData(is, rampdata);
576 int typelen = colon - data.
buffer();
590 {
int64 iv =
v; UTwrite(os, &iv); }
592 { UTwrite<fpreal64>(os, &
v); }
594 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
596 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
597 UTwrite<fpreal64>(os, &v.
z()); }
599 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
600 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
612 if (s) s->save(ostr);
614 saveData(os, result);
621 ostr << s->getDataTypeToken();
626 saveData(os, result);
630 void save(std::ostream &os)
const
634 saveData(os, myTotype);
635 saveData(os, myInterpby);
636 saveData(os, myNumberattrib);
637 saveData(os, myWeightsattrib);
638 saveData(os, myPointattribs);
639 saveData(os, myVertattribs);
640 saveData(os, myPrimattribs);
641 saveData(os, myDetailattribs);
642 saveData(os, myMatchgroups);
643 saveData(os, myComputeweights);
644 saveData(os, myComputenumberstype);
645 saveData(os, myComputednumbersattrib);
646 saveData(os, myComputedweightsattrib);
647 saveData(os, myPrescale);
648 saveData(os, myNormalize);
649 saveData(os, myThreshold);
650 saveData(os, myBlend);
651 saveData(os, myGroup);
664 loadData(is, myTotype);
665 loadData(is, myInterpby);
666 loadData(is, myNumberattrib);
667 loadData(is, myWeightsattrib);
668 loadData(is, myPointattribs);
669 loadData(is, myVertattribs);
670 loadData(is, myPrimattribs);
671 loadData(is, myDetailattribs);
672 loadData(is, myMatchgroups);
673 loadData(is, myComputeweights);
674 loadData(is, myComputenumberstype);
675 loadData(is, myComputednumbersattrib);
676 loadData(is, myComputedweightsattrib);
677 loadData(is, myPrescale);
678 loadData(is, myNormalize);
679 loadData(is, myThreshold);
680 loadData(is, myBlend);
681 loadData(is, myGroup);
691 if (!thissop)
return getTotype();
693 OP_Utils::evalOpParm(result, thissop,
"totype", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getInterpby();
703 OP_Utils::evalOpParm(result, thissop,
"interpby", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getNumberattrib();
713 OP_Utils::evalOpParm(result, thissop,
"numberattrib", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getWeightsattrib();
723 OP_Utils::evalOpParm(result, thissop,
"weightsattrib", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getPointattribs();
733 OP_Utils::evalOpParm(result, thissop,
"pointattribs", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getVertattribs();
743 OP_Utils::evalOpParm(result, thissop,
"vertattribs", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getPrimattribs();
753 OP_Utils::evalOpParm(result, thissop,
"primattribs", cookparms.
getCookTime(), 0);
761 if (!thissop)
return getDetailattribs();
763 OP_Utils::evalOpParm(result, thissop,
"detailattribs", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getMatchgroups();
773 OP_Utils::evalOpParm(result, thissop,
"matchgroups", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getComputeweights();
783 OP_Utils::evalOpParm(result, thissop,
"computeweights", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getComputenumberstype();
793 OP_Utils::evalOpParm(result, thissop,
"computenumberstype", cookparms.
getCookTime(), 0);
801 if (!thissop)
return getComputednumbersattrib();
803 OP_Utils::evalOpParm(result, thissop,
"computednumbersattrib", cookparms.
getCookTime(), 0);
811 if (!thissop)
return getComputedweightsattrib();
813 OP_Utils::evalOpParm(result, thissop,
"computedweightsattrib", cookparms.
getCookTime(), 0);
821 if (!thissop)
return getPrescale();
823 OP_Utils::evalOpParm(result, thissop,
"prescale", cookparms.
getCookTime(), 0);
831 if (!thissop)
return getNormalize();
833 OP_Utils::evalOpParm(result, thissop,
"normalize", cookparms.
getCookTime(), 0);
841 if (!thissop)
return getThreshold();
843 OP_Utils::evalOpParm(result, thissop,
"threshold", cookparms.
getCookTime(), 0);
851 if (!thissop)
return getBlend();
853 OP_Utils::evalOpParm(result, thissop,
"blend", cookparms.
getCookTime(), 0);
861 if (!thissop)
return getGroup();
863 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
877 bool myComputeweights;
878 int64 myComputenumberstype;
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setComputedweightsattrib(const UT_StringHolder &val)
void setPrimattribs(const UT_StringHolder &val)
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_StringHolder s)
UT_StringHolder opComputednumbersattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setBlend(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setWeightsattrib(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
SOP_AttribInterpolateParms()
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_StringHolder opPrimattribs(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const UT_StringHolder & getNumberattrib() const
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
bool opMatchgroups(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
bool operator!=(const SOP_AttribInterpolateParms &src) const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const UT_StringHolder & getGroup() const
bool opComputeweights(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumberattrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setInterpby(Interpby val)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool getComputeweights() const
**But if you need a result
const char * getNestParmName(TempIndex fieldnum) const override
Totype opTotype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector4D &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 getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setComputednumbersattrib(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void setTotype(Totype val)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPointattribs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &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
const UT_StringHolder & getPrimattribs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
const OP_GraphProxy * graph() const
SYS_FORCE_INLINE UT_StringHolder getToken(Totype enum_value)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
fpreal64 getBlend() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
fpreal64 getPrescale() const
UT_StringHolder opWeightsattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setPointattribs(const UT_StringHolder &val)
const UT_StringHolder & getComputednumbersattrib() const
const UT_StringHolder & getWeightsattrib() const
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 opPrescale(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
Interpby getInterpby() const
const UT_StringHolder & getComputedweightsattrib() const
fpreal64 getThreshold() const
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const UT_StringHolder & getVertattribs() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setVertattribs(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
Computenumberstype getComputenumberstype() const
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder opComputedweightsattrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getDetailattribs() const
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
Computenumberstype opComputenumberstype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
void setThreshold(fpreal64 val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
Interpby opInterpby(const SOP_NodeVerb::CookParms &cookparms) const
void setPrescale(fpreal64 val)
UT_StringHolder opDetailattribs(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
void setComputeweights(bool val)
const UT_StringHolder & getPointattribs() const
void copyFrom(const OP_NodeParms *src) override
UT_StringHolder opVertattribs(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
bool getNormalize() const
bool getMatchgroups() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNormalize(bool val)
void setDetailattribs(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNumberattrib(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE bool isstring() const
void setGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool operator==(const SOP_AttribInterpolateParms &src) const
void setComputenumberstype(Computenumberstype val)
void setMatchgroups(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override