23 namespace SOP_ErrorNodeEnums
35 using namespace UT::Literal;
68 if (errormsg != src.
errormsg)
return false;
70 if (enable != src.
enable)
return false;
86 for (
int i = 0; i < list.
entries(); i++)
108 myNumerror.setSize(1);
121 if (myNumerror != src.myNumerror)
return false;
138 graph->
evalOpParm(length, nodeidx,
"numerror", time, 0);
139 if (length < 0) length = 0;
140 myNumerror.setSize(length);
147 auto && _curentry = myNumerror(i);
149 _curentry.errormsg =
""_UTsh;
151 graph->
evalOpParmInst(_curentry.errormsg, nodeidx,
"errormsg#", parmidx, offsets, time, 0, 2-1);
152 _curentry.severity = 0;
154 graph->
evalOpParmInst(_curentry.severity, nodeidx,
"severity#", parmidx, offsets, time, 0, 2-1);
155 _curentry.enable = 0;
157 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
178 template <
typename T>
185 if (idx.
size() != instance.
size()+1)
191 coerceValue(value, myNumerror.entries());
192 else if (instance[0] < myNumerror.entries())
194 auto && _data = myNumerror(instance[0]);
198 coerceValue(value, _data.errormsg);
201 coerceValue(value, _data.severity);
204 coerceValue(value, _data.enable);
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 { doGetParmValue(idx, instance, value); }
230 { doGetParmValue(idx, instance, value); }
232 { doGetParmValue(idx, instance, value); }
234 { doGetParmValue(idx, instance, value); }
236 { doGetParmValue(idx, instance, value); }
238 { doGetParmValue(idx, instance, value); }
240 { doGetParmValue(idx, instance, value); }
242 { doGetParmValue(idx, instance, value); }
244 { doGetParmValue(idx, instance, value); }
246 template <
typename T>
253 if (idx.
size() != instance.
size()+1)
261 coerceValue(newsize, value);
262 if (newsize < 0) newsize = 0;
263 myNumerror.setSize(newsize);
269 myNumerror.setSizeIfNeeded(instance[0]+1);
270 auto && _data = myNumerror(instance[0]);
274 coerceValue(_data.errormsg, value);
277 coerceValue(_data.severity, value);
280 coerceValue(_data.enable, value);
291 { doSetParmValue(idx, instance, value); }
293 { doSetParmValue(idx, instance, value); }
295 { doSetParmValue(idx, instance, value); }
297 { doSetParmValue(idx, instance, value); }
299 { doSetParmValue(idx, instance, value); }
301 { doSetParmValue(idx, instance, value); }
303 { doSetParmValue(idx, instance, value); }
305 { doSetParmValue(idx, instance, value); }
307 { doSetParmValue(idx, instance, value); }
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
329 if (fieldnum.
size() < 1)
334 if (fieldnum.
size() == 1)
354 if (fieldnum.
size() < 1)
355 return PARM_UNSUPPORTED;
359 if (fieldnum.
size() == 1)
360 return PARM_MULTIPARM;
371 return PARM_UNSUPPORTED;
374 return PARM_UNSUPPORTED;
410 loadData(is, rampdata);
428 int typelen = colon - data.
buffer();
442 {
int64 iv =
v; UTwrite(os, &iv); }
444 { UTwrite<fpreal64>(os, &
v); }
446 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
448 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
449 UTwrite<fpreal64>(os, &v.
z()); }
451 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
452 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
464 if (s) s->save(ostr);
466 saveData(os, result);
473 ostr << s->getDataTypeToken();
478 saveData(os, result);
482 void save(std::ostream &os)
const
488 UTwrite(os, &length);
491 auto && _curentry = myNumerror(i);
493 saveData(os, _curentry.errormsg);
494 saveData(os, _curentry.severity);
495 saveData(os, _curentry.enable);
514 myNumerror.setSize(length);
517 auto && _curentry = myNumerror(i);
519 loadData(is, _curentry.errormsg);
520 loadData(is, _curentry.severity);
521 loadData(is, _curentry.enable);
534 if (!thissop)
return getNumerror().entries();
536 OP_Utils::evalOpParm(result, thissop,
"numerror", cookparms.
getCookTime(), 0);
540 {
return opinstNumerror_errormsg(cookparms, &_idx); }
544 if (!thissop)
return (myNumerror(_idx[0]).errormsg);
546 _parmidx[1-1] = _idx[1-1] + 1;
549 OP_Utils::evalOpParmInst(result, thissop,
"errormsg#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
553 {
return opinstNumerror_severity(cookparms, &_idx); }
557 if (!thissop)
return (myNumerror(_idx[0]).
severity);
559 _parmidx[1-1] = _idx[1-1] + 1;
562 OP_Utils::evalOpParmInst(result, thissop,
"severity#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
566 {
return opinstNumerror_enable(cookparms, &_idx); }
570 if (!thissop)
return (myNumerror(_idx[0]).enable);
572 _parmidx[1-1] = _idx[1-1] + 1;
575 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
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)
LeafData & operator=(const LeafData &)=delete
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)
SYS_FORCE_INLINE UT_StringHolder getToken(Severity enum_value)
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)
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