23 namespace SOP_TransformByAttribEnums
37 using namespace UT::Literal;
60 myXformattrib =
"xform"_UTsh;
61 myInvertXform =
false;
63 myUpdateaffectednmls =
true;
78 if (myGroup != src.myGroup)
return false;
79 if (myGrouptype != src.myGrouptype)
return false;
80 if (myXformattrib != src.myXformattrib)
return false;
81 if (myInvertXform != src.myInvertXform)
return false;
82 if (myAttribs != src.myAttribs)
return false;
83 if (myUpdateaffectednmls != src.myUpdateaffectednmls)
return false;
84 if (myVlength != src.myVlength)
return false;
85 if (myDeletexform != src.myDeletexform)
return false;
101 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
104 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, 0);
105 myXformattrib =
"xform"_UTsh;
107 graph->
evalOpParm(myXformattrib, nodeidx,
"xformattrib", time, 0);
108 myInvertXform =
false;
110 graph->
evalOpParm(myInvertXform, nodeidx,
"invertxform", time, 0);
111 myAttribs =
"*"_UTsh;
113 graph->
evalOpParm(myAttribs, nodeidx,
"attribs", time, 0);
114 myUpdateaffectednmls =
true;
116 graph->
evalOpParm(myUpdateaffectednmls, nodeidx,
"updateaffectednmls", time, 0);
119 graph->
evalOpParm(myVlength, nodeidx,
"vlength", time, 0);
120 myDeletexform =
true;
122 graph->
evalOpParm(myDeletexform, nodeidx,
"deletexform", time, 0);
138 template <
typename T>
145 if (idx.
size() != instance.
size()+1)
150 coerceValue(value, myGroup);
153 coerceValue(value, myGrouptype);
156 coerceValue(value, myXformattrib);
159 coerceValue(value, myInvertXform);
162 coerceValue(value, myAttribs);
165 coerceValue(value, myUpdateaffectednmls);
168 coerceValue(value, myVlength);
171 coerceValue(value, myDeletexform);
187 { doGetParmValue(idx, instance, value); }
189 { doGetParmValue(idx, instance, value); }
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 template <
typename T>
216 if (idx.
size() != instance.
size()+1)
221 coerceValue(myGroup, ( ( value ) ));
224 coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
227 coerceValue(myXformattrib, ( ( value ) ));
230 coerceValue(myInvertXform, ( ( value ) ));
233 coerceValue(myAttribs, ( ( value ) ));
236 coerceValue(myUpdateaffectednmls, ( ( value ) ));
239 coerceValue(myVlength, ( ( value ) ));
242 coerceValue(myDeletexform, ( ( value ) ));
249 { doSetParmValue(idx, instance, value); }
251 { doSetParmValue(idx, instance, value); }
253 { doSetParmValue(idx, instance, value); }
255 { doSetParmValue(idx, instance, value); }
257 { doSetParmValue(idx, instance, value); }
259 { doSetParmValue(idx, instance, value); }
261 { doSetParmValue(idx, instance, value); }
263 { doSetParmValue(idx, instance, value); }
265 { doSetParmValue(idx, instance, value); }
267 { doSetParmValue(idx, instance, value); }
269 { doSetParmValue(idx, instance, value); }
285 if (fieldnum.
size() < 1)
294 return "xformattrib";
296 return "invertxform";
300 return "updateaffectednmls";
304 return "deletexform";
312 if (fieldnum.
size() < 1)
313 return PARM_UNSUPPORTED;
334 return PARM_UNSUPPORTED;
370 loadData(is, rampdata);
388 int typelen = colon - data.
buffer();
402 {
int64 iv =
v; UTwrite(os, &iv); }
404 { UTwrite<fpreal64>(os, &
v); }
406 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
408 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
409 UTwrite<fpreal64>(os, &v.
z()); }
411 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
412 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
424 if (s) s->save(ostr);
426 saveData(os, result);
433 ostr << s->getDataTypeToken();
438 saveData(os, result);
442 void save(std::ostream &os)
const
446 saveData(os, myGroup);
447 saveData(os, myGrouptype);
448 saveData(os, myXformattrib);
449 saveData(os, myInvertXform);
450 saveData(os, myAttribs);
451 saveData(os, myUpdateaffectednmls);
452 saveData(os, myVlength);
453 saveData(os, myDeletexform);
466 loadData(is, myGroup);
467 loadData(is, myGrouptype);
468 loadData(is, myXformattrib);
469 loadData(is, myInvertXform);
470 loadData(is, myAttribs);
471 loadData(is, myUpdateaffectednmls);
472 loadData(is, myVlength);
473 loadData(is, myDeletexform);
483 if (!thissop)
return getGroup();
485 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
493 if (!thissop)
return getGrouptype();
495 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
503 if (!thissop)
return getXformattrib();
505 OP_Utils::evalOpParm(result, thissop,
"xformattrib", cookparms.
getCookTime(), 0);
513 if (!thissop)
return getInvertXform();
515 OP_Utils::evalOpParm(result, thissop,
"invertxform", cookparms.
getCookTime(), 0);
523 if (!thissop)
return getAttribs();
525 OP_Utils::evalOpParm(result, thissop,
"attribs", cookparms.
getCookTime(), 0);
533 if (!thissop)
return getUpdateaffectednmls();
535 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
543 if (!thissop)
return getVlength();
545 OP_Utils::evalOpParm(result, thissop,
"vlength", cookparms.
getCookTime(), 0);
553 if (!thissop)
return getDeletexform();
555 OP_Utils::evalOpParm(result, thissop,
"deletexform", cookparms.
getCookTime(), 0);
565 bool myUpdateaffectednmls;
SOP_Node * getNode() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
**But if you need a result
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
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
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
const OP_GraphProxy * graph() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
fpreal getCookTime() const
const char * findChar(int c) const
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept