23 namespace SOP_PolyCutEnums
52 myCutPoints =
""_UTsh;
55 myDetectEdgeChanges = 0;
56 myCutAttrib =
""_UTsh;
58 myCutStringValue =
""_UTsh;
73 if (myPolygons != src.myPolygons)
return false;
74 if (myType != src.myType)
return false;
75 if (myCutPoints != src.myCutPoints)
return false;
76 if (myCutEdges != src.myCutEdges)
return false;
77 if (myStrategy != src.myStrategy)
return false;
78 if (myDetectEdgeChanges != src.myDetectEdgeChanges)
return false;
79 if (myCutAttrib != src.myCutAttrib)
return false;
80 if (myCutValue != src.myCutValue)
return false;
81 if (myCutStringValue != src.myCutStringValue)
return false;
82 if (myCutThreshold != src.myCutThreshold)
return false;
83 if (myKeepClosed != src.myKeepClosed)
return false;
101 graph->
evalOpParm(myPolygons, nodeidx,
"polygons", time, 0);
104 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
105 myCutPoints =
""_UTsh;
106 if (
true && ( (
true&&!(((
int64(getType())!=0)))) ) )
107 graph->
evalOpParm(myCutPoints, nodeidx,
"cutpoints", time, 0);
108 myCutEdges =
""_UTsh;
109 if (
true && ( (
true&&!(((
int64(getType())!=1)))) ) )
110 graph->
evalOpParm(myCutEdges, nodeidx,
"cutedges", time, 0);
113 graph->
evalOpParm(myStrategy, nodeidx,
"strategy", time, 0);
114 myDetectEdgeChanges = 0;
116 graph->
evalOpParm(myDetectEdgeChanges, nodeidx,
"detectedgechanges", time, 0);
117 myCutAttrib =
""_UTsh;
119 graph->
evalOpParm(myCutAttrib, nodeidx,
"cutattrib", time, 0);
121 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=0))||((getCutAttrib()==
"")))) ) )
122 graph->
evalOpParm(myCutValue, nodeidx,
"cutvalue", time, 0);
123 myCutStringValue =
""_UTsh;
124 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=0))||((getCutAttrib()==
"")))) ) )
125 graph->
evalOpParm(myCutStringValue, nodeidx,
"cutstringvalue", time, 0);
127 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=1))||((getCutAttrib()==
"")))) ) )
128 graph->
evalOpParm(myCutThreshold, nodeidx,
"cutthreshold", time, 0);
131 graph->
evalOpParm(myKeepClosed, nodeidx,
"keepclosed", time, 0);
147 template <
typename T>
154 if (idx.
size() != instance.
size()+1)
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 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 template <
typename T>
234 if (idx.
size() != instance.
size()+1)
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); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
312 if (fieldnum.
size() < 1)
327 return "detectedgechanges";
333 return "cutstringvalue";
335 return "cutthreshold";
345 if (fieldnum.
size() < 1)
346 return PARM_UNSUPPORTED;
392 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
394 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
396 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
409 loadData(is, rampdata);
427 int typelen = colon - data.
buffer();
441 {
int64 iv =
v; UTwrite(os, &iv); }
443 { UTwrite<fpreal64>(os, &
v); }
445 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
447 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
448 UTwrite<fpreal64>(os, &v.
z()); }
450 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
451 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
463 if (s) s->save(ostr);
465 saveData(os, result);
472 ostr << s->getDataTypeToken();
477 saveData(os, result);
481 void save(std::ostream &os)
const
485 saveData(os, myPolygons);
486 saveData(os, myType);
487 saveData(os, myCutPoints);
488 saveData(os, myCutEdges);
489 saveData(os, myStrategy);
490 saveData(os, myDetectEdgeChanges);
491 saveData(os, myCutAttrib);
492 saveData(os, myCutValue);
493 saveData(os, myCutStringValue);
494 saveData(os, myCutThreshold);
495 saveData(os, myKeepClosed);
508 loadData(is, myPolygons);
509 loadData(is, myType);
510 loadData(is, myCutPoints);
511 loadData(is, myCutEdges);
512 loadData(is, myStrategy);
513 loadData(is, myDetectEdgeChanges);
514 loadData(is, myCutAttrib);
515 loadData(is, myCutValue);
516 loadData(is, myCutStringValue);
517 loadData(is, myCutThreshold);
518 loadData(is, myKeepClosed);
528 if (!thissop)
return getPolygons();
530 OP_Utils::evalOpParm(result, thissop,
"polygons", cookparms.
getCookTime(), 0);
538 if (!thissop)
return getType();
540 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
548 if (!thissop)
return getCutPoints();
550 OP_Utils::evalOpParm(result, thissop,
"cutpoints", cookparms.
getCookTime(), 0);
558 if (!thissop)
return getCutEdges();
560 OP_Utils::evalOpParm(result, thissop,
"cutedges", cookparms.
getCookTime(), 0);
568 if (!thissop)
return getStrategy();
570 OP_Utils::evalOpParm(result, thissop,
"strategy", cookparms.
getCookTime(), 0);
578 if (!thissop)
return getDetectEdgeChanges();
580 OP_Utils::evalOpParm(result, thissop,
"detectedgechanges", cookparms.
getCookTime(), 0);
588 if (!thissop)
return getCutAttrib();
590 OP_Utils::evalOpParm(result, thissop,
"cutattrib", cookparms.
getCookTime(), 0);
598 if (!thissop)
return getCutValue();
600 OP_Utils::evalOpParm(result, thissop,
"cutvalue", cookparms.
getCookTime(), 0);
608 if (!thissop)
return getCutStringValue();
610 OP_Utils::evalOpParm(result, thissop,
"cutstringvalue", cookparms.
getCookTime(), 0);
618 if (!thissop)
return getCutThreshold();
620 OP_Utils::evalOpParm(result, thissop,
"cutthreshold", cookparms.
getCookTime(), 0);
628 if (!thissop)
return getKeepClosed();
630 OP_Utils::evalOpParm(result, thissop,
"keepclosed", cookparms.
getCookTime(), 0);
640 int64 myDetectEdgeChanges;
void setKeepClosed(bool val)
const UT_StringHolder & getCutEdges() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setCutThreshold(fpreal64 val)
void setPolygons(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
T clampMaxValue(fpreal maxvalue, const T &src) const
const char * getNestParmName(TempIndex fieldnum) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, int64 &v)
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal64 opCutValue(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCutEdges(const SOP_NodeVerb::CookParms &cookparms) const
void setDetectEdgeChanges(DetectEdgeChanges val)
bool getKeepClosed() const
bool operator==(const SOP_PolyCutParms &src) const
const OP_Context & context() const
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, fpreal64 v)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getPolygons() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
An output stream object that owns its own string buffer storage.
Strategy opStrategy(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
void copyFrom(const OP_NodeParms *src) override
T clampMinValue(fpreal minvalue, const T &src) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setCutStringValue(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder opCutPoints(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setStrategy(Strategy val)
bool operator!=(const SOP_PolyCutParms &src) const
void setCutEdges(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & getCutStringValue() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
DetectEdgeChanges opDetectEdgeChanges(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getCutAttrib() const
bool isParmColorRamp(exint idx) const override
bool opKeepClosed(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, int64 v)
void setCutAttrib(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
void coerceValue(T &result, const S &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setCutValue(fpreal64 val)
DEP_MicroNode * depnode() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
Utility class for containing a color ramp.
UT_StringHolder opCutAttrib(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPolygons(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal64 getCutValue() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setCutPoints(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_StringHolder opCutStringValue(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
fpreal64 opCutThreshold(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getCutPoints() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & y() noexcept
fpreal64 getCutThreshold() const
static void saveData(std::ostream &os, bool v)
DetectEdgeChanges getDetectEdgeChanges() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector4D &v)
SYS_FORCE_INLINE bool isstring() const
OP_NodeParms & operator=(const OP_NodeParms &)=default
static void loadData(UT_IStream &is, UT_Vector3I &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_Vector2I &v)
Strategy getStrategy() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept