23 namespace SOP_PCAEnums
34 using namespace UT::Literal;
53 using namespace UT::Literal;
77 myIncludeMeanWeight =
true;
96 if (myDataType != src.myDataType)
return false;
97 if (myAttribs != src.myAttribs)
return false;
98 if (myStride != src.myStride)
return false;
99 if (myMode != src.myMode)
return false;
100 if (myIncludeMeanWeight != src.myIncludeMeanWeight)
return false;
101 if (mySkip != src.mySkip)
return false;
102 if (myComp != src.myComp)
return false;
103 if (myXscale != src.myXscale)
return false;
104 if (myYscale != src.myYscale)
return false;
105 if (myPropcolor != src.myPropcolor)
return false;
106 if (myCumcolor != src.myCumcolor)
return false;
123 graph->
evalOpParm(myDataType, nodeidx,
"datatype", time, 0);
124 myAttribs =
"P"_UTsh;
125 if (
true && ( (
true&&!(((
int64(getDataType())!=0)))) ) )
126 graph->
evalOpParm(myAttribs, nodeidx,
"attribs", time, 0);
128 if (
true && ( (
true&&!(((
int64(getDataType())!=0)))) ) )
129 graph->
evalOpParm(myStride, nodeidx,
"stride", time, 0);
132 graph->
evalOpParm(myMode, nodeidx,
"mode", time, 0);
133 myIncludeMeanWeight =
true;
134 if (
true && ( (
true&&!(((
int64(getMode())==0))||((
int64(getMode())==1)))) ) )
135 graph->
evalOpParm(myIncludeMeanWeight, nodeidx,
"includemeanweight", time, 0);
137 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
138 graph->
evalOpParm(mySkip, nodeidx,
"skip", time, 0);
140 if (
true && ( (
true&&!(((
int64(getMode())!=0)&&(
int64(getMode())!=1)))) ) )
141 graph->
evalOpParm(myComp, nodeidx,
"comp", time, 0);
143 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
144 graph->
evalOpParm(myXscale, nodeidx,
"xscale", time, 0);
146 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
147 graph->
evalOpParm(myYscale, nodeidx,
"yscale", time, 0);
149 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
150 graph->
evalOpParm(myPropcolor, nodeidx,
"propcolor", time, 0);
152 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
153 graph->
evalOpParm(myCumcolor, nodeidx,
"cumcolor", time, 0);
169 template <
typename T>
176 if (idx.
size() != instance.
size()+1)
181 coerceValue(value, myDataType);
184 coerceValue(value, myAttribs);
187 coerceValue(value, myStride);
190 coerceValue(value, myMode);
193 coerceValue(value, myIncludeMeanWeight);
196 coerceValue(value, mySkip);
199 coerceValue(value, myComp);
202 coerceValue(value, myXscale);
205 coerceValue(value, myYscale);
208 coerceValue(value, myPropcolor);
211 coerceValue(value, myCumcolor);
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
256 if (idx.
size() != instance.
size()+1)
261 coerceValue(myDataType, clampMinValue(0, clampMaxValue(1, value ) ));
264 coerceValue(myAttribs, ( ( value ) ));
267 coerceValue(myStride, clampMinValue(1, ( value ) ));
270 coerceValue(myMode, clampMinValue(0, clampMaxValue(3, value ) ));
273 coerceValue(myIncludeMeanWeight, ( ( value ) ));
276 coerceValue(mySkip, clampMinValue(0, ( value ) ));
279 coerceValue(myComp, clampMinValue(0, ( value ) ));
282 coerceValue(myXscale, clampMinValue(0, ( value ) ));
285 coerceValue(myYscale, clampMinValue(0, ( value ) ));
288 coerceValue(myPropcolor, ( ( value ) ));
291 coerceValue(myCumcolor, ( ( value ) ));
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
316 { doSetParmValue(idx, instance, value); }
318 { doSetParmValue(idx, instance, value); }
334 if (fieldnum.
size() < 1)
347 return "includemeanweight";
367 if (fieldnum.
size() < 1)
368 return PARM_UNSUPPORTED;
395 return PARM_UNSUPPORTED;
431 loadData(is, rampdata);
449 int typelen = colon - data.
buffer();
463 {
int64 iv =
v; UTwrite(os, &iv); }
465 { UTwrite<fpreal64>(os, &
v); }
467 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
469 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
470 UTwrite<fpreal64>(os, &v.
z()); }
472 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
473 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
485 if (s) s->save(ostr);
487 saveData(os, result);
494 ostr << s->getDataTypeToken();
499 saveData(os, result);
503 void save(std::ostream &os)
const
507 saveData(os, myDataType);
508 saveData(os, myAttribs);
509 saveData(os, myStride);
510 saveData(os, myMode);
511 saveData(os, myIncludeMeanWeight);
512 saveData(os, mySkip);
513 saveData(os, myComp);
514 saveData(os, myXscale);
515 saveData(os, myYscale);
516 saveData(os, myPropcolor);
517 saveData(os, myCumcolor);
530 loadData(is, myDataType);
531 loadData(is, myAttribs);
532 loadData(is, myStride);
533 loadData(is, myMode);
534 loadData(is, myIncludeMeanWeight);
535 loadData(is, mySkip);
536 loadData(is, myComp);
537 loadData(is, myXscale);
538 loadData(is, myYscale);
539 loadData(is, myPropcolor);
540 loadData(is, myCumcolor);
550 if (!thissop)
return getDataType();
552 OP_Utils::evalOpParm(result, thissop,
"datatype", cookparms.
getCookTime(), 0);
560 if (!thissop)
return getAttribs();
562 OP_Utils::evalOpParm(result, thissop,
"attribs", cookparms.
getCookTime(), 0);
570 if (!thissop)
return getStride();
572 OP_Utils::evalOpParm(result, thissop,
"stride", cookparms.
getCookTime(), 0);
580 if (!thissop)
return getMode();
582 OP_Utils::evalOpParm(result, thissop,
"mode", cookparms.
getCookTime(), 0);
590 if (!thissop)
return getIncludeMeanWeight();
592 OP_Utils::evalOpParm(result, thissop,
"includemeanweight", cookparms.
getCookTime(), 0);
600 if (!thissop)
return getSkip();
602 OP_Utils::evalOpParm(result, thissop,
"skip", cookparms.
getCookTime(), 0);
610 if (!thissop)
return getComp();
612 OP_Utils::evalOpParm(result, thissop,
"comp", cookparms.
getCookTime(), 0);
620 if (!thissop)
return getXscale();
622 OP_Utils::evalOpParm(result, thissop,
"xscale", cookparms.
getCookTime(), 0);
630 if (!thissop)
return getYscale();
632 OP_Utils::evalOpParm(result, thissop,
"yscale", cookparms.
getCookTime(), 0);
640 if (!thissop)
return getPropcolor();
642 OP_Utils::evalOpParm(result, thissop,
"propcolor", cookparms.
getCookTime(), 0);
650 if (!thissop)
return getCumcolor();
652 OP_Utils::evalOpParm(result, thissop,
"cumcolor", cookparms.
getCookTime(), 0);
661 bool myIncludeMeanWeight;
static void loadData(UT_IStream &is, UT_Vector2D &v)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const char * getNestParmName(TempIndex fieldnum) const override
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_Vector3D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(DataType enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool operator!=(const SOP_PCAParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
DataType getDataType() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, bool &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_Vector3D getCumcolor() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE const char * buffer() const
void setDataType(DataType val)
An output stream object that owns its own string buffer storage.
bool operator==(const SOP_PCAParms &src) const
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
const UT_StringHolder & getAttribs() const
bool load(UT_IStream &is)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setPropcolor(UT_Vector3D val)
void save(std::ostream &os) const
DataType opDataType(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool opIncludeMeanWeight(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
bool isParmColorRamp(exint idx) const override
UT_Vector3D getPropcolor() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_Vector3D opPropcolor(const SOP_NodeVerb::CookParms &cookparms) const
int64 opStride(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal64 opXscale(const SOP_NodeVerb::CookParms &cookparms) const
void setStride(int64 val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
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
fpreal64 getYscale() const
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_StringHolder opAttribs(const SOP_NodeVerb::CookParms &cookparms) const
Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_Vector3T< fpreal64 > UT_Vector3D
ParmType getNestParmType(TempIndex fieldnum) const override
int64 opComp(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setAttribs(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, bool v)
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setYscale(fpreal64 val)
DEP_MicroNode * depnode() const
fpreal64 opYscale(const SOP_NodeVerb::CookParms &cookparms) const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal getCookTime() const
void setCumcolor(UT_Vector3D val)
int64 opSkip(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const char * findChar(int c) const
void setXscale(fpreal64 val)
fpreal64 getXscale() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void saveData(std::ostream &os, fpreal64 v)
bool getIncludeMeanWeight() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_Vector3D opCumcolor(const SOP_NodeVerb::CookParms &cookparms) const
void setIncludeMeanWeight(bool val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & x() noexcept