20 using namespace UT::Literal;
23 namespace SOP_SBlend_2_0Enums
57 myUnmatchedPoints = 0;
58 myUnmatchedPointGroup =
"unmatched"_sh;
59 myPrimIDAttr =
"name"_sh;
61 myAdvectionDT = 0.0416667;
62 myVelocityField =
"vel"_sh;
65 myUseVForPInterp =
false;
76 if (myBlend != src.myBlend)
return false;
77 if (myAttribs != src.myAttribs)
return false;
78 if (myPtIDAttr != src.myPtIDAttr)
return false;
79 if (myUnmatchedPoints != src.myUnmatchedPoints)
return false;
80 if (myUnmatchedPointGroup != src.myUnmatchedPointGroup)
return false;
81 if (myPrimIDAttr != src.myPrimIDAttr)
return false;
82 if (myVoxelBlend != src.myVoxelBlend)
return false;
83 if (myAdvectionDT != src.myAdvectionDT)
return false;
84 if (myVelocityField != src.myVelocityField)
return false;
85 if (myDoSlerp != src.myDoSlerp)
return false;
86 if (myInterp != src.myInterp)
return false;
87 if (myUseVForPInterp != src.myUseVForPInterp)
return false;
88 if (myTimeStep != src.myTimeStep)
return false;
106 graph->
evalOpParm(myBlend, nodeidx,
"blend", time, 0);
109 graph->
evalOpParm(myAttribs, nodeidx,
"attribs", time, 0);
110 myPtIDAttr =
"id"_sh;
112 graph->
evalOpParm(myPtIDAttr, nodeidx,
"ptidattr", time, 0);
113 myUnmatchedPoints = 0;
115 graph->
evalOpParm(myUnmatchedPoints, nodeidx,
"unmatchedpts", time, 0);
116 myUnmatchedPointGroup =
"unmatched"_sh;
117 if (
true && ( (!(((
int64(getUnmatchedPoints())!=2)))) ) )
118 graph->
evalOpParm(myUnmatchedPointGroup, nodeidx,
"unmatchedgroup", time, 0);
119 myPrimIDAttr =
"name"_sh;
121 graph->
evalOpParm(myPrimIDAttr, nodeidx,
"primidattr", time, 0);
124 graph->
evalOpParm(myVoxelBlend, nodeidx,
"voxelblend", time, 0);
125 myAdvectionDT = 0.0416667;
126 if (
true && ( (!(((
int64(getVoxelBlend())!=3)))) ) )
127 graph->
evalOpParm(myAdvectionDT, nodeidx,
"adt", time, 0);
128 myVelocityField =
"vel"_sh;
129 if (
true && ( (!(((
int64(getVoxelBlend())!=3)))) ) )
130 graph->
evalOpParm(myVelocityField, nodeidx,
"velocity", time, 0);
133 graph->
evalOpParm(myDoSlerp, nodeidx,
"doslerp", time, 0);
136 graph->
evalOpParm(myInterp, nodeidx,
"interp", time, 0);
137 myUseVForPInterp =
false;
138 if (
true && ( (!(((
int64(getInterp())!=0)))) ) )
139 graph->
evalOpParm(myUseVForPInterp, nodeidx,
"usevforpinterp", time, 0);
141 if (
true && ( (!(((getUseVForPInterp()==0)&&(
int64(getVoxelBlend())!=3)))) ) )
142 graph->
evalOpParm(myTimeStep, nodeidx,
"timestep", time, 0);
158 template <
typename T>
165 if (idx.
size() != instance.
size()+1)
170 coerceValue(value, myBlend);
173 coerceValue(value, myAttribs);
176 coerceValue(value, myPtIDAttr);
179 coerceValue(value, myUnmatchedPoints);
182 coerceValue(value, myUnmatchedPointGroup);
185 coerceValue(value, myPrimIDAttr);
188 coerceValue(value, myVoxelBlend);
191 coerceValue(value, myAdvectionDT);
194 coerceValue(value, myVelocityField);
197 coerceValue(value, myDoSlerp);
200 coerceValue(value, myInterp);
203 coerceValue(value, myUseVForPInterp);
206 coerceValue(value, myTimeStep);
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(myBlend, value);
250 coerceValue(myAttribs, value);
253 coerceValue(myPtIDAttr, value);
256 coerceValue(myUnmatchedPoints, value);
259 coerceValue(myUnmatchedPointGroup, value);
262 coerceValue(myPrimIDAttr, value);
265 coerceValue(myVoxelBlend, value);
268 coerceValue(myAdvectionDT, value);
271 coerceValue(myVelocityField, value);
274 coerceValue(myDoSlerp, value);
277 coerceValue(myInterp, value);
280 coerceValue(myUseVForPInterp, value);
283 coerceValue(myTimeStep, 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)
337 return "unmatchedpts";
339 return "unmatchedgroup";
353 return "usevforpinterp";
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, myBlend);
508 saveData(os, myAttribs);
509 saveData(os, myPtIDAttr);
510 saveData(os, myUnmatchedPoints);
511 saveData(os, myUnmatchedPointGroup);
512 saveData(os, myPrimIDAttr);
513 saveData(os, myVoxelBlend);
514 saveData(os, myAdvectionDT);
515 saveData(os, myVelocityField);
516 saveData(os, myDoSlerp);
517 saveData(os, myInterp);
518 saveData(os, myUseVForPInterp);
519 saveData(os, myTimeStep);
532 loadData(is, myBlend);
533 loadData(is, myAttribs);
534 loadData(is, myPtIDAttr);
535 loadData(is, myUnmatchedPoints);
536 loadData(is, myUnmatchedPointGroup);
537 loadData(is, myPrimIDAttr);
538 loadData(is, myVoxelBlend);
539 loadData(is, myAdvectionDT);
540 loadData(is, myVelocityField);
541 loadData(is, myDoSlerp);
542 loadData(is, myInterp);
543 loadData(is, myUseVForPInterp);
544 loadData(is, myTimeStep);
554 if (!thissop)
return getBlend();
556 OP_Utils::evalOpParm(result, thissop,
"blend", cookparms.
getCookTime(), 0);
564 if (!thissop)
return getAttribs();
566 OP_Utils::evalOpParm(result, thissop,
"attribs", cookparms.
getCookTime(), 0);
574 if (!thissop)
return getPtIDAttr();
576 OP_Utils::evalOpParm(result, thissop,
"ptidattr", cookparms.
getCookTime(), 0);
584 if (!thissop)
return getUnmatchedPoints();
586 OP_Utils::evalOpParm(result, thissop,
"unmatchedpts", cookparms.
getCookTime(), 0);
594 if (!thissop)
return getUnmatchedPointGroup();
596 OP_Utils::evalOpParm(result, thissop,
"unmatchedgroup", cookparms.
getCookTime(), 0);
604 if (!thissop)
return getPrimIDAttr();
606 OP_Utils::evalOpParm(result, thissop,
"primidattr", cookparms.
getCookTime(), 0);
614 if (!thissop)
return getVoxelBlend();
616 OP_Utils::evalOpParm(result, thissop,
"voxelblend", cookparms.
getCookTime(), 0);
624 if (!thissop)
return getAdvectionDT();
626 OP_Utils::evalOpParm(result, thissop,
"adt", cookparms.
getCookTime(), 0);
634 if (!thissop)
return getVelocityField();
636 OP_Utils::evalOpParm(result, thissop,
"velocity", cookparms.
getCookTime(), 0);
644 if (!thissop)
return getDoSlerp();
646 OP_Utils::evalOpParm(result, thissop,
"doslerp", cookparms.
getCookTime(), 0);
654 if (!thissop)
return getInterp();
656 OP_Utils::evalOpParm(result, thissop,
"interp", cookparms.
getCookTime(), 0);
664 if (!thissop)
return getUseVForPInterp();
666 OP_Utils::evalOpParm(result, thissop,
"usevforpinterp", cookparms.
getCookTime(), 0);
674 if (!thissop)
return getTimeStep();
676 OP_Utils::evalOpParm(result, thissop,
"timestep", cookparms.
getCookTime(), 0);
684 int64 myUnmatchedPoints;
692 bool myUseVForPInterp;
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opPtIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
~SOP_SBlend_2_0Parms() override
VoxelBlend getVoxelBlend() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SOP_Node * getNode() const
fpreal64 getAdvectionDT() const
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const UT_StringHolder & getVelocityField() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setTimeStep(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector2D v)
exint bread(int32 *buffer, exint asize=1)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
GT_API const UT_StringHolder time
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
GLuint const GLfloat * val
Interp opInterp(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, fpreal64 &v)
SYS_FORCE_INLINE const char * buffer() const
const char * getNestParmName(TempIndex fieldnum) const override
const SOP_GraphProxy * graph() const
UT_StringHolder opUnmatchedPointGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opUseVForPInterp(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void copyFrom(const SOP_NodeParms *src) override
void setUseVForPInterp(bool val)
void setVelocityField(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void save(std::ostream &os) const
UT_StringHolder opVelocityField(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setUnmatchedPoints(UnmatchedPoints val)
UnmatchedPoints opUnmatchedPoints(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_Matrix3D 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.
static void loadData(UT_IStream &is, UT_StringHolder &v)
VoxelBlend opVoxelBlend(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opAttribs(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool load(UT_IStream &is)
fpreal64 getTimeStep() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
const UT_StringHolder & getPrimIDAttr() const
void setVoxelBlend(VoxelBlend val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
SYS_FORCE_INLINE const char * buffer() const
void setBlend(fpreal64 val)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void loadFromOpSubclass(const LoadParms &loadparms) override
GLint GLenum GLsizei GLint GLsizei const void * data
void setAttribs(const UT_StringHolder &val)
bool operator==(const SOP_SBlend_2_0Parms &src) const
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool operator!=(const SOP_SBlend_2_0Parms &src) const
void setAdvectionDT(fpreal64 val)
static void loadData(UT_IStream &is, bool &v)
fpreal64 opAdvectionDT(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setInterp(Interp val)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
void setPrimIDAttr(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UnmatchedPoints getUnmatchedPoints() const
UT_StringHolder opPrimIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Utility class for containing a color ramp.
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
GLdouble GLdouble GLdouble r
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setPtIDAttr(const UT_StringHolder &val)
void setDoSlerp(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
const UT_StringHolder & getPtIDAttr() const
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal getCookTime() const
const char * findChar(int c) const
void setUnmatchedPointGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal64 getBlend() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const UT_StringHolder & getUnmatchedPointGroup() const
const UT_StringHolder & getAttribs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const OP_Context & context() const
static void saveData(std::ostream &os, int64 v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
bool getUseVForPInterp() const
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
fpreal64 opTimeStep(const SOP_NodeVerb::CookParms &cookparms) const