31 myUsePackedInputComponent =
false;
32 myUsePackedTargetComponent =
false;
33 myInputValidityAttribute =
"isvalid"_UTsh;
34 myTargetValidityAttribute =
"isvalid"_UTsh;
47 if (myUsePackedInputComponent != src.myUsePackedInputComponent)
return false;
48 if (myUsePackedTargetComponent != src.myUsePackedTargetComponent)
return false;
49 if (myInputValidityAttribute != src.myInputValidityAttribute)
return false;
50 if (myTargetValidityAttribute != src.myTargetValidityAttribute)
return false;
63 myUsePackedInputComponent =
false;
65 graph->
evalOpParm(myUsePackedInputComponent, nodeidx,
"usepackedinputcomponent", time, 0);
66 myUsePackedTargetComponent =
false;
68 graph->
evalOpParm(myUsePackedTargetComponent, nodeidx,
"usepackedtargetcomponent", time, 0);
69 myInputValidityAttribute =
"isvalid"_UTsh;
71 graph->
evalOpParm(myInputValidityAttribute, nodeidx,
"inputvalidityattribute", time, 0);
72 myTargetValidityAttribute =
"isvalid"_UTsh;
74 graph->
evalOpParm(myTargetValidityAttribute, nodeidx,
"targetvalidityattribute", time, 0);
127 { doGetParmValue(idx, instance, value); }
129 { doGetParmValue(idx, instance, value); }
131 { doGetParmValue(idx, instance, value); }
133 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
156 if (idx.
size() != instance.
size()+1)
161 coerceValue(myUsePackedInputComponent, ( ( value ) ));
164 coerceValue(myUsePackedTargetComponent, ( ( value ) ));
167 coerceValue(myInputValidityAttribute, ( ( value ) ));
170 coerceValue(myTargetValidityAttribute, ( ( value ) ));
177 { doSetParmValue(idx, instance, value); }
179 { doSetParmValue(idx, instance, value); }
181 { doSetParmValue(idx, instance, value); }
183 { doSetParmValue(idx, instance, value); }
185 { doSetParmValue(idx, instance, value); }
187 { doSetParmValue(idx, instance, value); }
189 { doSetParmValue(idx, instance, value); }
191 { doSetParmValue(idx, instance, value); }
193 { doSetParmValue(idx, instance, value); }
195 { doSetParmValue(idx, instance, value); }
197 { doSetParmValue(idx, instance, value); }
213 if (fieldnum.
size() < 1)
218 return "usepackedinputcomponent";
220 return "usepackedtargetcomponent";
222 return "inputvalidityattribute";
224 return "targetvalidityattribute";
232 if (fieldnum.
size() < 1)
233 return PARM_UNSUPPORTED;
282 loadData(is, rampdata);
300 int typelen = colon - data.
buffer();
314 {
int64 iv =
v; UTwrite(os, &iv); }
316 { UTwrite<fpreal64>(os, &
v); }
318 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
320 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
321 UTwrite<fpreal64>(os, &v.
z()); }
323 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
324 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
336 if (s) s->save(ostr);
338 saveData(os, result);
345 ostr << s->getDataTypeToken();
350 saveData(os, result);
354 void save(std::ostream &os)
const
358 saveData(os, myUsePackedInputComponent);
359 saveData(os, myUsePackedTargetComponent);
360 saveData(os, myInputValidityAttribute);
361 saveData(os, myTargetValidityAttribute);
374 loadData(is, myUsePackedInputComponent);
375 loadData(is, myUsePackedTargetComponent);
376 loadData(is, myInputValidityAttribute);
377 loadData(is, myTargetValidityAttribute);
387 if (!thissop)
return getUsePackedInputComponent();
389 OP_Utils::evalOpParm(result, thissop,
"usepackedinputcomponent", cookparms.
getCookTime(), 0);
397 if (!thissop)
return getUsePackedTargetComponent();
399 OP_Utils::evalOpParm(result, thissop,
"usepackedtargetcomponent", cookparms.
getCookTime(), 0);
407 if (!thissop)
return getInputValidityAttribute();
409 OP_Utils::evalOpParm(result, thissop,
"inputvalidityattribute", cookparms.
getCookTime(), 0);
417 if (!thissop)
return getTargetValidityAttribute();
419 OP_Utils::evalOpParm(result, thissop,
"targetvalidityattribute", cookparms.
getCookTime(), 0);
424 bool myUsePackedInputComponent;
425 bool myUsePackedTargetComponent;
exint getNestNumParms(TempIndex idx) const override
void setTargetValidityAttribute(const UT_StringHolder &val)
const UT_StringHolder & getInputValidityAttribute() const
bool getUsePackedInputComponent() const
static void saveData(std::ostream &os, bool v)
bool getUsePackedTargetComponent() const
const UT_StringHolder & getTargetValidityAttribute() const
SOP_Node * getNode() const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator!=(const SOP_MLExampleCreateCoreParms &src) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
An output stream object that owns its own string buffer storage.
**But if you need a result
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
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.
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3I &v)
ParmType getNestParmType(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool operator==(const SOP_MLExampleCreateCoreParms &src) const
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 isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, bool &v)
const OP_GraphProxy * graph() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, int64 v)
void setInputValidityAttribute(const UT_StringHolder &val)
bool load(UT_IStream &is)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, fpreal64 v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opUsePackedTargetComponent(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setUsePackedTargetComponent(bool val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void coerceValue(T &result, const S &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_StringHolder opInputValidityAttribute(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
bool opUsePackedInputComponent(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
Utility class for containing a color ramp.
SOP_MLExampleCreateCoreParms()
constexpr SYS_FORCE_INLINE T & w() noexcept
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_Vector3D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setUsePackedInputComponent(bool val)
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opTargetValidityAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept