37 _class =
"point"_UTsh;
45 if (_class != src.
_class)
return false;
46 if (attribs != src.
attribs)
return false;
63 for (
int i = 0; i < list.
entries(); i++)
85 myPreferredPrecision =
"unchanged"_UTsh;
98 if (myCasts != src.myCasts)
return false;
99 if (myPreferredPrecision != src.myPreferredPrecision)
return false;
115 graph->
evalOpParm(length, nodeidx,
"numcasts", time, 0);
116 if (length < 0) length = 0;
117 myCasts.setSize(length);
124 auto && _curentry = myCasts(i);
126 _curentry._class =
"point"_UTsh;
128 graph->
evalOpParmInst(_curentry._class, nodeidx,
"class#", parmidx, offsets, time, 0, 2-1);
129 _curentry.attribs =
""_UTsh;
131 graph->
evalOpParmInst(_curentry.attribs, nodeidx,
"attribs#", parmidx, offsets, time, 0, 2-1);
132 _curentry.precision =
"fpreal32"_UTsh;
134 graph->
evalOpParmInst(_curentry.precision, nodeidx,
"precision#", parmidx, offsets, time, 0, 2-1);
140 myPreferredPrecision =
"unchanged"_UTsh;
142 graph->
evalOpParm(myPreferredPrecision, nodeidx,
"preferredprecision", time, 0);
158 template <
typename T>
165 if (idx.
size() != instance.
size()+1)
172 else if (instance[0] < myCasts.entries())
174 auto && _data = myCasts(instance[0]);
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
236 if (idx.
size() != instance.
size()+1)
245 if (newsize < 0) newsize = 0;
246 myCasts.setSize(newsize);
252 myCasts.setSizeIfNeeded(instance[0]+1);
253 auto && _data = myCasts(instance[0]);
277 { doSetParmValue(idx, instance, value); }
279 { doSetParmValue(idx, instance, value); }
281 { doSetParmValue(idx, instance, value); }
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
287 { doSetParmValue(idx, instance, value); }
289 { doSetParmValue(idx, instance, value); }
291 { doSetParmValue(idx, instance, value); }
293 { doSetParmValue(idx, instance, value); }
295 { doSetParmValue(idx, instance, value); }
297 { doSetParmValue(idx, instance, value); }
315 if (fieldnum.
size() < 1)
320 if (fieldnum.
size() == 1)
334 return "preferredprecision";
342 if (fieldnum.
size() < 1)
343 return PARM_UNSUPPORTED;
347 if (fieldnum.
size() == 1)
348 return PARM_MULTIPARM;
400 loadData(is, rampdata);
418 int typelen = colon - data.
buffer();
432 {
int64 iv =
v; UTwrite(os, &iv); }
434 { UTwrite<fpreal64>(os, &
v); }
436 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
438 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
439 UTwrite<fpreal64>(os, &v.
z()); }
441 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
442 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
454 if (s) s->save(ostr);
456 saveData(os, result);
463 ostr << s->getDataTypeToken();
468 saveData(os, result);
472 void save(std::ostream &os)
const
478 UTwrite(os, &length);
481 auto && _curentry = myCasts(i);
483 saveData(os, _curentry._class);
484 saveData(os, _curentry.attribs);
485 saveData(os, _curentry.precision);
489 saveData(os, myPreferredPrecision);
505 myCasts.setSize(length);
508 auto && _curentry = myCasts(i);
510 loadData(is, _curentry._class);
511 loadData(is, _curentry.attribs);
512 loadData(is, _curentry.precision);
516 loadData(is, myPreferredPrecision);
526 if (!thissop)
return getCasts().entries();
528 OP_Utils::evalOpParm(result, thissop,
"numcasts", cookparms.
getCookTime(), 0);
532 {
return opinstCasts__class(cookparms, &_idx); }
536 if (!thissop)
return (myCasts(_idx[0])._class);
538 _parmidx[1-1] = _idx[1-1] + 1;
541 OP_Utils::evalOpParmInst(result, thissop,
"class#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
545 {
return opinstCasts_attribs(cookparms, &_idx); }
549 if (!thissop)
return (myCasts(_idx[0]).attribs);
551 _parmidx[1-1] = _idx[1-1] + 1;
554 OP_Utils::evalOpParmInst(result, thissop,
"attribs#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
558 {
return opinstCasts_precision(cookparms, &_idx); }
562 if (!thissop)
return (myCasts(_idx[0]).
precision);
564 _parmidx[1-1] = _idx[1-1] + 1;
567 OP_Utils::evalOpParmInst(result, thissop,
"precision#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
576 if (!thissop)
return getPreferredPrecision();
578 OP_Utils::evalOpParm(result, thissop,
"preferredprecision", cookparms.
getCookTime(), 0);
static void loadData(UT_IStream &is, UT_Vector4D &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, fpreal64 v)
SOP_Node * getNode() const
bool load(UT_IStream &is)
UT_StringHolder createString(const UT_Array< Casts > &list) const
UT_StringHolder opinstCasts__class(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool isParmColorRamp(exint idx) const override
void setCasts(const UT_Array< Casts > &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator==(const SOP_AttribCastParms &src) const
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder opPreferredPrecision(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_StringHolder opCasts_precision(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
SYS_FORCE_INLINE const char * buffer() const
GLuint GLsizei GLsizei * length
bool operator!=(const Casts &src) const
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, int64 v)
**But if you need a result
void setPreferredPrecision(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) 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.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & x() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
GLuint GLsizei const GLuint const GLintptr * offsets
UT_StringHolder precision
UT_StringHolder opCasts_attribs(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool operator!=(const SOP_AttribCastParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
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
exint read(bool *array, exint sz=1)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const OP_GraphProxy * graph() const
exint opCasts(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix3D v)
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
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) 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 opCasts__class(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_StringHolder opinstCasts_precision(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GT_API const UT_StringHolder version
ParmType getNestParmType(TempIndex fieldnum) const override
GLenum GLint GLint * precision
exint entries() const
Alias of size(). size() is preferred.
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void coerceValue(T &result, const S &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opinstCasts_attribs(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Vector3D v)
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
const UT_StringHolder & getPreferredPrecision() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_StringHolder s)
void loadFromOpSubclass(const LoadParms &loadparms) override
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const char * findChar(int c) const
constexpr SYS_FORCE_INLINE T & y() noexcept
const UT_Array< Casts > & getCasts() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, fpreal64 &v)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool operator==(const Casts &src) const