23 namespace SOP_PointCaptureCoreEnums
36 using namespace UT::Literal;
56 using namespace UT::Literal;
75 using namespace UT::Literal;
95 myCaptureRadius = 0.1;
97 mySmoothingMethod = 0;
99 myTetMeshTreatment = 0;
100 myOutputCorrespondence =
false;
113 if (myGroup != src.myGroup)
return false;
114 if (myCaptureRadius != src.myCaptureRadius)
return false;
115 if (myKernelType != src.myKernelType)
return false;
116 if (mySmoothingMethod != src.mySmoothingMethod)
return false;
117 if (mySmoothingLevel != src.mySmoothingLevel)
return false;
118 if (myTetMeshTreatment != src.myTetMeshTreatment)
return false;
119 if (myOutputCorrespondence != src.myOutputCorrespondence)
return false;
137 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
138 myCaptureRadius = 0.1;
140 graph->
evalOpParm(myCaptureRadius, nodeidx,
"captureradius", time, 0);
143 graph->
evalOpParm(myKernelType, nodeidx,
"kerneltype", time, 0);
144 mySmoothingMethod = 0;
146 graph->
evalOpParm(mySmoothingMethod, nodeidx,
"smoothingmethod", time, 0);
147 mySmoothingLevel = 1;
149 graph->
evalOpParm(mySmoothingLevel, nodeidx,
"smoothinglevel", time, 0);
150 myTetMeshTreatment = 0;
152 graph->
evalOpParm(myTetMeshTreatment, nodeidx,
"tetmeshtreatment", time, 0);
153 myOutputCorrespondence =
false;
155 graph->
evalOpParm(myOutputCorrespondence, nodeidx,
"outputcorrespondence", time, 0);
171 template <
typename T>
178 if (idx.
size() != instance.
size()+1)
183 coerceValue(value, myGroup);
186 coerceValue(value, myCaptureRadius);
189 coerceValue(value, myKernelType);
192 coerceValue(value, mySmoothingMethod);
195 coerceValue(value, mySmoothingLevel);
198 coerceValue(value, myTetMeshTreatment);
201 coerceValue(value, myOutputCorrespondence);
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 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 template <
typename T>
246 if (idx.
size() != instance.
size()+1)
251 coerceValue(myGroup, ( ( value ) ));
254 coerceValue(myCaptureRadius, clampMinValue(0, ( value ) ));
257 coerceValue(myKernelType, clampMinValue(0, clampMaxValue(3, value ) ));
260 coerceValue(mySmoothingMethod, clampMinValue(0, clampMaxValue(2, value ) ));
263 coerceValue(mySmoothingLevel, clampMinValue(0, ( value ) ));
266 coerceValue(myTetMeshTreatment, clampMinValue(0, clampMaxValue(2, value ) ));
269 coerceValue(myOutputCorrespondence, ( ( value ) ));
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
312 if (fieldnum.
size() < 1)
319 return "captureradius";
323 return "smoothingmethod";
325 return "smoothinglevel";
327 return "tetmeshtreatment";
329 return "outputcorrespondence";
337 if (fieldnum.
size() < 1)
338 return PARM_UNSUPPORTED;
357 return PARM_UNSUPPORTED;
393 loadData(is, rampdata);
411 int typelen = colon - data.
buffer();
425 {
int64 iv =
v; UTwrite(os, &iv); }
427 { UTwrite<fpreal64>(os, &
v); }
429 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
431 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
432 UTwrite<fpreal64>(os, &v.
z()); }
434 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
435 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
447 if (s) s->save(ostr);
449 saveData(os, result);
456 ostr << s->getDataTypeToken();
461 saveData(os, result);
465 void save(std::ostream &os)
const
469 saveData(os, myGroup);
470 saveData(os, myCaptureRadius);
471 saveData(os, myKernelType);
472 saveData(os, mySmoothingMethod);
473 saveData(os, mySmoothingLevel);
474 saveData(os, myTetMeshTreatment);
475 saveData(os, myOutputCorrespondence);
488 loadData(is, myGroup);
489 loadData(is, myCaptureRadius);
490 loadData(is, myKernelType);
491 loadData(is, mySmoothingMethod);
492 loadData(is, mySmoothingLevel);
493 loadData(is, myTetMeshTreatment);
494 loadData(is, myOutputCorrespondence);
504 if (!thissop)
return getGroup();
506 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
514 if (!thissop)
return getCaptureRadius();
516 OP_Utils::evalOpParm(result, thissop,
"captureradius", cookparms.
getCookTime(), 0);
524 if (!thissop)
return getKernelType();
526 OP_Utils::evalOpParm(result, thissop,
"kerneltype", cookparms.
getCookTime(), 0);
534 if (!thissop)
return getSmoothingMethod();
536 OP_Utils::evalOpParm(result, thissop,
"smoothingmethod", cookparms.
getCookTime(), 0);
544 if (!thissop)
return getSmoothingLevel();
546 OP_Utils::evalOpParm(result, thissop,
"smoothinglevel", cookparms.
getCookTime(), 0);
554 if (!thissop)
return getTetMeshTreatment();
556 OP_Utils::evalOpParm(result, thissop,
"tetmeshtreatment", cookparms.
getCookTime(), 0);
564 if (!thissop)
return getOutputCorrespondence();
566 OP_Utils::evalOpParm(result, thissop,
"outputcorrespondence", cookparms.
getCookTime(), 0);
574 int64 mySmoothingMethod;
575 int64 mySmoothingLevel;
576 int64 myTetMeshTreatment;
577 bool myOutputCorrespondence;
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
SmoothingMethod getSmoothingMethod() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
KernelType opKernelType(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setGroup(const UT_StringHolder &val)
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_Vector2I &v)
ParmType getNestParmType(TempIndex fieldnum) const override
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setTetMeshTreatment(TetMeshTreatment val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
An output stream object that owns its own string buffer storage.
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Matrix3D v)
**But if you need a result
bool opOutputCorrespondence(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
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 setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SOP_PointCaptureCoreParms()
int64 getSmoothingLevel() const
constexpr SYS_FORCE_INLINE T & x() noexcept
fpreal64 getCaptureRadius() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator!=(const SOP_PointCaptureCoreParms &src) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) 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
SYS_FORCE_INLINE UT_StringHolder getToken(KernelType enum_value)
TetMeshTreatment opTetMeshTreatment(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const OP_GraphProxy * graph() const
const UT_StringHolder & getGroup() const
bool getOutputCorrespondence() const
TetMeshTreatment getTetMeshTreatment() const
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setOutputCorrespondence(bool val)
static void saveData(std::ostream &os, fpreal64 v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
bool operator==(const SOP_PointCaptureCoreParms &src) const
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setKernelType(KernelType val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint getNestNumParms(TempIndex idx) const override
fpreal64 opCaptureRadius(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setSmoothingLevel(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setCaptureRadius(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, int64 v)
SmoothingMethod opSmoothingMethod(const SOP_NodeVerb::CookParms &cookparms) const
KernelType getKernelType() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
int64 opSmoothingLevel(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE bool isstring() const
void setSmoothingMethod(SmoothingMethod val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & x() noexcept