22 using namespace UT::Literal;
25 namespace SOP_FitEnums
112 if (myGroup != src.myGroup)
return false;
113 if (myMethod != src.myMethod)
return false;
114 if (myType != src.myType)
return false;
115 if (mySurfType != src.mySurfType)
return false;
116 if (myOrderU != src.myOrderU)
return false;
117 if (myOrderV != src.myOrderV)
return false;
118 if (myTol != src.myTol)
return false;
119 if (mySmooth != src.mySmooth)
return false;
120 if (myMultipleU != src.myMultipleU)
return false;
121 if (myMultipleV != src.myMultipleV)
return false;
122 if (myScope != src.myScope)
return false;
123 if (myDataParmU != src.myDataParmU)
return false;
124 if (myDataParmV != src.myDataParmV)
return false;
125 if (myCloseU != src.myCloseU)
return false;
126 if (myCloseV != src.myCloseV)
return false;
127 if (myCorners != src.myCorners)
return false;
150 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
153 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
156 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
159 graph->
evalOpParm(mySurfType, nodeidx,
"surftype", time, 0);
162 graph->
evalOpParm(myOrderU, nodeidx,
"orderu", time, 0);
165 graph->
evalOpParm(myOrderV, nodeidx,
"orderv", time, 0);
167 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
168 graph->
evalOpParm(myTol, nodeidx,
"tol", time, 0);
170 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
171 graph->
evalOpParm(mySmooth, nodeidx,
"smooth", time, 0);
173 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
174 graph->
evalOpParm(myMultipleU, nodeidx,
"multipleu", time, 0);
176 if (
true && ( (
true&&!(((
int64(getMethod())!=0))||((
int64(getMethod())==1)))) ) )
177 graph->
evalOpParm(myMultipleV, nodeidx,
"multiplev", time, 0);
179 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
180 graph->
evalOpParm(myScope, nodeidx,
"scope", time, 0);
182 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
183 graph->
evalOpParm(myDataParmU, nodeidx,
"dataparmu", time, 0);
185 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
186 graph->
evalOpParm(myDataParmV, nodeidx,
"dataparmv", time, 0);
188 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
189 graph->
evalOpParm(myCloseU, nodeidx,
"closeu", time, 0);
191 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0)))) ) )
192 graph->
evalOpParm(myCloseV, nodeidx,
"closev", time, 0);
194 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())==0))||((
int64(getScope())!=1)))) ) )
195 graph->
evalOpParm(myCorners, nodeidx,
"corners", time, 0);
211 template <
typename T>
218 if (idx.
size() != instance.
size()+1)
223 coerceValue(value, myGroup);
226 coerceValue(value, myMethod);
229 coerceValue(value, myType);
232 coerceValue(value, mySurfType);
235 coerceValue(value, myOrderU);
238 coerceValue(value, myOrderV);
241 coerceValue(value, myTol);
244 coerceValue(value, mySmooth);
247 coerceValue(value, myMultipleU);
250 coerceValue(value, myMultipleV);
253 coerceValue(value, myScope);
256 coerceValue(value, myDataParmU);
259 coerceValue(value, myDataParmV);
262 coerceValue(value, myCloseU);
265 coerceValue(value, myCloseV);
268 coerceValue(value, myCorners);
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 template <
typename T>
304 if (idx.
size() != instance.
size()+1)
309 coerceValue(myGroup, ( ( value ) ));
312 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
315 coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
318 coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
321 coerceValue(myOrderU, clampMinValue(2, clampMaxValue(11, value ) ));
324 coerceValue(myOrderV, clampMinValue(2, clampMaxValue(11, value ) ));
327 coerceValue(myTol, clampMinValue(0, ( value ) ));
330 coerceValue(mySmooth, clampMinValue(0, clampMaxValue(1, value ) ));
333 coerceValue(myMultipleU, ( ( value ) ));
336 coerceValue(myMultipleV, ( ( value ) ));
339 coerceValue(myScope, clampMinValue(0, clampMaxValue(2, value ) ));
342 coerceValue(myDataParmU, clampMinValue(0, clampMaxValue(2, value ) ));
345 coerceValue(myDataParmV, clampMinValue(0, clampMaxValue(2, value ) ));
348 coerceValue(myCloseU, clampMinValue(0, clampMaxValue(2, value ) ));
351 coerceValue(myCloseV, clampMinValue(0, clampMaxValue(2, value ) ));
354 coerceValue(myCorners, ( ( value ) ));
361 { doSetParmValue(idx, instance, value); }
363 { doSetParmValue(idx, instance, value); }
365 { doSetParmValue(idx, instance, value); }
367 { doSetParmValue(idx, instance, value); }
369 { doSetParmValue(idx, instance, value); }
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, value); }
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
397 if (fieldnum.
size() < 1)
440 if (fieldnum.
size() < 1)
441 return PARM_UNSUPPORTED;
478 return PARM_UNSUPPORTED;
514 loadData(is, rampdata);
532 int typelen = colon - data.
buffer();
546 {
int64 iv =
v; UTwrite(os, &iv); }
548 { UTwrite<fpreal64>(os, &
v); }
550 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
552 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
553 UTwrite<fpreal64>(os, &v.
z()); }
555 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
556 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
568 if (s) s->save(ostr);
570 saveData(os, result);
577 ostr << s->getDataTypeToken();
582 saveData(os, result);
586 void save(std::ostream &os)
const
590 saveData(os, myGroup);
591 saveData(os, myMethod);
592 saveData(os, myType);
593 saveData(os, mySurfType);
594 saveData(os, myOrderU);
595 saveData(os, myOrderV);
597 saveData(os, mySmooth);
598 saveData(os, myMultipleU);
599 saveData(os, myMultipleV);
600 saveData(os, myScope);
601 saveData(os, myDataParmU);
602 saveData(os, myDataParmV);
603 saveData(os, myCloseU);
604 saveData(os, myCloseV);
605 saveData(os, myCorners);
618 loadData(is, myGroup);
619 loadData(is, myMethod);
620 loadData(is, myType);
621 loadData(is, mySurfType);
622 loadData(is, myOrderU);
623 loadData(is, myOrderV);
625 loadData(is, mySmooth);
626 loadData(is, myMultipleU);
627 loadData(is, myMultipleV);
628 loadData(is, myScope);
629 loadData(is, myDataParmU);
630 loadData(is, myDataParmV);
631 loadData(is, myCloseU);
632 loadData(is, myCloseV);
633 loadData(is, myCorners);
643 if (!thissop)
return getGroup();
645 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
653 if (!thissop)
return getMethod();
655 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
663 if (!thissop)
return getType();
665 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
673 if (!thissop)
return getSurfType();
675 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
683 if (!thissop)
return getOrderU();
685 OP_Utils::evalOpParm(result, thissop,
"orderu", cookparms.
getCookTime(), 0);
693 if (!thissop)
return getOrderV();
695 OP_Utils::evalOpParm(result, thissop,
"orderv", cookparms.
getCookTime(), 0);
703 if (!thissop)
return getTol();
705 OP_Utils::evalOpParm(result, thissop,
"tol", cookparms.
getCookTime(), 0);
713 if (!thissop)
return getSmooth();
715 OP_Utils::evalOpParm(result, thissop,
"smooth", cookparms.
getCookTime(), 0);
723 if (!thissop)
return getMultipleU();
725 OP_Utils::evalOpParm(result, thissop,
"multipleu", cookparms.
getCookTime(), 0);
733 if (!thissop)
return getMultipleV();
735 OP_Utils::evalOpParm(result, thissop,
"multiplev", cookparms.
getCookTime(), 0);
743 if (!thissop)
return getScope();
745 OP_Utils::evalOpParm(result, thissop,
"scope", cookparms.
getCookTime(), 0);
746 return Scope(result);
753 if (!thissop)
return getDataParmU();
755 OP_Utils::evalOpParm(result, thissop,
"dataparmu", cookparms.
getCookTime(), 0);
763 if (!thissop)
return getDataParmV();
765 OP_Utils::evalOpParm(result, thissop,
"dataparmv", cookparms.
getCookTime(), 0);
773 if (!thissop)
return getCloseU();
775 OP_Utils::evalOpParm(result, thissop,
"closeu", cookparms.
getCookTime(), 0);
783 if (!thissop)
return getCloseV();
785 OP_Utils::evalOpParm(result, thissop,
"closev", cookparms.
getCookTime(), 0);
793 if (!thissop)
return getCorners();
795 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 buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
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
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
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() 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)
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)
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)
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)
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.
void copyFrom(const SOP_NodeParms *src) override
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
DataParmV getDataParmV() const
void setCloseV(CloseV val)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) 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)
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
DEP_MicroNode * depnode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SurfType opSurfType(const SOP_NodeVerb::CookParms &cookparms) const
CloseV opCloseV(const SOP_NodeVerb::CookParms &cookparms) const
SurfType getSurfType() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
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
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
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_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
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
ParmType getNestParmType(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
SYS_FORCE_INLINE bool isstring() const
const UT_StringHolder & getGroup() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 getSmooth() const