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;
86 graph->
evalOpParm(myComponentType, nodeidx,
"componenttype", time, graph->
isDirect()?
nullptr:depnode);
87 myKeepComponentPacked =
false;
89 graph->
evalOpParm(myKeepComponentPacked, nodeidx,
"keepcomponentpacked", time, graph->
isDirect()?
nullptr:depnode);
105 template <
typename T>
112 if (idx.
size() != instance.
size()+1)
117 coerceValue(value, myComponentType);
120 coerceValue(value, myKeepComponentPacked);
136 { doGetParmValue(idx, instance, value); }
138 { doGetParmValue(idx, instance, value); }
140 { doGetParmValue(idx, instance, value); }
142 { doGetParmValue(idx, instance, value); }
144 { doGetParmValue(idx, instance, value); }
146 { doGetParmValue(idx, instance, value); }
148 { doGetParmValue(idx, instance, value); }
150 { doGetParmValue(idx, instance, value); }
152 { doGetParmValue(idx, instance, value); }
154 { doGetParmValue(idx, instance, value); }
156 { doGetParmValue(idx, instance, value); }
158 template <
typename T>
165 if (idx.
size() != instance.
size()+1)
170 coerceValue(myComponentType, clampMinValue(0, clampMaxValue(1, value ) ));
173 coerceValue(myKeepComponentPacked, ( ( value ) ));
180 { doSetParmValue(idx, instance, value); }
182 { doSetParmValue(idx, instance, value); }
184 { doSetParmValue(idx, instance, value); }
186 { doSetParmValue(idx, instance, 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); }
216 if (fieldnum.
size() < 1)
221 return "componenttype";
223 return "keepcomponentpacked";
231 if (fieldnum.
size() < 1)
232 return PARM_UNSUPPORTED;
241 return PARM_UNSUPPORTED;
277 loadData(is, rampdata);
295 int typelen = colon - data.
buffer();
309 {
int64 iv =
v; UTwrite(os, &iv); }
311 { UTwrite<fpreal64>(os, &
v); }
313 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
315 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
316 UTwrite<fpreal64>(os, &v.
z()); }
318 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
319 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
331 if (s) s->save(ostr);
333 saveData(os, result);
340 ostr << s->getDataTypeToken();
345 saveData(os, result);
349 void save(std::ostream &os)
const
353 saveData(os, myComponentType);
354 saveData(os, myKeepComponentPacked);
367 loadData(is, myComponentType);
368 loadData(is, myKeepComponentPacked);
378 if (!thissop)
return getComponentType();
380 OP_Utils::evalOpParm(result, thissop,
"componenttype", cookparms.
getCookTime(), 0);
388 if (!thissop)
return getKeepComponentPacked();
390 OP_Utils::evalOpParm(result, thissop,
"keepcomponentpacked", cookparms.
getCookTime(), 0);
395 int64 myComponentType;
396 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)
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)
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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)
exint bread(uint8 *buffer, exint asize=1)
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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