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;
138 myPolygons =
""_UTsh;
140 graph->
evalOpParm(myPolygons, nodeidx,
"polygons", time, graph->
isDirect()?
nullptr:depnode);
144 myCutPoints =
""_UTsh;
145 if (
true && ( (
true&&!(((
int64(getType())!=0)))) ) )
146 graph->
evalOpParm(myCutPoints, nodeidx,
"cutpoints", time, graph->
isDirect()?
nullptr:depnode);
147 myCutEdges =
""_UTsh;
148 if (
true && ( (
true&&!(((
int64(getType())!=1)))) ) )
149 graph->
evalOpParm(myCutEdges, nodeidx,
"cutedges", time, graph->
isDirect()?
nullptr:depnode);
152 graph->
evalOpParm(myStrategy, nodeidx,
"strategy", time, graph->
isDirect()?
nullptr:depnode);
153 myDetectEdgeChanges = 0;
155 graph->
evalOpParm(myDetectEdgeChanges, nodeidx,
"detectedgechanges", time, graph->
isDirect()?
nullptr:depnode);
156 myCutAttrib =
""_UTsh;
158 graph->
evalOpParm(myCutAttrib, nodeidx,
"cutattrib", time, graph->
isDirect()?
nullptr:depnode);
160 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=0))||((getCutAttrib()==
"")))) ) )
161 graph->
evalOpParm(myCutValue, nodeidx,
"cutvalue", time, graph->
isDirect()?
nullptr:depnode);
162 myCutStringValue =
""_UTsh;
163 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=0))||((getCutAttrib()==
"")))) ) )
164 graph->
evalOpParm(myCutStringValue, nodeidx,
"cutstringvalue", time, graph->
isDirect()?
nullptr:depnode);
166 if (
true && ( (
true&&!(((
int64(getDetectEdgeChanges())!=1))||((getCutAttrib()==
"")))) ) )
167 graph->
evalOpParm(myCutThreshold, nodeidx,
"cutthreshold", time, graph->
isDirect()?
nullptr:depnode);
170 graph->
evalOpParm(myKeepClosed, nodeidx,
"keepclosed", time, graph->
isDirect()?
nullptr:depnode);
186 template <
typename T>
193 if (idx.
size() != instance.
size()+1)
198 coerceValue(value, myPolygons);
201 coerceValue(value, myType);
204 coerceValue(value, myCutPoints);
207 coerceValue(value, myCutEdges);
210 coerceValue(value, myStrategy);
213 coerceValue(value, myDetectEdgeChanges);
216 coerceValue(value, myCutAttrib);
219 coerceValue(value, myCutValue);
222 coerceValue(value, myCutStringValue);
225 coerceValue(value, myCutThreshold);
228 coerceValue(value, myKeepClosed);
244 { doGetParmValue(idx, instance, value); }
246 { doGetParmValue(idx, instance, value); }
248 { doGetParmValue(idx, instance, value); }
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 { doGetParmValue(idx, instance, value); }
256 { doGetParmValue(idx, instance, value); }
258 { doGetParmValue(idx, instance, value); }
260 { doGetParmValue(idx, instance, value); }
262 { doGetParmValue(idx, instance, value); }
264 { doGetParmValue(idx, instance, value); }
266 template <
typename T>
273 if (idx.
size() != instance.
size()+1)
278 coerceValue(myPolygons, ( ( value ) ));
281 coerceValue(myType, clampMinValue(0, clampMaxValue(1, value ) ));
284 coerceValue(myCutPoints, ( ( value ) ));
287 coerceValue(myCutEdges, ( ( value ) ));
290 coerceValue(myStrategy, clampMinValue(0, clampMaxValue(1, value ) ));
293 coerceValue(myDetectEdgeChanges, clampMinValue(0, clampMaxValue(1, value ) ));
296 coerceValue(myCutAttrib, ( ( value ) ));
299 coerceValue(myCutValue, ( ( value ) ));
302 coerceValue(myCutStringValue, ( ( value ) ));
305 coerceValue(myCutThreshold, ( ( value ) ));
308 coerceValue(myKeepClosed, ( ( value ) ));
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
333 { doSetParmValue(idx, instance, value); }
335 { doSetParmValue(idx, instance, value); }
351 if (fieldnum.
size() < 1)
366 return "detectedgechanges";
372 return "cutstringvalue";
374 return "cutthreshold";
384 if (fieldnum.
size() < 1)
385 return PARM_UNSUPPORTED;
412 return PARM_UNSUPPORTED;
448 loadData(is, rampdata);
466 int typelen = colon - data.
buffer();
480 {
int64 iv =
v; UTwrite(os, &iv); }
482 { UTwrite<fpreal64>(os, &
v); }
484 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
486 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
487 UTwrite<fpreal64>(os, &v.
z()); }
489 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
490 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
502 if (s) s->save(ostr);
504 saveData(os, result);
511 ostr << s->getDataTypeToken();
516 saveData(os, result);
520 void save(std::ostream &os)
const
524 saveData(os, myPolygons);
525 saveData(os, myType);
526 saveData(os, myCutPoints);
527 saveData(os, myCutEdges);
528 saveData(os, myStrategy);
529 saveData(os, myDetectEdgeChanges);
530 saveData(os, myCutAttrib);
531 saveData(os, myCutValue);
532 saveData(os, myCutStringValue);
533 saveData(os, myCutThreshold);
534 saveData(os, myKeepClosed);
547 loadData(is, myPolygons);
548 loadData(is, myType);
549 loadData(is, myCutPoints);
550 loadData(is, myCutEdges);
551 loadData(is, myStrategy);
552 loadData(is, myDetectEdgeChanges);
553 loadData(is, myCutAttrib);
554 loadData(is, myCutValue);
555 loadData(is, myCutStringValue);
556 loadData(is, myCutThreshold);
557 loadData(is, myKeepClosed);
567 if (!thissop)
return getPolygons();
569 OP_Utils::evalOpParm(result, thissop,
"polygons", cookparms.
getCookTime(), 0);
577 if (!thissop)
return getType();
579 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
587 if (!thissop)
return getCutPoints();
589 OP_Utils::evalOpParm(result, thissop,
"cutpoints", cookparms.
getCookTime(), 0);
597 if (!thissop)
return getCutEdges();
599 OP_Utils::evalOpParm(result, thissop,
"cutedges", cookparms.
getCookTime(), 0);
607 if (!thissop)
return getStrategy();
609 OP_Utils::evalOpParm(result, thissop,
"strategy", cookparms.
getCookTime(), 0);
617 if (!thissop)
return getDetectEdgeChanges();
619 OP_Utils::evalOpParm(result, thissop,
"detectedgechanges", cookparms.
getCookTime(), 0);
627 if (!thissop)
return getCutAttrib();
629 OP_Utils::evalOpParm(result, thissop,
"cutattrib", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getCutValue();
639 OP_Utils::evalOpParm(result, thissop,
"cutvalue", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getCutStringValue();
649 OP_Utils::evalOpParm(result, thissop,
"cutstringvalue", cookparms.
getCookTime(), 0);
657 if (!thissop)
return getCutThreshold();
659 OP_Utils::evalOpParm(result, thissop,
"cutthreshold", cookparms.
getCookTime(), 0);
667 if (!thissop)
return getKeepClosed();
669 OP_Utils::evalOpParm(result, thissop,
"keepclosed", cookparms.
getCookTime(), 0);
679 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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)
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