32 myTargetDimension = 1;
33 mySerialLabeledExamplesAttribute =
"value"_UTsh;
34 mySerialInputAttribute =
"value"_UTsh;
35 mySerialOutputAttribute =
"value"_UTsh;
48 if (myInputDimension != src.myInputDimension)
return false;
49 if (myTargetDimension != src.myTargetDimension)
return false;
50 if (mySerialLabeledExamplesAttribute != src.mySerialLabeledExamplesAttribute)
return false;
51 if (mySerialInputAttribute != src.mySerialInputAttribute)
return false;
52 if (mySerialOutputAttribute != src.mySerialOutputAttribute)
return false;
67 graph->
evalOpParm(myInputDimension, nodeidx,
"inputdimension", time, 0);
68 myTargetDimension = 1;
70 graph->
evalOpParm(myTargetDimension, nodeidx,
"targetdimension", time, 0);
71 mySerialLabeledExamplesAttribute =
"value"_UTsh;
73 graph->
evalOpParm(mySerialLabeledExamplesAttribute, nodeidx,
"seriallabeledexamplesattribute", time, 0);
74 mySerialInputAttribute =
"value"_UTsh;
76 graph->
evalOpParm(mySerialInputAttribute, nodeidx,
"serialinputattribute", time, 0);
77 mySerialOutputAttribute =
"value"_UTsh;
79 graph->
evalOpParm(mySerialOutputAttribute, nodeidx,
"serialoutputattribute", time, 0);
102 if (idx.
size() != instance.
size()+1)
113 coerceValue(value, mySerialLabeledExamplesAttribute);
135 { doGetParmValue(idx, instance, value); }
137 { doGetParmValue(idx, instance, value); }
139 { doGetParmValue(idx, instance, value); }
141 { doGetParmValue(idx, instance, value); }
143 { doGetParmValue(idx, instance, value); }
145 { doGetParmValue(idx, instance, value); }
147 { doGetParmValue(idx, instance, value); }
149 { doGetParmValue(idx, instance, value); }
151 { doGetParmValue(idx, instance, value); }
153 { doGetParmValue(idx, instance, value); }
155 { doGetParmValue(idx, instance, value); }
157 template <
typename T>
164 if (idx.
size() != instance.
size()+1)
175 coerceValue(mySerialLabeledExamplesAttribute, ( ( value ) ));
178 coerceValue(mySerialInputAttribute, ( ( value ) ));
181 coerceValue(mySerialOutputAttribute, ( ( value ) ));
188 { doSetParmValue(idx, instance, value); }
190 { doSetParmValue(idx, instance, value); }
192 { doSetParmValue(idx, instance, value); }
194 { doSetParmValue(idx, instance, value); }
196 { doSetParmValue(idx, instance, value); }
198 { doSetParmValue(idx, instance, value); }
200 { doSetParmValue(idx, instance, value); }
202 { doSetParmValue(idx, instance, value); }
204 { doSetParmValue(idx, instance, value); }
206 { doSetParmValue(idx, instance, value); }
208 { doSetParmValue(idx, instance, value); }
224 if (fieldnum.
size() < 1)
229 return "inputdimension";
231 return "targetdimension";
233 return "seriallabeledexamplesattribute";
235 return "serialinputattribute";
237 return "serialoutputattribute";
245 if (fieldnum.
size() < 1)
246 return PARM_UNSUPPORTED;
297 loadData(is, rampdata);
315 int typelen = colon - data.
buffer();
329 {
int64 iv =
v; UTwrite(os, &iv); }
331 { UTwrite<fpreal64>(os, &
v); }
333 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
335 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
336 UTwrite<fpreal64>(os, &v.
z()); }
338 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
339 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
351 if (s) s->save(ostr);
353 saveData(os, result);
360 ostr << s->getDataTypeToken();
365 saveData(os, result);
369 void save(std::ostream &os)
const
373 saveData(os, myInputDimension);
374 saveData(os, myTargetDimension);
375 saveData(os, mySerialLabeledExamplesAttribute);
376 saveData(os, mySerialInputAttribute);
377 saveData(os, mySerialOutputAttribute);
390 loadData(is, myInputDimension);
391 loadData(is, myTargetDimension);
392 loadData(is, mySerialLabeledExamplesAttribute);
393 loadData(is, mySerialInputAttribute);
394 loadData(is, mySerialOutputAttribute);
404 if (!thissop)
return getInputDimension();
406 OP_Utils::evalOpParm(result, thissop,
"inputdimension", cookparms.
getCookTime(), 0);
414 if (!thissop)
return getTargetDimension();
416 OP_Utils::evalOpParm(result, thissop,
"targetdimension", cookparms.
getCookTime(), 0);
424 if (!thissop)
return getSerialLabeledExamplesAttribute();
426 OP_Utils::evalOpParm(result, thissop,
"seriallabeledexamplesattribute", cookparms.
getCookTime(), 0);
434 if (!thissop)
return getSerialInputAttribute();
436 OP_Utils::evalOpParm(result, thissop,
"serialinputattribute", cookparms.
getCookTime(), 0);
444 if (!thissop)
return getSerialOutputAttribute();
446 OP_Utils::evalOpParm(result, thissop,
"serialoutputattribute", cookparms.
getCookTime(), 0);
451 int64 myInputDimension;
452 int64 myTargetDimension;
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
SOP_Node * getNode() const
int64 getInputDimension() const
void setTargetDimension(int64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setInputDimension(int64 val)
bool load(UT_IStream &is)
SOP_MLRegressionProximityCoreParms()
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
T clampMinValue(fpreal minvalue, const T &src) const
bool isParmColorRamp(exint idx) const override
UT_StringHolder opSerialOutputAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
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 saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const SOP_MLRegressionProximityCoreParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
const UT_StringHolder & getSerialOutputAttribute() const
static void saveData(std::ostream &os, UT_Matrix2D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const UT_StringHolder & getSerialLabeledExamplesAttribute() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
bool operator!=(const SOP_MLRegressionProximityCoreParms &src) const
void save(std::ostream &os) const
void setSerialOutputAttribute(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
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
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
int64 getTargetDimension() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setSerialInputAttribute(const UT_StringHolder &val)
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opSerialInputAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, int64 &v)
void coerceValue(T &result, const S &src) const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opSerialLabeledExamplesAttribute(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
const UT_StringHolder & getSerialInputAttribute() const
void setSerialLabeledExamplesAttribute(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
int64 opTargetDimension(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opInputDimension(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, bool &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, fpreal64 v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
static void loadData(UT_IStream &is, UT_Vector2D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept