23 namespace SOP_ErrorNodeEnums
55 if (errormsg != src.
errormsg)
return false;
57 if (enable != src.
enable)
return false;
73 for (
int i = 0; i < list.
entries(); i++)
95 myNumerror.setSize(1);
108 if (myNumerror != src.myNumerror)
return false;
125 graph->
evalOpParm(length, nodeidx,
"numerror", time, 0);
126 if (length < 0) length = 0;
127 myNumerror.setSize(length);
134 auto && _curentry = myNumerror(i);
136 _curentry.errormsg =
""_UTsh;
138 graph->
evalOpParmInst(_curentry.errormsg, nodeidx,
"errormsg#", parmidx, offsets, time, 0, 2-1);
139 _curentry.severity = 0;
141 graph->
evalOpParmInst(_curentry.severity, nodeidx,
"severity#", parmidx, offsets, time, 0, 2-1);
142 _curentry.enable = 0;
144 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
165 template <
typename T>
172 if (idx.
size() != instance.
size()+1)
179 else if (instance[0] < myNumerror.entries())
181 auto && _data = myNumerror(instance[0]);
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 template <
typename T>
240 if (idx.
size() != instance.
size()+1)
249 if (newsize < 0) newsize = 0;
250 myNumerror.setSize(newsize);
256 myNumerror.setSizeIfNeeded(instance[0]+1);
257 auto && _data = myNumerror(instance[0]);
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
316 if (fieldnum.
size() < 1)
321 if (fieldnum.
size() == 1)
341 if (fieldnum.
size() < 1)
342 return PARM_UNSUPPORTED;
346 if (fieldnum.
size() == 1)
347 return PARM_MULTIPARM;
380 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
382 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
384 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
397 loadData(is, rampdata);
415 int typelen = colon - data.
buffer();
429 {
int64 iv =
v; UTwrite(os, &iv); }
431 { UTwrite<fpreal64>(os, &
v); }
433 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
435 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
436 UTwrite<fpreal64>(os, &v.
z()); }
438 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
439 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
451 if (s) s->save(ostr);
453 saveData(os, result);
460 ostr << s->getDataTypeToken();
465 saveData(os, result);
469 void save(std::ostream &os)
const
475 UTwrite(os, &length);
478 auto && _curentry = myNumerror(i);
480 saveData(os, _curentry.errormsg);
481 saveData(os, _curentry.severity);
482 saveData(os, _curentry.enable);
501 myNumerror.setSize(length);
504 auto && _curentry = myNumerror(i);
506 loadData(is, _curentry.errormsg);
507 loadData(is, _curentry.severity);
508 loadData(is, _curentry.enable);
521 if (!thissop)
return getNumerror().entries();
523 OP_Utils::evalOpParm(result, thissop,
"numerror", cookparms.
getCookTime(), 0);
527 {
return opinstNumerror_errormsg(cookparms, &_idx); }
531 if (!thissop)
return (myNumerror(_idx[0]).errormsg);
533 _parmidx[1-1] = _idx[1-1] + 1;
536 OP_Utils::evalOpParmInst(result, thissop,
"errormsg#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
540 {
return opinstNumerror_severity(cookparms, &_idx); }
544 if (!thissop)
return (myNumerror(_idx[0]).
severity);
546 _parmidx[1-1] = _idx[1-1] + 1;
549 OP_Utils::evalOpParmInst(result, thissop,
"severity#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
553 {
return opinstNumerror_enable(cookparms, &_idx); }
557 if (!thissop)
return (myNumerror(_idx[0]).enable);
559 _parmidx[1-1] = _idx[1-1] + 1;
562 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
int64 opinstNumerror_severity(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNumerror(const UT_Array< Numerror > &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
SOP_Node * getNode() const
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_Vector4D v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator==(const SOP_ErrorNodeParms &src) const
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opinstNumerror_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool isParmColorRamp(exint idx) const override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
GLuint GLsizei GLsizei * length
static void loadData(UT_IStream &is, UT_Vector4I &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, fpreal64 v)
const UT_Array< Numerror > & getNumerror() const
static void saveData(std::ostream &os, UT_Vector3D v)
**But if you need a result
int64 opNumerror_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
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
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, bool v)
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Vector2D 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
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 opNumerror_severity(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
exint getNestNumParms(TempIndex idx) const override
void save(std::ostream &os) const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opinstNumerror_errormsg(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_StringHolder opNumerror_errormsg(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
UT_StringHolder createString(const UT_Array< Numerror > &list) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
bool operator!=(const Numerror &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void coerceValue(T &result, const S &src) const
exint opNumerror(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
DEP_MicroNode * depnode() const
bool operator==(const Numerror &src) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
Utility class for containing a color ramp.
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator!=(const SOP_ErrorNodeParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
fpreal getCookTime() const
const char * findChar(int c) const
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override