23 namespace SOP_FitEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
73 using namespace UT::Literal;
96 using namespace UT::Literal;
115 using namespace UT::Literal;
116 switch (enum_value) {
134 using namespace UT::Literal;
135 switch (enum_value) {
153 using namespace UT::Literal;
154 switch (enum_value) {
172 using namespace UT::Literal;
173 switch (enum_value) {
219 if (myGroup != src.myGroup)
return false;
220 if (myMethod != src.myMethod)
return false;
221 if (myType != src.myType)
return false;
222 if (mySurfType != src.mySurfType)
return false;
223 if (myOrderU != src.myOrderU)
return false;
224 if (myOrderV != src.myOrderV)
return false;
225 if (myTol != src.myTol)
return false;
226 if (mySmooth != src.mySmooth)
return false;
227 if (myMultipleU != src.myMultipleU)
return false;
228 if (myMultipleV != src.myMultipleV)
return false;
229 if (myScope != src.myScope)
return false;
230 if (myDataParmU != src.myDataParmU)
return false;
231 if (myDataParmV != src.myDataParmV)
return false;
232 if (myCloseU != src.myCloseU)
return false;
233 if (myCloseV != src.myCloseV)
return false;
234 if (myCorners != src.myCorners)
return false;
257 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
260 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
263 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
266 graph->
evalOpParm(mySurfType, nodeidx,
"surftype", time, 0);
269 graph->
evalOpParm(myOrderU, nodeidx,
"orderu", time, 0);
272 graph->
evalOpParm(myOrderV, nodeidx,
"orderv", time, 0);
274 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
275 graph->
evalOpParm(myTol, nodeidx,
"tol", time, 0);
277 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
278 graph->
evalOpParm(mySmooth, nodeidx,
"smooth", time, 0);
280 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
281 graph->
evalOpParm(myMultipleU, nodeidx,
"multipleu", time, 0);
283 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
284 graph->
evalOpParm(myMultipleV, nodeidx,
"multiplev", time, 0);
286 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
287 graph->
evalOpParm(myScope, nodeidx,
"scope", time, 0);
289 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
290 graph->
evalOpParm(myDataParmU, nodeidx,
"dataparmu", time, 0);
292 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
293 graph->
evalOpParm(myDataParmV, nodeidx,
"dataparmv", time, 0);
295 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
296 graph->
evalOpParm(myCloseU, nodeidx,
"closeu", time, 0);
298 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
299 graph->
evalOpParm(myCloseV, nodeidx,
"closev", time, 0);
301 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0))||((
int64(getScope())!=1)))) ) )
302 graph->
evalOpParm(myCorners, nodeidx,
"corners", time, 0);
318 template <
typename T>
325 if (idx.
size() != instance.
size()+1)
330 coerceValue(value, myGroup);
333 coerceValue(value, myMethod);
336 coerceValue(value, myType);
339 coerceValue(value, mySurfType);
342 coerceValue(value, myOrderU);
345 coerceValue(value, myOrderV);
348 coerceValue(value, myTol);
351 coerceValue(value, mySmooth);
354 coerceValue(value, myMultipleU);
357 coerceValue(value, myMultipleV);
360 coerceValue(value, myScope);
363 coerceValue(value, myDataParmU);
366 coerceValue(value, myDataParmV);
369 coerceValue(value, myCloseU);
372 coerceValue(value, myCloseV);
375 coerceValue(value, myCorners);
391 { doGetParmValue(idx, instance, value); }
393 { doGetParmValue(idx, instance, value); }
395 { doGetParmValue(idx, instance, value); }
397 { doGetParmValue(idx, instance, value); }
399 { doGetParmValue(idx, instance, value); }
401 { doGetParmValue(idx, instance, value); }
403 { doGetParmValue(idx, instance, value); }
405 { doGetParmValue(idx, instance, value); }
407 { doGetParmValue(idx, instance, value); }
409 { doGetParmValue(idx, instance, value); }
411 { doGetParmValue(idx, instance, value); }
413 template <
typename T>
420 if (idx.
size() != instance.
size()+1)
425 coerceValue(myGroup, ( ( value ) ));
428 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
431 coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
434 coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
437 coerceValue(myOrderU, clampMinValue(2, clampMaxValue(11, value ) ));
440 coerceValue(myOrderV, clampMinValue(2, clampMaxValue(11, value ) ));
443 coerceValue(myTol, clampMinValue(0, ( value ) ));
446 coerceValue(mySmooth, clampMinValue(0, clampMaxValue(1, value ) ));
449 coerceValue(myMultipleU, ( ( value ) ));
452 coerceValue(myMultipleV, ( ( value ) ));
455 coerceValue(myScope, clampMinValue(0, clampMaxValue(2, value ) ));
458 coerceValue(myDataParmU, clampMinValue(0, clampMaxValue(2, value ) ));
461 coerceValue(myDataParmV, clampMinValue(0, clampMaxValue(2, value ) ));
464 coerceValue(myCloseU, clampMinValue(0, clampMaxValue(2, value ) ));
467 coerceValue(myCloseV, clampMinValue(0, clampMaxValue(2, value ) ));
470 coerceValue(myCorners, ( ( value ) ));
477 { doSetParmValue(idx, instance, value); }
479 { doSetParmValue(idx, instance, value); }
481 { doSetParmValue(idx, instance, value); }
483 { doSetParmValue(idx, instance, value); }
485 { doSetParmValue(idx, instance, value); }
487 { doSetParmValue(idx, instance, value); }
489 { doSetParmValue(idx, instance, value); }
491 { doSetParmValue(idx, instance, value); }
493 { doSetParmValue(idx, instance, value); }
495 { doSetParmValue(idx, instance, value); }
497 { doSetParmValue(idx, instance, value); }
513 if (fieldnum.
size() < 1)
556 if (fieldnum.
size() < 1)
557 return PARM_UNSUPPORTED;
594 return PARM_UNSUPPORTED;
630 loadData(is, rampdata);
648 int typelen = colon - data.
buffer();
662 {
int64 iv =
v; UTwrite(os, &iv); }
664 { UTwrite<fpreal64>(os, &
v); }
666 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
668 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
669 UTwrite<fpreal64>(os, &v.
z()); }
671 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
672 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
684 if (s) s->save(ostr);
686 saveData(os, result);
693 ostr << s->getDataTypeToken();
698 saveData(os, result);
702 void save(std::ostream &os)
const
706 saveData(os, myGroup);
707 saveData(os, myMethod);
708 saveData(os, myType);
709 saveData(os, mySurfType);
710 saveData(os, myOrderU);
711 saveData(os, myOrderV);
713 saveData(os, mySmooth);
714 saveData(os, myMultipleU);
715 saveData(os, myMultipleV);
716 saveData(os, myScope);
717 saveData(os, myDataParmU);
718 saveData(os, myDataParmV);
719 saveData(os, myCloseU);
720 saveData(os, myCloseV);
721 saveData(os, myCorners);
734 loadData(is, myGroup);
735 loadData(is, myMethod);
736 loadData(is, myType);
737 loadData(is, mySurfType);
738 loadData(is, myOrderU);
739 loadData(is, myOrderV);
741 loadData(is, mySmooth);
742 loadData(is, myMultipleU);
743 loadData(is, myMultipleV);
744 loadData(is, myScope);
745 loadData(is, myDataParmU);
746 loadData(is, myDataParmV);
747 loadData(is, myCloseU);
748 loadData(is, myCloseV);
749 loadData(is, myCorners);
759 if (!thissop)
return getGroup();
761 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
769 if (!thissop)
return getMethod();
771 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
779 if (!thissop)
return getType();
781 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
789 if (!thissop)
return getSurfType();
791 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
799 if (!thissop)
return getOrderU();
801 OP_Utils::evalOpParm(result, thissop,
"orderu", cookparms.
getCookTime(), 0);
809 if (!thissop)
return getOrderV();
811 OP_Utils::evalOpParm(result, thissop,
"orderv", cookparms.
getCookTime(), 0);
819 if (!thissop)
return getTol();
821 OP_Utils::evalOpParm(result, thissop,
"tol", cookparms.
getCookTime(), 0);
829 if (!thissop)
return getSmooth();
831 OP_Utils::evalOpParm(result, thissop,
"smooth", cookparms.
getCookTime(), 0);
839 if (!thissop)
return getMultipleU();
841 OP_Utils::evalOpParm(result, thissop,
"multipleu", cookparms.
getCookTime(), 0);
849 if (!thissop)
return getMultipleV();
851 OP_Utils::evalOpParm(result, thissop,
"multiplev", cookparms.
getCookTime(), 0);
859 if (!thissop)
return getScope();
861 OP_Utils::evalOpParm(result, thissop,
"scope", cookparms.
getCookTime(), 0);
862 return Scope(result);
869 if (!thissop)
return getDataParmU();
871 OP_Utils::evalOpParm(result, thissop,
"dataparmu", cookparms.
getCookTime(), 0);
879 if (!thissop)
return getDataParmV();
881 OP_Utils::evalOpParm(result, thissop,
"dataparmv", cookparms.
getCookTime(), 0);
889 if (!thissop)
return getCloseU();
891 OP_Utils::evalOpParm(result, thissop,
"closeu", cookparms.
getCookTime(), 0);
899 if (!thissop)
return getCloseV();
901 OP_Utils::evalOpParm(result, thissop,
"closev", cookparms.
getCookTime(), 0);
909 if (!thissop)
return getCorners();
911 OP_Utils::evalOpParm(result, thissop,
"corners", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, int64 &v)
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
CloseU opCloseU(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool operator!=(const SOP_FitParms &src) const
SOP_Node * getNode() const
bool opMultipleU(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
void setDataParmV(DataParmV val)
void setOrderU(int64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getMultipleU() const
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, PRM_DataItemHandle &value) const override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
void setMethod(Method val)
**But if you need a result
bool getMultipleV() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setCorners(bool val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setTol(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, bool v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void save(std::ostream &os) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
DataParmU getDataParmU() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setSmooth(fpreal64 val)
void setMultipleV(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &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
bool opMultipleV(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void copyFrom(const OP_NodeParms *src) override
DataParmV getDataParmV() const
void setCloseV(CloseV val)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
void setCloseU(CloseU val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setDataParmU(DataParmU val)
int64 opOrderU(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setOrderV(int64 val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void loadFromOpSubclass(const LoadParms &loadparms) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setSurfType(SurfType val)
void setMultipleU(bool val)
Scope opScope(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
SurfType opSurfType(const SOP_NodeVerb::CookParms &cookparms) const
CloseV opCloseV(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
SurfType getSurfType() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool opCorners(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
fpreal getCookTime() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
DataParmV opDataParmV(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
DataParmU opDataParmU(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool load(UT_IStream &is)
bool operator==(const SOP_FitParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
int64 opOrderV(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
ParmType getNestParmType(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
const UT_StringHolder & getGroup() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 getSmooth() const