23 namespace SOP_PolyCutEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
68 using namespace UT::Literal;
88 myCutPoints =
""_UTsh;
91 myDetectEdgeChanges = 0;
92 myCutAttrib =
""_UTsh;
94 myCutStringValue =
""_UTsh;
109 if (myPolygons != src.myPolygons)
return false;
110 if (myType != src.myType)
return false;
111 if (myCutPoints != src.myCutPoints)
return false;
112 if (myCutEdges != src.myCutEdges)
return false;
113 if (myStrategy != src.myStrategy)
return false;
114 if (myDetectEdgeChanges != src.myDetectEdgeChanges)
return false;
115 if (myCutAttrib != src.myCutAttrib)
return false;
116 if (myCutValue != src.myCutValue)
return false;
117 if (myCutStringValue != src.myCutStringValue)
return false;
118 if (myCutThreshold != src.myCutThreshold)
return false;
119 if (myKeepClosed != src.myKeepClosed)
return false;
135 myPolygons =
""_UTsh;
137 graph->
evalOpParm(myPolygons, nodeidx,
"polygons", time, 0);
140 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
141 myCutPoints =
""_UTsh;
142 if (
true && ( (
true&&!(((
int64(getType())!=0)))) ) )
143 graph->
evalOpParm(myCutPoints, nodeidx,
"cutpoints", time, 0);
144 myCutEdges =
""_UTsh;
145 if (
true && ( (
true&&!(((
int64(getType())!=1)))) ) )
146 graph->
evalOpParm(myCutEdges, nodeidx,
"cutedges", time, 0);
149 graph->
evalOpParm(myStrategy, nodeidx,
"strategy", time, 0);
150 myDetectEdgeChanges = 0;
152 graph->
evalOpParm(myDetectEdgeChanges, nodeidx,
"detectedgechanges", time, 0);
153 myCutAttrib =
""_UTsh;
155 graph->
evalOpParm(myCutAttrib, nodeidx,
"cutattrib", time, 0);
157 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=0))||((getCutAttrib()==
"")))) ) )
158 graph->
evalOpParm(myCutValue, nodeidx,
"cutvalue", time, 0);
159 myCutStringValue =
""_UTsh;
160 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=0))||((getCutAttrib()==
"")))) ) )
161 graph->
evalOpParm(myCutStringValue, nodeidx,
"cutstringvalue", time, 0);
163 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=1))||((getCutAttrib()==
"")))) ) )
164 graph->
evalOpParm(myCutThreshold, nodeidx,
"cutthreshold", time, 0);
167 graph->
evalOpParm(myKeepClosed, nodeidx,
"keepclosed", time, 0);
183 template <
typename T>
190 if (idx.
size() != instance.
size()+1)
195 coerceValue(value, myPolygons);
198 coerceValue(value, myType);
201 coerceValue(value, myCutPoints);
204 coerceValue(value, myCutEdges);
207 coerceValue(value, myStrategy);
210 coerceValue(value, myDetectEdgeChanges);
213 coerceValue(value, myCutAttrib);
216 coerceValue(value, myCutValue);
219 coerceValue(value, myCutStringValue);
222 coerceValue(value, myCutThreshold);
225 coerceValue(value, myKeepClosed);
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 { doGetParmValue(idx, instance, value); }
263 template <
typename T>
270 if (idx.
size() != instance.
size()+1)
275 coerceValue(myPolygons, ( ( value ) ));
278 coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
281 coerceValue(myCutPoints, ( ( value ) ));
284 coerceValue(myCutEdges, ( ( value ) ));
287 coerceValue(myStrategy, clampMinValue(0, clampMaxValue(1, value ) ));
290 coerceValue(myDetectEdgeChanges, clampMinValue(0, clampMaxValue(1, value ) ));
293 coerceValue(myCutAttrib, ( ( value ) ));
296 coerceValue(myCutValue, ( ( value ) ));
299 coerceValue(myCutStringValue, ( ( value ) ));
302 coerceValue(myCutThreshold, ( ( value ) ));
305 coerceValue(myKeepClosed, ( ( value ) ));
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
316 { doSetParmValue(idx, instance, value); }
318 { doSetParmValue(idx, instance, value); }
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
348 if (fieldnum.
size() < 1)
363 return "detectedgechanges";
369 return "cutstringvalue";
371 return "cutthreshold";
381 if (fieldnum.
size() < 1)
382 return PARM_UNSUPPORTED;
409 return PARM_UNSUPPORTED;
445 loadData(is, rampdata);
463 int typelen = colon - data.
buffer();
477 {
int64 iv =
v; UTwrite(os, &iv); }
479 { UTwrite<fpreal64>(os, &
v); }
481 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
483 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
484 UTwrite<fpreal64>(os, &v.
z()); }
486 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
487 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
499 if (s) s->save(ostr);
501 saveData(os, result);
508 ostr << s->getDataTypeToken();
513 saveData(os, result);
517 void save(std::ostream &os)
const
521 saveData(os, myPolygons);
522 saveData(os, myType);
523 saveData(os, myCutPoints);
524 saveData(os, myCutEdges);
525 saveData(os, myStrategy);
526 saveData(os, myDetectEdgeChanges);
527 saveData(os, myCutAttrib);
528 saveData(os, myCutValue);
529 saveData(os, myCutStringValue);
530 saveData(os, myCutThreshold);
531 saveData(os, myKeepClosed);
544 loadData(is, myPolygons);
545 loadData(is, myType);
546 loadData(is, myCutPoints);
547 loadData(is, myCutEdges);
548 loadData(is, myStrategy);
549 loadData(is, myDetectEdgeChanges);
550 loadData(is, myCutAttrib);
551 loadData(is, myCutValue);
552 loadData(is, myCutStringValue);
553 loadData(is, myCutThreshold);
554 loadData(is, myKeepClosed);
564 if (!thissop)
return getPolygons();
566 OP_Utils::evalOpParm(result, thissop,
"polygons", cookparms.
getCookTime(), 0);
574 if (!thissop)
return getType();
576 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
584 if (!thissop)
return getCutPoints();
586 OP_Utils::evalOpParm(result, thissop,
"cutpoints", cookparms.
getCookTime(), 0);
594 if (!thissop)
return getCutEdges();
596 OP_Utils::evalOpParm(result, thissop,
"cutedges", cookparms.
getCookTime(), 0);
604 if (!thissop)
return getStrategy();
606 OP_Utils::evalOpParm(result, thissop,
"strategy", cookparms.
getCookTime(), 0);
614 if (!thissop)
return getDetectEdgeChanges();
616 OP_Utils::evalOpParm(result, thissop,
"detectedgechanges", cookparms.
getCookTime(), 0);
624 if (!thissop)
return getCutAttrib();
626 OP_Utils::evalOpParm(result, thissop,
"cutattrib", cookparms.
getCookTime(), 0);
634 if (!thissop)
return getCutValue();
636 OP_Utils::evalOpParm(result, thissop,
"cutvalue", cookparms.
getCookTime(), 0);
644 if (!thissop)
return getCutStringValue();
646 OP_Utils::evalOpParm(result, thissop,
"cutstringvalue", cookparms.
getCookTime(), 0);
654 if (!thissop)
return getCutThreshold();
656 OP_Utils::evalOpParm(result, thissop,
"cutthreshold", cookparms.
getCookTime(), 0);
664 if (!thissop)
return getKeepClosed();
666 OP_Utils::evalOpParm(result, thissop,
"keepclosed", cookparms.
getCookTime(), 0);
676 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
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
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
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
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 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)
LeafData & operator=(const LeafData &)=delete
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
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