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;
141 graph->
evalOpParm(length, nodeidx,
"numerror", time, graph->
isDirect()?
nullptr:depnode);
142 if (length < 0) length = 0;
143 myNumerror.setSize(length);
150 auto && _curentry = myNumerror(i);
152 _curentry.errormsg =
""_UTsh;
154 graph->
evalOpParmInst(_curentry.errormsg, nodeidx,
"errormsg#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
155 _curentry.severity = 0;
157 graph->
evalOpParmInst(_curentry.severity, nodeidx,
"severity#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
158 _curentry.enable = 0;
160 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
181 template <
typename T>
188 if (idx.
size() != instance.
size()+1)
194 coerceValue(value, myNumerror.entries());
195 else if (instance[0] < myNumerror.entries())
197 auto && _data = myNumerror(instance[0]);
201 coerceValue(value, _data.errormsg);
204 coerceValue(value, _data.severity);
207 coerceValue(value, _data.enable);
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 template <
typename T>
256 if (idx.
size() != instance.
size()+1)
264 coerceValue(newsize, value);
265 if (newsize < 0) newsize = 0;
266 myNumerror.setSize(newsize);
272 myNumerror.setSizeIfNeeded(instance[0]+1);
273 auto && _data = myNumerror(instance[0]);
277 coerceValue(_data.errormsg, value);
280 coerceValue(_data.severity, value);
283 coerceValue(_data.enable, value);
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
332 if (fieldnum.
size() < 1)
337 if (fieldnum.
size() == 1)
357 if (fieldnum.
size() < 1)
358 return PARM_UNSUPPORTED;
362 if (fieldnum.
size() == 1)
363 return PARM_MULTIPARM;
374 return PARM_UNSUPPORTED;
377 return PARM_UNSUPPORTED;
413 loadData(is, rampdata);
431 int typelen = colon - data.
buffer();
445 {
int64 iv =
v; UTwrite(os, &iv); }
447 { UTwrite<fpreal64>(os, &
v); }
449 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
451 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
452 UTwrite<fpreal64>(os, &v.
z()); }
454 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
455 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
467 if (s) s->save(ostr);
469 saveData(os, result);
476 ostr << s->getDataTypeToken();
481 saveData(os, result);
485 void save(std::ostream &os)
const
491 UTwrite(os, &length);
494 auto && _curentry = myNumerror(i);
496 saveData(os, _curentry.errormsg);
497 saveData(os, _curentry.severity);
498 saveData(os, _curentry.enable);
517 myNumerror.setSize(length);
520 auto && _curentry = myNumerror(i);
522 loadData(is, _curentry.errormsg);
523 loadData(is, _curentry.severity);
524 loadData(is, _curentry.enable);
537 if (!thissop)
return getNumerror().entries();
539 OP_Utils::evalOpParm(result, thissop,
"numerror", cookparms.
getCookTime(), 0);
543 {
return opinstNumerror_errormsg(cookparms, &_idx); }
547 if (!thissop)
return (myNumerror(_idx[0]).errormsg);
549 _parmidx[1-1] = _idx[1-1] + 1;
552 OP_Utils::evalOpParmInst(result, thissop,
"errormsg#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
556 {
return opinstNumerror_severity(cookparms, &_idx); }
560 if (!thissop)
return (myNumerror(_idx[0]).
severity);
562 _parmidx[1-1] = _idx[1-1] + 1;
565 OP_Utils::evalOpParmInst(result, thissop,
"severity#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
569 {
return opinstNumerror_enable(cookparms, &_idx); }
573 if (!thissop)
return (myNumerror(_idx[0]).enable);
575 _parmidx[1-1] = _idx[1-1] + 1;
578 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
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
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