20 using namespace UT::Literal;
23 namespace SOP_AttribInterpolateEnums
56 myNumberattrib =
"sourceprim"_sh;
57 myWeightsattrib =
"sourceprimuv"_sh;
58 myPointattribs =
"*"_sh;
59 myVertattribs =
""_sh;
60 myPrimattribs =
""_sh;
61 myDetailattribs =
""_sh;
62 myComputeweights =
false;
63 myComputenumberstype = 1;
64 myComputednumbersattrib =
"sourcevtxnums"_sh;
65 myComputedweightsattrib =
"sourcevtxweights"_sh;
76 if (myTotype != src.myTotype)
return false;
77 if (myInterpby != src.myInterpby)
return false;
78 if (myNumberattrib != src.myNumberattrib)
return false;
79 if (myWeightsattrib != src.myWeightsattrib)
return false;
80 if (myPointattribs != src.myPointattribs)
return false;
81 if (myVertattribs != src.myVertattribs)
return false;
82 if (myPrimattribs != src.myPrimattribs)
return false;
83 if (myDetailattribs != src.myDetailattribs)
return false;
84 if (myComputeweights != src.myComputeweights)
return false;
85 if (myComputenumberstype != src.myComputenumberstype)
return false;
86 if (myComputednumbersattrib != src.myComputednumbersattrib)
return false;
87 if (myComputedweightsattrib != src.myComputedweightsattrib)
return false;
88 if (myGroup != src.myGroup)
return false;
106 graph->
evalOpParm(myTotype, nodeidx,
"totype", time, 0);
109 graph->
evalOpParm(myInterpby, nodeidx,
"interpby", time, 0);
110 myNumberattrib =
"sourceprim"_sh;
112 graph->
evalOpParm(myNumberattrib, nodeidx,
"numberattrib", time, 0);
113 myWeightsattrib =
"sourceprimuv"_sh;
115 graph->
evalOpParm(myWeightsattrib, nodeidx,
"weightsattrib", time, 0);
116 myPointattribs =
"*"_sh;
117 if (
true && ( (!(((
int64(getInterpby())==3)))) ) )
118 graph->
evalOpParm(myPointattribs, nodeidx,
"pointattribs", time, 0);
119 myVertattribs =
""_sh;
120 if (
true && ( (!(((
int64(getInterpby())==3))||((
int64(getInterpby())==1)))) ) )
121 graph->
evalOpParm(myVertattribs, nodeidx,
"vertattribs", time, 0);
122 myPrimattribs =
""_sh;
123 if (
true && ( (!(((
int64(getInterpby())==1)))) ) )
124 graph->
evalOpParm(myPrimattribs, nodeidx,
"primattribs", time, 0);
125 myDetailattribs =
""_sh;
127 graph->
evalOpParm(myDetailattribs, nodeidx,
"detailattribs", time, 0);
128 myComputeweights =
false;
129 if (
true && ( (!(((
int64(getInterpby())!=0)))) ) )
130 graph->
evalOpParm(myComputeweights, nodeidx,
"computeweights", time, 0);
131 myComputenumberstype = 1;
132 if (
true && ( (!(((
int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
133 graph->
evalOpParm(myComputenumberstype, nodeidx,
"computenumberstype", time, 0);
134 myComputednumbersattrib =
"sourcevtxnums"_sh;
135 if (
true && ( (!(((
int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
136 graph->
evalOpParm(myComputednumbersattrib, nodeidx,
"computednumbersattrib", time, 0);
137 myComputedweightsattrib =
"sourcevtxweights"_sh;
138 if (
true && ( (!(((
int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
139 graph->
evalOpParm(myComputedweightsattrib, nodeidx,
"computedweightsattrib", time, 0);
141 if (
true && ( (!(((
int64(getTotype())==3)))) ) )
142 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
158 template <
typename T>
165 if (idx.
size() != instance.
size()+1)
170 coerceValue(value, myTotype);
173 coerceValue(value, myInterpby);
176 coerceValue(value, myNumberattrib);
179 coerceValue(value, myWeightsattrib);
182 coerceValue(value, myPointattribs);
185 coerceValue(value, myVertattribs);
188 coerceValue(value, myPrimattribs);
191 coerceValue(value, myDetailattribs);
194 coerceValue(value, myComputeweights);
197 coerceValue(value, myComputenumberstype);
200 coerceValue(value, myComputednumbersattrib);
203 coerceValue(value, myComputedweightsattrib);
206 coerceValue(value, myGroup);
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 template <
typename T>
242 if (idx.
size() != instance.
size()+1)
247 coerceValue(myTotype, value);
250 coerceValue(myInterpby, value);
253 coerceValue(myNumberattrib, value);
256 coerceValue(myWeightsattrib, value);
259 coerceValue(myPointattribs, value);
262 coerceValue(myVertattribs, value);
265 coerceValue(myPrimattribs, value);
268 coerceValue(myDetailattribs, value);
271 coerceValue(myComputeweights, value);
274 coerceValue(myComputenumberstype, value);
277 coerceValue(myComputednumbersattrib, value);
280 coerceValue(myComputedweightsattrib, value);
283 coerceValue(myGroup, value);
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
326 if (fieldnum.
size() < 1)
335 return "numberattrib";
337 return "weightsattrib";
339 return "pointattribs";
341 return "vertattribs";
343 return "primattribs";
345 return "detailattribs";
347 return "computeweights";
349 return "computenumberstype";
351 return "computednumbersattrib";
353 return "computedweightsattrib";
363 if (fieldnum.
size() < 1)
364 return PARM_UNSUPPORTED;
395 return PARM_UNSUPPORTED;
431 loadData(is, rampdata);
449 int typelen = colon - data.
buffer();
463 {
int64 iv =
v; UTwrite(os, &iv); }
465 { UTwrite<fpreal64>(os, &
v); }
467 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
469 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
470 UTwrite<fpreal64>(os, &v.
z()); }
472 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
473 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
485 if (s) s->save(ostr);
487 saveData(os, result);
494 ostr << s->getDataTypeToken();
499 saveData(os, result);
503 void save(std::ostream &os)
const
507 saveData(os, myTotype);
508 saveData(os, myInterpby);
509 saveData(os, myNumberattrib);
510 saveData(os, myWeightsattrib);
511 saveData(os, myPointattribs);
512 saveData(os, myVertattribs);
513 saveData(os, myPrimattribs);
514 saveData(os, myDetailattribs);
515 saveData(os, myComputeweights);
516 saveData(os, myComputenumberstype);
517 saveData(os, myComputednumbersattrib);
518 saveData(os, myComputedweightsattrib);
519 saveData(os, myGroup);
532 loadData(is, myTotype);
533 loadData(is, myInterpby);
534 loadData(is, myNumberattrib);
535 loadData(is, myWeightsattrib);
536 loadData(is, myPointattribs);
537 loadData(is, myVertattribs);
538 loadData(is, myPrimattribs);
539 loadData(is, myDetailattribs);
540 loadData(is, myComputeweights);
541 loadData(is, myComputenumberstype);
542 loadData(is, myComputednumbersattrib);
543 loadData(is, myComputedweightsattrib);
544 loadData(is, myGroup);
554 if (!thissop)
return getTotype();
556 OP_Utils::evalOpParm(result, thissop,
"totype", cookparms.
getCookTime(), 0);
564 if (!thissop)
return getInterpby();
566 OP_Utils::evalOpParm(result, thissop,
"interpby", cookparms.
getCookTime(), 0);
574 if (!thissop)
return getNumberattrib();
576 OP_Utils::evalOpParm(result, thissop,
"numberattrib", cookparms.
getCookTime(), 0);
584 if (!thissop)
return getWeightsattrib();
586 OP_Utils::evalOpParm(result, thissop,
"weightsattrib", cookparms.
getCookTime(), 0);
594 if (!thissop)
return getPointattribs();
596 OP_Utils::evalOpParm(result, thissop,
"pointattribs", cookparms.
getCookTime(), 0);
604 if (!thissop)
return getVertattribs();
606 OP_Utils::evalOpParm(result, thissop,
"vertattribs", cookparms.
getCookTime(), 0);
614 if (!thissop)
return getPrimattribs();
616 OP_Utils::evalOpParm(result, thissop,
"primattribs", cookparms.
getCookTime(), 0);
624 if (!thissop)
return getDetailattribs();
626 OP_Utils::evalOpParm(result, thissop,
"detailattribs", cookparms.
getCookTime(), 0);
634 if (!thissop)
return getComputeweights();
636 OP_Utils::evalOpParm(result, thissop,
"computeweights", cookparms.
getCookTime(), 0);
644 if (!thissop)
return getComputenumberstype();
646 OP_Utils::evalOpParm(result, thissop,
"computenumberstype", cookparms.
getCookTime(), 0);
654 if (!thissop)
return getComputednumbersattrib();
656 OP_Utils::evalOpParm(result, thissop,
"computednumbersattrib", cookparms.
getCookTime(), 0);
664 if (!thissop)
return getComputedweightsattrib();
666 OP_Utils::evalOpParm(result, thissop,
"computedweightsattrib", cookparms.
getCookTime(), 0);
674 if (!thissop)
return getGroup();
676 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
689 bool myComputeweights;
690 int64 myComputenumberstype;
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setComputedweightsattrib(const UT_StringHolder &val)
~SOP_AttribInterpolateParms() override
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 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
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
GLuint const GLfloat * val
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const UT_StringHolder & getNumberattrib() const
bool operator!=(const SOP_AttribInterpolateParms &src) const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() 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
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)
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
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)
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.
const UT_StringHolder & getPrimattribs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLint GLenum GLsizei GLint GLsizei const void * data
static void saveData(std::ostream &os, UT_Matrix2D v)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
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
static void saveData(std::ostream &os, PRM_DataItemHandle s)
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
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const UT_StringHolder & getVertattribs() const
void setVertattribs(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
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
exint getNestNumParms(TempIndex idx) const override
void copyFrom(const SOP_NodeParms *src) override
Computenumberstype opComputenumberstype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Utility class for containing a color ramp.
GLdouble GLdouble GLdouble r
Interpby opInterpby(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_StringHolder opDetailattribs(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
void setComputeweights(bool val)
const UT_StringHolder & getPointattribs() const
UT_StringHolder opVertattribs(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setDetailattribs(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GLsizei const GLfloat * value
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNumberattrib(const UT_StringHolder &val)
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 setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override