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;
104 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
107 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, graph->
isDirect()?
nullptr:depnode);
108 myXformattrib =
"xform"_UTsh;
110 graph->
evalOpParm(myXformattrib, nodeidx,
"xformattrib", time, graph->
isDirect()?
nullptr:depnode);
111 myInvertXform =
false;
113 graph->
evalOpParm(myInvertXform, nodeidx,
"invertxform", time, graph->
isDirect()?
nullptr:depnode);
114 myAttribs =
"*"_UTsh;
116 graph->
evalOpParm(myAttribs, nodeidx,
"attribs", time, graph->
isDirect()?
nullptr:depnode);
117 myUpdateaffectednmls =
true;
119 graph->
evalOpParm(myUpdateaffectednmls, nodeidx,
"updateaffectednmls", time, graph->
isDirect()?
nullptr:depnode);
122 graph->
evalOpParm(myVlength, nodeidx,
"vlength", time, graph->
isDirect()?
nullptr:depnode);
123 myDeletexform =
true;
125 graph->
evalOpParm(myDeletexform, nodeidx,
"deletexform", time, graph->
isDirect()?
nullptr:depnode);
141 template <
typename T>
148 if (idx.
size() != instance.
size()+1)
153 coerceValue(value, myGroup);
156 coerceValue(value, myGrouptype);
159 coerceValue(value, myXformattrib);
162 coerceValue(value, myInvertXform);
165 coerceValue(value, myAttribs);
168 coerceValue(value, myUpdateaffectednmls);
171 coerceValue(value, myVlength);
174 coerceValue(value, myDeletexform);
190 { doGetParmValue(idx, instance, value); }
192 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
219 if (idx.
size() != instance.
size()+1)
224 coerceValue(myGroup, ( ( value ) ));
227 coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
230 coerceValue(myXformattrib, ( ( value ) ));
233 coerceValue(myInvertXform, ( ( value ) ));
236 coerceValue(myAttribs, ( ( value ) ));
239 coerceValue(myUpdateaffectednmls, ( ( value ) ));
242 coerceValue(myVlength, ( ( value ) ));
245 coerceValue(myDeletexform, ( ( value ) ));
252 { doSetParmValue(idx, instance, value); }
254 { doSetParmValue(idx, instance, value); }
256 { doSetParmValue(idx, instance, 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); }
288 if (fieldnum.
size() < 1)
297 return "xformattrib";
299 return "invertxform";
303 return "updateaffectednmls";
307 return "deletexform";
315 if (fieldnum.
size() < 1)
316 return PARM_UNSUPPORTED;
337 return PARM_UNSUPPORTED;
373 loadData(is, rampdata);
391 int typelen = colon - data.
buffer();
405 {
int64 iv =
v; UTwrite(os, &iv); }
407 { UTwrite<fpreal64>(os, &
v); }
409 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
411 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
412 UTwrite<fpreal64>(os, &v.
z()); }
414 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
415 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
427 if (s) s->save(ostr);
429 saveData(os, result);
436 ostr << s->getDataTypeToken();
441 saveData(os, result);
445 void save(std::ostream &os)
const
449 saveData(os, myGroup);
450 saveData(os, myGrouptype);
451 saveData(os, myXformattrib);
452 saveData(os, myInvertXform);
453 saveData(os, myAttribs);
454 saveData(os, myUpdateaffectednmls);
455 saveData(os, myVlength);
456 saveData(os, myDeletexform);
469 loadData(is, myGroup);
470 loadData(is, myGrouptype);
471 loadData(is, myXformattrib);
472 loadData(is, myInvertXform);
473 loadData(is, myAttribs);
474 loadData(is, myUpdateaffectednmls);
475 loadData(is, myVlength);
476 loadData(is, myDeletexform);
486 if (!thissop)
return getGroup();
488 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
496 if (!thissop)
return getGrouptype();
498 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
506 if (!thissop)
return getXformattrib();
508 OP_Utils::evalOpParm(result, thissop,
"xformattrib", cookparms.
getCookTime(), 0);
516 if (!thissop)
return getInvertXform();
518 OP_Utils::evalOpParm(result, thissop,
"invertxform", cookparms.
getCookTime(), 0);
526 if (!thissop)
return getAttribs();
528 OP_Utils::evalOpParm(result, thissop,
"attribs", cookparms.
getCookTime(), 0);
536 if (!thissop)
return getUpdateaffectednmls();
538 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
546 if (!thissop)
return getVlength();
548 OP_Utils::evalOpParm(result, thissop,
"vlength", cookparms.
getCookTime(), 0);
556 if (!thissop)
return getDeletexform();
558 OP_Utils::evalOpParm(result, thissop,
"deletexform", cookparms.
getCookTime(), 0);
568 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
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
fpreal getCookTime() const
const char * findChar(int c) const
constexpr SYS_FORCE_INLINE T & y() noexcept
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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