23 namespace SOP_MLExampleDecomposeCoreEnums
34 using namespace UT::Literal;
53 myKeepComponentPacked =
false;
66 if (myComponentType != src.myComponentType)
return false;
67 if (myKeepComponentPacked != src.myKeepComponentPacked)
return false;
83 graph->
evalOpParm(myComponentType, nodeidx,
"componenttype", time, 0);
84 myKeepComponentPacked =
false;
86 graph->
evalOpParm(myKeepComponentPacked, nodeidx,
"keepcomponentpacked", time, 0);
102 template <
typename T>
109 if (idx.
size() != instance.
size()+1)
114 coerceValue(value, myComponentType);
117 coerceValue(value, myKeepComponentPacked);
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 { doGetParmValue(idx, instance, value); }
151 { doGetParmValue(idx, instance, value); }
153 { doGetParmValue(idx, instance, value); }
155 template <
typename T>
162 if (idx.
size() != instance.
size()+1)
167 coerceValue(myComponentType, clampMinValue(0, clampMaxValue(1, value ) ));
170 coerceValue(myKeepComponentPacked, ( ( 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 "componenttype";
220 return "keepcomponentpacked";
228 if (fieldnum.
size() < 1)
229 return PARM_UNSUPPORTED;
238 return PARM_UNSUPPORTED;
274 loadData(is, rampdata);
292 int typelen = colon - data.
buffer();
306 {
int64 iv =
v; UTwrite(os, &iv); }
308 { UTwrite<fpreal64>(os, &
v); }
310 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
312 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
313 UTwrite<fpreal64>(os, &v.
z()); }
315 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
316 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
328 if (s) s->save(ostr);
330 saveData(os, result);
337 ostr << s->getDataTypeToken();
342 saveData(os, result);
346 void save(std::ostream &os)
const
350 saveData(os, myComponentType);
351 saveData(os, myKeepComponentPacked);
364 loadData(is, myComponentType);
365 loadData(is, myKeepComponentPacked);
375 if (!thissop)
return getComponentType();
377 OP_Utils::evalOpParm(result, thissop,
"componenttype", cookparms.
getCookTime(), 0);
385 if (!thissop)
return getKeepComponentPacked();
387 OP_Utils::evalOpParm(result, thissop,
"keepcomponentpacked", cookparms.
getCookTime(), 0);
392 int64 myComponentType;
393 bool myKeepComponentPacked;
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool operator==(const SOP_MLExampleDecomposeCoreParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint bread(int32 *buffer, exint asize=1)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, fpreal64 v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, bool &v)
**But if you need a result
static void saveData(std::ostream &os, UT_Vector4D 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.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
ComponentType getComponentType() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator!=(const SOP_MLExampleDecomposeCoreParms &src) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setKeepComponentPacked(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
ComponentType opComponentType(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opKeepComponentPacked(const SOP_NodeVerb::CookParms &cookparms) 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 getKeepComponentPacked() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Matrix4D v)
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setComponentType(ComponentType val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Matrix2D &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_Matrix4D &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void copyFrom(const OP_NodeParms *src) override
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Vector3D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SOP_MLExampleDecomposeCoreParms()
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal getCookTime() const
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const char * findChar(int c) const
SYS_FORCE_INLINE UT_StringHolder getToken(ComponentType enum_value)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept