23 namespace SOP_ExtractCentroidEnums
58 myPieceAttrib =
"name"_UTsh;
62 myCentroidAttrib =
"centroid"_UTsh;
63 myTransferAttributes =
""_UTsh;
64 myTransferGroups =
""_UTsh;
77 if (myPartitionType != src.myPartitionType)
return false;
78 if (myPieceAttrib != src.myPieceAttrib)
return false;
79 if (myAttribClass != src.myAttribClass)
return false;
80 if (myMethod != src.myMethod)
return false;
81 if (myOutput != src.myOutput)
return false;
82 if (myCentroidAttrib != src.myCentroidAttrib)
return false;
83 if (myTransferAttributes != src.myTransferAttributes)
return false;
84 if (myTransferGroups != src.myTransferGroups)
return false;
103 graph->
evalOpParm(myPartitionType, nodeidx,
"partitiontype", time, 0);
104 myPieceAttrib =
"name"_UTsh;
105 if (
true && ( (
true&&!(((
int64(getPartitionType())!=1))||((
int64(getPartitionType())!=1)))) ) )
106 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, 0);
108 if (
true && ( (
true&&!(((
int64(getPartitionType())!=1))||((
int64(getPartitionType())!=1)))) ) )
109 graph->
evalOpParm(myAttribClass, nodeidx,
"class", time, 0);
112 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
115 graph->
evalOpParm(myOutput, nodeidx,
"output", time, 0);
116 myCentroidAttrib =
"centroid"_UTsh;
117 if (
true && ( (
true&&!(((
int64(getOutput())!=1))||((
int64(getOutput())!=1)))) ) )
118 graph->
evalOpParm(myCentroidAttrib, nodeidx,
"centroidattrib", time, 0);
119 myTransferAttributes =
""_UTsh;
120 if (
true && ( (
true&&!(((
int64(getOutput())!=0))||((
int64(getOutput())!=0)))) ) )
121 graph->
evalOpParm(myTransferAttributes, nodeidx,
"transferattributes", time, 0);
122 myTransferGroups =
""_UTsh;
123 if (
true && ( (
true&&!(((
int64(getOutput())!=0))||((
int64(getOutput())!=0)))) ) )
124 graph->
evalOpParm(myTransferGroups, nodeidx,
"transfergroups", time, 0);
140 template <
typename T>
147 if (idx.
size() != instance.
size()+1)
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 { doGetParmValue(idx, instance, value); }
211 template <
typename T>
218 if (idx.
size() != instance.
size()+1)
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); }
271 { doSetParmValue(idx, instance, value); }
287 if (fieldnum.
size() < 1)
292 return "partitiontype";
294 return "pieceattrib";
302 return "centroidattrib";
304 return "transferattributes";
306 return "transfergroups";
314 if (fieldnum.
size() < 1)
315 return PARM_UNSUPPORTED;
355 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
357 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
359 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
372 loadData(is, rampdata);
390 int typelen = colon - data.
buffer();
404 {
int64 iv =
v; UTwrite(os, &iv); }
406 { UTwrite<fpreal64>(os, &
v); }
408 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
410 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
411 UTwrite<fpreal64>(os, &v.
z()); }
413 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
414 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
426 if (s) s->save(ostr);
428 saveData(os, result);
435 ostr << s->getDataTypeToken();
440 saveData(os, result);
444 void save(std::ostream &os)
const
448 saveData(os, myPartitionType);
449 saveData(os, myPieceAttrib);
450 saveData(os, myAttribClass);
451 saveData(os, myMethod);
452 saveData(os, myOutput);
453 saveData(os, myCentroidAttrib);
454 saveData(os, myTransferAttributes);
455 saveData(os, myTransferGroups);
468 loadData(is, myPartitionType);
469 loadData(is, myPieceAttrib);
470 loadData(is, myAttribClass);
471 loadData(is, myMethod);
472 loadData(is, myOutput);
473 loadData(is, myCentroidAttrib);
474 loadData(is, myTransferAttributes);
475 loadData(is, myTransferGroups);
485 if (!thissop)
return getPartitionType();
487 OP_Utils::evalOpParm(result, thissop,
"partitiontype", cookparms.
getCookTime(), 0);
495 if (!thissop)
return getPieceAttrib();
497 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
505 if (!thissop)
return getAttribClass();
507 OP_Utils::evalOpParm(result, thissop,
"class", cookparms.
getCookTime(), 0);
515 if (!thissop)
return getMethod();
517 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
525 if (!thissop)
return getOutput();
527 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
535 if (!thissop)
return getCentroidAttrib();
537 OP_Utils::evalOpParm(result, thissop,
"centroidattrib", cookparms.
getCookTime(), 0);
545 if (!thissop)
return getTransferAttributes();
547 OP_Utils::evalOpParm(result, thissop,
"transferattributes", cookparms.
getCookTime(), 0);
555 if (!thissop)
return getTransferGroups();
557 OP_Utils::evalOpParm(result, thissop,
"transfergroups", cookparms.
getCookTime(), 0);
562 int64 myPartitionType;
SOP_Node * getNode() const
T clampMaxValue(fpreal maxvalue, const T &src) 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
T clampMinValue(fpreal minvalue, const T &src) const
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
void coerceValue(T &result, const S &src) const
DEP_MicroNode * depnode() const
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept