23 namespace SOP_PCAEnums
51 myIncludeMeanWeight =
true;
70 if (myDataType != src.myDataType)
return false;
71 if (myAttribs != src.myAttribs)
return false;
72 if (myStride != src.myStride)
return false;
73 if (myMode != src.myMode)
return false;
74 if (myIncludeMeanWeight != src.myIncludeMeanWeight)
return false;
75 if (mySkip != src.mySkip)
return false;
76 if (myComp != src.myComp)
return false;
77 if (myXscale != src.myXscale)
return false;
78 if (myYscale != src.myYscale)
return false;
79 if (myPropcolor != src.myPropcolor)
return false;
80 if (myCumcolor != src.myCumcolor)
return false;
97 graph->
evalOpParm(myDataType, nodeidx,
"datatype", time, 0);
99 if (
true && ( (
true&&!(((
int64(getDataType())!=0)))) ) )
100 graph->
evalOpParm(myAttribs, nodeidx,
"attribs", time, 0);
102 if (
true && ( (
true&&!(((
int64(getDataType())!=0)))) ) )
103 graph->
evalOpParm(myStride, nodeidx,
"stride", time, 0);
106 graph->
evalOpParm(myMode, nodeidx,
"mode", time, 0);
107 myIncludeMeanWeight =
true;
108 if (
true && ( (
true&&!(((
int64(getMode())==0))||((
int64(getMode())==1)))) ) )
109 graph->
evalOpParm(myIncludeMeanWeight, nodeidx,
"includemeanweight", time, 0);
111 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
112 graph->
evalOpParm(mySkip, nodeidx,
"skip", time, 0);
114 if (
true && ( (
true&&!(((
int64(getMode())!=0)&&(
int64(getMode())!=1)))) ) )
115 graph->
evalOpParm(myComp, nodeidx,
"comp", time, 0);
117 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
118 graph->
evalOpParm(myXscale, nodeidx,
"xscale", time, 0);
120 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
121 graph->
evalOpParm(myYscale, nodeidx,
"yscale", time, 0);
123 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
124 graph->
evalOpParm(myPropcolor, nodeidx,
"propcolor", time, 0);
126 if (
true && ( (
true&&!(((
int64(getMode())!=1)))) ) )
127 graph->
evalOpParm(myCumcolor, nodeidx,
"cumcolor", time, 0);
143 template <
typename T>
150 if (idx.
size() != instance.
size()+1)
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 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 template <
typename T>
230 if (idx.
size() != instance.
size()+1)
272 { doSetParmValue(idx, instance, value); }
274 { doSetParmValue(idx, instance, value); }
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
308 if (fieldnum.
size() < 1)
321 return "includemeanweight";
341 if (fieldnum.
size() < 1)
342 return PARM_UNSUPPORTED;
388 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
390 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
392 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
405 loadData(is, rampdata);
423 int typelen = colon - data.
buffer();
437 {
int64 iv =
v; UTwrite(os, &iv); }
439 { UTwrite<fpreal64>(os, &
v); }
441 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
443 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
444 UTwrite<fpreal64>(os, &v.
z()); }
446 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
447 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
459 if (s) s->save(ostr);
461 saveData(os, result);
468 ostr << s->getDataTypeToken();
473 saveData(os, result);
477 void save(std::ostream &os)
const
481 saveData(os, myDataType);
482 saveData(os, myAttribs);
483 saveData(os, myStride);
484 saveData(os, myMode);
485 saveData(os, myIncludeMeanWeight);
486 saveData(os, mySkip);
487 saveData(os, myComp);
488 saveData(os, myXscale);
489 saveData(os, myYscale);
490 saveData(os, myPropcolor);
491 saveData(os, myCumcolor);
504 loadData(is, myDataType);
505 loadData(is, myAttribs);
506 loadData(is, myStride);
507 loadData(is, myMode);
508 loadData(is, myIncludeMeanWeight);
509 loadData(is, mySkip);
510 loadData(is, myComp);
511 loadData(is, myXscale);
512 loadData(is, myYscale);
513 loadData(is, myPropcolor);
514 loadData(is, myCumcolor);
524 if (!thissop)
return getDataType();
526 OP_Utils::evalOpParm(result, thissop,
"datatype", cookparms.
getCookTime(), 0);
534 if (!thissop)
return getAttribs();
536 OP_Utils::evalOpParm(result, thissop,
"attribs", cookparms.
getCookTime(), 0);
544 if (!thissop)
return getStride();
546 OP_Utils::evalOpParm(result, thissop,
"stride", cookparms.
getCookTime(), 0);
554 if (!thissop)
return getMode();
556 OP_Utils::evalOpParm(result, thissop,
"mode", cookparms.
getCookTime(), 0);
564 if (!thissop)
return getIncludeMeanWeight();
566 OP_Utils::evalOpParm(result, thissop,
"includemeanweight", cookparms.
getCookTime(), 0);
574 if (!thissop)
return getSkip();
576 OP_Utils::evalOpParm(result, thissop,
"skip", cookparms.
getCookTime(), 0);
584 if (!thissop)
return getComp();
586 OP_Utils::evalOpParm(result, thissop,
"comp", cookparms.
getCookTime(), 0);
594 if (!thissop)
return getXscale();
596 OP_Utils::evalOpParm(result, thissop,
"xscale", cookparms.
getCookTime(), 0);
604 if (!thissop)
return getYscale();
606 OP_Utils::evalOpParm(result, thissop,
"yscale", cookparms.
getCookTime(), 0);
614 if (!thissop)
return getPropcolor();
616 OP_Utils::evalOpParm(result, thissop,
"propcolor", cookparms.
getCookTime(), 0);
624 if (!thissop)
return getCumcolor();
626 OP_Utils::evalOpParm(result, thissop,
"cumcolor", cookparms.
getCookTime(), 0);
635 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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool operator!=(const SOP_PCAParms &src) const
T clampMaxValue(fpreal maxvalue, const T &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
T clampMinValue(fpreal minvalue, const T &src) const
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)
void coerceValue(T &result, const S &src) const
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
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
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