20 using namespace UT::Literal;
23 namespace SOP_ExtractCentroidEnums
56 myPieceAttrib =
"name"_sh;
60 myCentroidAttrib =
"centroid"_sh;
61 myTransferAttributes =
""_sh;
62 myTransferGroups =
""_sh;
72 if (myPartitionType != src.myPartitionType)
return false;
73 if (myPieceAttrib != src.myPieceAttrib)
return false;
74 if (myAttribClass != src.myAttribClass)
return false;
75 if (myMethod != src.myMethod)
return false;
76 if (myOutput != src.myOutput)
return false;
77 if (myCentroidAttrib != src.myCentroidAttrib)
return false;
78 if (myTransferAttributes != src.myTransferAttributes)
return false;
79 if (myTransferGroups != src.myTransferGroups)
return false;
98 graph->
evalOpParm(myPartitionType, nodeidx,
"partitiontype", time, 0);
99 myPieceAttrib =
"name"_sh;
100 if (
true && ( (!(((
int64(getPartitionType())!=0))||((
int64(getPartitionType())!=0)))) ) )
101 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, 0);
103 if (
true && ( (!(((
int64(getPartitionType())!=0))||((
int64(getPartitionType())!=0)))) ) )
104 graph->
evalOpParm(myAttribClass, nodeidx,
"class", time, 0);
107 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
110 graph->
evalOpParm(myOutput, nodeidx,
"output", time, 0);
111 myCentroidAttrib =
"centroid"_sh;
112 if (
true && ( (!(((
int64(getOutput())!=1))||((
int64(getOutput())!=1)))) ) )
113 graph->
evalOpParm(myCentroidAttrib, nodeidx,
"centroidattrib", time, 0);
114 myTransferAttributes =
""_sh;
115 if (
true && ( (!(((
int64(getOutput())!=0))||((
int64(getOutput())!=0)))) ) )
116 graph->
evalOpParm(myTransferAttributes, nodeidx,
"transferattributes", time, 0);
117 myTransferGroups =
""_sh;
118 if (
true && ( (!(((
int64(getOutput())!=0))||((
int64(getOutput())!=0)))) ) )
119 graph->
evalOpParm(myTransferGroups, nodeidx,
"transfergroups", time, 0);
135 template <
typename T>
142 if (idx.
size() != instance.
size()+1)
147 coerceValue(value, myPartitionType);
150 coerceValue(value, myPieceAttrib);
153 coerceValue(value, myAttribClass);
156 coerceValue(value, myMethod);
159 coerceValue(value, myOutput);
162 coerceValue(value, myCentroidAttrib);
165 coerceValue(value, myTransferAttributes);
168 coerceValue(value, myTransferGroups);
175 { doGetParmValue(idx, instance, value); }
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 { doGetParmValue(idx, instance, value); }
183 { doGetParmValue(idx, instance, value); }
185 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
204 if (idx.
size() != instance.
size()+1)
209 coerceValue(myPartitionType, value);
212 coerceValue(myPieceAttrib, value);
215 coerceValue(myAttribClass, value);
218 coerceValue(myMethod, value);
221 coerceValue(myOutput, value);
224 coerceValue(myCentroidAttrib, value);
227 coerceValue(myTransferAttributes, value);
230 coerceValue(myTransferGroups, value);
237 { doSetParmValue(idx, instance, value); }
239 { doSetParmValue(idx, instance, value); }
241 { doSetParmValue(idx, instance, value); }
243 { doSetParmValue(idx, instance, value); }
245 { doSetParmValue(idx, instance, value); }
247 { doSetParmValue(idx, instance, 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); }
273 if (fieldnum.
size() < 1)
278 return "partitiontype";
280 return "pieceattrib";
288 return "centroidattrib";
290 return "transferattributes";
292 return "transfergroups";
300 if (fieldnum.
size() < 1)
301 return PARM_UNSUPPORTED;
322 return PARM_UNSUPPORTED;
358 loadData(is, rampdata);
376 int typelen = colon - data.
buffer();
390 {
int64 iv =
v; UTwrite(os, &iv); }
392 { UTwrite<fpreal64>(os, &
v); }
394 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
396 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
397 UTwrite<fpreal64>(os, &v.
z()); }
399 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
400 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
412 if (s) s->save(ostr);
414 saveData(os, result);
421 ostr << s->getDataTypeToken();
426 saveData(os, result);
430 void save(std::ostream &os)
const
434 saveData(os, myPartitionType);
435 saveData(os, myPieceAttrib);
436 saveData(os, myAttribClass);
437 saveData(os, myMethod);
438 saveData(os, myOutput);
439 saveData(os, myCentroidAttrib);
440 saveData(os, myTransferAttributes);
441 saveData(os, myTransferGroups);
454 loadData(is, myPartitionType);
455 loadData(is, myPieceAttrib);
456 loadData(is, myAttribClass);
457 loadData(is, myMethod);
458 loadData(is, myOutput);
459 loadData(is, myCentroidAttrib);
460 loadData(is, myTransferAttributes);
461 loadData(is, myTransferGroups);
471 if (!thissop)
return getPartitionType();
473 OP_Utils::evalOpParm(result, thissop,
"partitiontype", cookparms.
getCookTime(), 0);
481 if (!thissop)
return getPieceAttrib();
483 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
491 if (!thissop)
return getAttribClass();
493 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
501 if (!thissop)
return getMethod();
503 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
511 if (!thissop)
return getOutput();
513 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
521 if (!thissop)
return getCentroidAttrib();
523 OP_Utils::evalOpParm(result, thissop,
"centroidattrib", cookparms.
getCookTime(), 0);
531 if (!thissop)
return getTransferAttributes();
533 OP_Utils::evalOpParm(result, thissop,
"transferattributes", cookparms.
getCookTime(), 0);
541 if (!thissop)
return getTransferGroups();
543 OP_Utils::evalOpParm(result, thissop,
"transfergroups", cookparms.
getCookTime(), 0);
548 int64 myPartitionType;
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)