20 using namespace UT::Literal;
23 namespace SOP_ErrorNodeEnums
55 if (errormsg != src.
errormsg)
return false;
73 for (
int i = 0; i < list.
entries(); i++)
104 if (myNumerror != src.myNumerror)
return false;
121 graph->
evalOpParm(length, nodeidx,
"numerror", time, 0);
122 myNumerror.entries(length);
126 auto && _curentry = myNumerror(i);
128 myNumerror(i).errormsg =
""_sh;
130 graph->
evalOpParmInst(myNumerror(i).errormsg, nodeidx,
"errormsg#", &parmidx, time, 0);
131 myNumerror(i).severity = 0;
134 myNumerror(i).enable = 0;
157 template <
typename T>
164 if (idx.
size() != instance.
size()+1)
170 coerceValue(value, myNumerror.entries());
171 else if (instance[0] < myNumerror.entries())
173 auto && _data = myNumerror(instance[0]);
177 coerceValue(value, _data.errormsg);
180 coerceValue(value, _data.severity);
183 coerceValue(value, _data.enable);
194 { doGetParmValue(idx, instance, value); }
196 { doGetParmValue(idx, instance, value); }
198 { doGetParmValue(idx, instance, value); }
200 { doGetParmValue(idx, instance, value); }
202 { doGetParmValue(idx, instance, value); }
204 { doGetParmValue(idx, instance, value); }
206 { doGetParmValue(idx, instance, value); }
208 { doGetParmValue(idx, instance, value); }
210 { doGetParmValue(idx, instance, value); }
212 { doGetParmValue(idx, instance, value); }
214 { doGetParmValue(idx, instance, value); }
216 template <
typename T>
223 if (idx.
size() != instance.
size()+1)
231 coerceValue(newsize, value);
232 myNumerror.setSize(newsize);
236 myNumerror.setSizeIfNeeded(instance[0]+1);
237 auto && _data = myNumerror(instance[0]);
241 coerceValue(_data.errormsg, value);
244 coerceValue(_data.severity, value);
247 coerceValue(_data.enable, value);
258 { doSetParmValue(idx, instance, value); }
260 { doSetParmValue(idx, instance, value); }
262 { doSetParmValue(idx, instance, value); }
264 { doSetParmValue(idx, instance, value); }
266 { doSetParmValue(idx, instance, value); }
268 { doSetParmValue(idx, instance, value); }
270 { doSetParmValue(idx, instance, value); }
272 { doSetParmValue(idx, instance, value); }
274 { doSetParmValue(idx, instance, value); }
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
296 if (fieldnum.
size() < 1)
301 if (fieldnum.
size() == 1)
321 if (fieldnum.
size() < 1)
322 return PARM_UNSUPPORTED;
326 if (fieldnum.
size() == 1)
327 return PARM_MULTIPARM;
338 return PARM_UNSUPPORTED;
341 return PARM_UNSUPPORTED;
377 loadData(is, rampdata);
395 int typelen = colon - data.
buffer();
409 {
int64 iv =
v; UTwrite(os, &iv); }
411 { UTwrite<fpreal64>(os, &
v); }
413 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
415 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
416 UTwrite<fpreal64>(os, &v.
z()); }
418 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
419 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
431 if (s) s->save(ostr);
433 saveData(os, result);
440 ostr << s->getDataTypeToken();
445 saveData(os, result);
449 void save(std::ostream &os)
const
455 UTwrite(os, &length);
458 saveData(os, myNumerror(i).errormsg);
459 saveData(os, myNumerror(i).
severity);
460 saveData(os, myNumerror(i).
enable);
479 myNumerror.entries(length);
482 loadData(is, myNumerror(i).errormsg);
483 loadData(is, myNumerror(i).
severity);
484 loadData(is, myNumerror(i).
enable);
497 if (!thissop)
return getNumerror().entries();
499 OP_Utils::evalOpParm(result, thissop,
"numerror", cookparms.
getCookTime(), 0);
505 if (!thissop)
return (myNumerror(_idx).errormsg);
506 int _parmidx = _idx + 1;
508 OP_Utils::evalOpParmInst(result, thissop,
"errormsg#", &_parmidx, cookparms.
getCookTime(), 0);
514 if (!thissop)
return (myNumerror(_idx).
severity);
515 int _parmidx = _idx + 1;
517 OP_Utils::evalOpParmInst(result, thissop,
"severity#", &_parmidx, cookparms.
getCookTime(), 0);
523 if (!thissop)
return (myNumerror(_idx).
enable);
524 int _parmidx = _idx + 1;
526 OP_Utils::evalOpParmInst(result, thissop,
"enable#", &_parmidx, cookparms.
getCookTime(), 0);
void setNumerror(const UT_Array< Numerror > &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
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)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, int *inst, fpreal time, DEP_MicroNode *depnode) const =0
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
bool operator==(const SOP_ErrorNodeParms &src) const
UT_StringHolder opNumerror_errormsg(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void saveData(std::ostream &os, int64 v)
GLuint const GLfloat * val
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
void copyFrom(const SOP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, fpreal64 v)
~SOP_ErrorNodeParms() override
const UT_Array< Numerror > & getNumerror() const
static void saveData(std::ostream &os, UT_Vector3D v)
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.
int64 opNumerror_severity(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, bool v)
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.
static void loadData(UT_IStream &is, UT_Vector4D &v)
GLint GLenum GLsizei GLint GLsizei const void * data
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint read(bool *array, exint sz=1)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
GLuint GLsizei GLsizei * length
static void saveData(std::ostream &os, UT_StringHolder s)
exint getNestNumParms(TempIndex idx) const override
void save(std::ostream &os) const
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)
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
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
DEP_MicroNode * depnode() const
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
int64 opNumerror_enable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
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)
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 buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
SYS_FORCE_INLINE void append(char character)
GLdouble GLdouble GLdouble r
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
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
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
GLenum GLuint GLsizei const GLchar * buf
static void loadData(UT_IStream &is, UT_Matrix3D &v)
GLsizei const GLfloat * value
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override