23 namespace SOP_ExtractCentroidEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
71 using namespace UT::Literal;
89 using namespace UT::Literal;
108 myPieceAttrib =
"name"_UTsh;
112 myCentroidAttrib =
"centroid"_UTsh;
113 myTransferAttributes =
""_UTsh;
114 myTransferGroups =
""_UTsh;
127 if (myPartitionType != src.myPartitionType)
return false;
128 if (myPieceAttrib != src.myPieceAttrib)
return false;
129 if (myAttribClass != src.myAttribClass)
return false;
130 if (myMethod != src.myMethod)
return false;
131 if (myOutput != src.myOutput)
return false;
132 if (myCentroidAttrib != src.myCentroidAttrib)
return false;
133 if (myTransferAttributes != src.myTransferAttributes)
return false;
134 if (myTransferGroups != src.myTransferGroups)
return false;
153 graph->
evalOpParm(myPartitionType, nodeidx,
"partitiontype", time, 0);
154 myPieceAttrib =
"name"_UTsh;
155 if (
true && ( (
true&&!(((
int64(getPartitionType())!=1))||((
int64(getPartitionType())!=1)))) ) )
156 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, 0);
158 if (
true && ( (
true&&!(((
int64(getPartitionType())!=1))||((
int64(getPartitionType())!=1)))) ) )
159 graph->
evalOpParm(myAttribClass, nodeidx,
"class", time, 0);
162 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
165 graph->
evalOpParm(myOutput, nodeidx,
"output", time, 0);
166 myCentroidAttrib =
"centroid"_UTsh;
167 if (
true && ( (
true&&!(((
int64(getOutput())!=1))||((
int64(getOutput())!=1)))) ) )
168 graph->
evalOpParm(myCentroidAttrib, nodeidx,
"centroidattrib", time, 0);
169 myTransferAttributes =
""_UTsh;
170 if (
true && ( (
true&&!(((
int64(getOutput())!=0))||((
int64(getOutput())!=0)))) ) )
171 graph->
evalOpParm(myTransferAttributes, nodeidx,
"transferattributes", time, 0);
172 myTransferGroups =
""_UTsh;
173 if (
true && ( (
true&&!(((
int64(getOutput())!=0))||((
int64(getOutput())!=0)))) ) )
174 graph->
evalOpParm(myTransferGroups, nodeidx,
"transfergroups", time, 0);
190 template <
typename T>
197 if (idx.
size() != instance.
size()+1)
202 coerceValue(value, myPartitionType);
205 coerceValue(value, myPieceAttrib);
208 coerceValue(value, myAttribClass);
211 coerceValue(value, myMethod);
214 coerceValue(value, myOutput);
217 coerceValue(value, myCentroidAttrib);
220 coerceValue(value, myTransferAttributes);
223 coerceValue(value, myTransferGroups);
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 { doGetParmValue(idx, instance, value); }
259 { doGetParmValue(idx, instance, value); }
261 template <
typename T>
268 if (idx.
size() != instance.
size()+1)
273 coerceValue(myPartitionType, clampMinValue(0, clampMaxValue(2, value ) ));
276 coerceValue(myPieceAttrib, ( ( value ) ));
279 coerceValue(myAttribClass, clampMinValue(0, clampMaxValue(1, value ) ));
282 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
285 coerceValue(myOutput, clampMinValue(0, clampMaxValue(1, value ) ));
288 coerceValue(myCentroidAttrib, ( ( value ) ));
291 coerceValue(myTransferAttributes, ( ( value ) ));
294 coerceValue(myTransferGroups, ( ( value ) ));
301 { doSetParmValue(idx, instance, value); }
303 { doSetParmValue(idx, instance, value); }
305 { doSetParmValue(idx, instance, value); }
307 { doSetParmValue(idx, instance, value); }
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
337 if (fieldnum.
size() < 1)
342 return "partitiontype";
344 return "pieceattrib";
352 return "centroidattrib";
354 return "transferattributes";
356 return "transfergroups";
364 if (fieldnum.
size() < 1)
365 return PARM_UNSUPPORTED;
386 return PARM_UNSUPPORTED;
422 loadData(is, rampdata);
440 int typelen = colon - data.
buffer();
454 {
int64 iv =
v; UTwrite(os, &iv); }
456 { UTwrite<fpreal64>(os, &
v); }
458 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
460 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
461 UTwrite<fpreal64>(os, &v.
z()); }
463 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
464 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
476 if (s) s->save(ostr);
478 saveData(os, result);
485 ostr << s->getDataTypeToken();
490 saveData(os, result);
494 void save(std::ostream &os)
const
498 saveData(os, myPartitionType);
499 saveData(os, myPieceAttrib);
500 saveData(os, myAttribClass);
501 saveData(os, myMethod);
502 saveData(os, myOutput);
503 saveData(os, myCentroidAttrib);
504 saveData(os, myTransferAttributes);
505 saveData(os, myTransferGroups);
518 loadData(is, myPartitionType);
519 loadData(is, myPieceAttrib);
520 loadData(is, myAttribClass);
521 loadData(is, myMethod);
522 loadData(is, myOutput);
523 loadData(is, myCentroidAttrib);
524 loadData(is, myTransferAttributes);
525 loadData(is, myTransferGroups);
535 if (!thissop)
return getPartitionType();
537 OP_Utils::evalOpParm(result, thissop,
"partitiontype", cookparms.
getCookTime(), 0);
545 if (!thissop)
return getPieceAttrib();
547 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
555 if (!thissop)
return getAttribClass();
557 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
565 if (!thissop)
return getMethod();
567 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
575 if (!thissop)
return getOutput();
577 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
585 if (!thissop)
return getCentroidAttrib();
587 OP_Utils::evalOpParm(result, thissop,
"centroidattrib", cookparms.
getCookTime(), 0);
595 if (!thissop)
return getTransferAttributes();
597 OP_Utils::evalOpParm(result, thissop,
"transferattributes", cookparms.
getCookTime(), 0);
605 if (!thissop)
return getTransferGroups();
607 OP_Utils::evalOpParm(result, thissop,
"transfergroups", cookparms.
getCookTime(), 0);
612 int64 myPartitionType;
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