20 using namespace UT::Literal;
23 namespace SOP_TransformByAttribEnums
45 myXformattrib =
"xform"_sh;
46 myInvertXform =
false;
48 myUpdateaffectednmls =
true;
60 if (myGroup != src.myGroup)
return false;
61 if (myGrouptype != src.myGrouptype)
return false;
62 if (myXformattrib != src.myXformattrib)
return false;
63 if (myInvertXform != src.myInvertXform)
return false;
64 if (myAttribs != src.myAttribs)
return false;
65 if (myUpdateaffectednmls != src.myUpdateaffectednmls)
return false;
66 if (myVlength != src.myVlength)
return false;
67 if (myDeletexform != src.myDeletexform)
return false;
83 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
86 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, 0);
87 myXformattrib =
"xform"_sh;
89 graph->
evalOpParm(myXformattrib, nodeidx,
"xformattrib", time, 0);
90 myInvertXform =
false;
92 graph->
evalOpParm(myInvertXform, nodeidx,
"invertxform", time, 0);
95 graph->
evalOpParm(myAttribs, nodeidx,
"attribs", time, 0);
96 myUpdateaffectednmls =
true;
98 graph->
evalOpParm(myUpdateaffectednmls, nodeidx,
"updateaffectednmls", time, 0);
101 graph->
evalOpParm(myVlength, nodeidx,
"vlength", time, 0);
102 myDeletexform =
true;
104 graph->
evalOpParm(myDeletexform, nodeidx,
"deletexform", time, 0);
120 template <
typename T>
127 if (idx.
size() != instance.
size()+1)
132 coerceValue(value, myGroup);
135 coerceValue(value, myGrouptype);
138 coerceValue(value, myXformattrib);
141 coerceValue(value, myInvertXform);
144 coerceValue(value, myAttribs);
147 coerceValue(value, myUpdateaffectednmls);
150 coerceValue(value, myVlength);
153 coerceValue(value, myDeletexform);
160 { doGetParmValue(idx, instance, value); }
162 { doGetParmValue(idx, instance, value); }
164 { doGetParmValue(idx, instance, value); }
166 { doGetParmValue(idx, instance, value); }
168 { doGetParmValue(idx, instance, value); }
170 { doGetParmValue(idx, instance, value); }
172 { doGetParmValue(idx, instance, value); }
174 { doGetParmValue(idx, instance, value); }
176 { doGetParmValue(idx, instance, value); }
178 { doGetParmValue(idx, instance, value); }
180 { doGetParmValue(idx, instance, value); }
182 template <
typename T>
189 if (idx.
size() != instance.
size()+1)
194 coerceValue(myGroup, value);
197 coerceValue(myGrouptype, value);
200 coerceValue(myXformattrib, value);
203 coerceValue(myInvertXform, value);
206 coerceValue(myAttribs, value);
209 coerceValue(myUpdateaffectednmls, value);
212 coerceValue(myVlength, value);
215 coerceValue(myDeletexform, value);
222 { doSetParmValue(idx, instance, value); }
224 { doSetParmValue(idx, instance, value); }
226 { doSetParmValue(idx, instance, value); }
228 { doSetParmValue(idx, instance, value); }
230 { doSetParmValue(idx, instance, value); }
232 { doSetParmValue(idx, instance, value); }
234 { doSetParmValue(idx, instance, value); }
236 { doSetParmValue(idx, instance, value); }
238 { doSetParmValue(idx, instance, value); }
240 { doSetParmValue(idx, instance, value); }
242 { doSetParmValue(idx, instance, value); }
258 if (fieldnum.
size() < 1)
267 return "xformattrib";
269 return "invertxform";
273 return "updateaffectednmls";
277 return "deletexform";
285 if (fieldnum.
size() < 1)
286 return PARM_UNSUPPORTED;
307 return PARM_UNSUPPORTED;
343 loadData(is, rampdata);
361 int typelen = colon - data.
buffer();
375 {
int64 iv =
v; UTwrite(os, &iv); }
377 { UTwrite<fpreal64>(os, &
v); }
379 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
381 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
382 UTwrite<fpreal64>(os, &v.
z()); }
384 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
385 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
397 if (s) s->save(ostr);
399 saveData(os, result);
406 ostr << s->getDataTypeToken();
411 saveData(os, result);
415 void save(std::ostream &os)
const
419 saveData(os, myGroup);
420 saveData(os, myGrouptype);
421 saveData(os, myXformattrib);
422 saveData(os, myInvertXform);
423 saveData(os, myAttribs);
424 saveData(os, myUpdateaffectednmls);
425 saveData(os, myVlength);
426 saveData(os, myDeletexform);
439 loadData(is, myGroup);
440 loadData(is, myGrouptype);
441 loadData(is, myXformattrib);
442 loadData(is, myInvertXform);
443 loadData(is, myAttribs);
444 loadData(is, myUpdateaffectednmls);
445 loadData(is, myVlength);
446 loadData(is, myDeletexform);
456 if (!thissop)
return getGroup();
458 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
466 if (!thissop)
return getGrouptype();
468 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
476 if (!thissop)
return getXformattrib();
478 OP_Utils::evalOpParm(result, thissop,
"xformattrib", cookparms.
getCookTime(), 0);
486 if (!thissop)
return getInvertXform();
488 OP_Utils::evalOpParm(result, thissop,
"invertxform", cookparms.
getCookTime(), 0);
496 if (!thissop)
return getAttribs();
498 OP_Utils::evalOpParm(result, thissop,
"attribs", cookparms.
getCookTime(), 0);
506 if (!thissop)
return getUpdateaffectednmls();
508 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
516 if (!thissop)
return getVlength();
518 OP_Utils::evalOpParm(result, thissop,
"vlength", cookparms.
getCookTime(), 0);
526 if (!thissop)
return getDeletexform();
528 OP_Utils::evalOpParm(result, thissop,
"deletexform", cookparms.
getCookTime(), 0);
538 bool myUpdateaffectednmls;
SOP_Node * getNode() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
GLuint const GLfloat * val
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
An output stream object that owns its own string buffer storage.
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
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.
GLint GLenum GLsizei GLint GLsizei const void * data
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
GLdouble GLdouble GLdouble r
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
GLsizei const GLfloat * value
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)