23 namespace SOP_RewireEnums
37 using namespace UT::Literal;
60 myAttrib =
"rewire_to"_UTsh;
61 myDeleteTargetPointAttrib =
false;
63 myKeepunusedpoints =
false;
64 myCreateorigattrib =
false;
65 myOrigattrib =
"rewired_from"_UTsh;
78 if (myGroup != src.myGroup)
return false;
79 if (myGrouptype != src.myGrouptype)
return false;
80 if (myAttrib != src.myAttrib)
return false;
81 if (myDeleteTargetPointAttrib != src.myDeleteTargetPointAttrib)
return false;
82 if (myRecurse != src.myRecurse)
return false;
83 if (myKeepunusedpoints != src.myKeepunusedpoints)
return false;
84 if (myCreateorigattrib != src.myCreateorigattrib)
return false;
85 if (myOrigattrib != src.myOrigattrib)
return false;
101 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
104 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, 0);
105 myAttrib =
"rewire_to"_UTsh;
107 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
108 myDeleteTargetPointAttrib =
false;
110 graph->
evalOpParm(myDeleteTargetPointAttrib, nodeidx,
"deletetargetpointattrib", time, 0);
113 graph->
evalOpParm(myRecurse, nodeidx,
"recurse", time, 0);
114 myKeepunusedpoints =
false;
116 graph->
evalOpParm(myKeepunusedpoints, nodeidx,
"keepunusedpoints", time, 0);
117 myCreateorigattrib =
false;
119 graph->
evalOpParm(myCreateorigattrib, nodeidx,
"createorigattrib", time, 0);
120 myOrigattrib =
"rewired_from"_UTsh;
121 if (
true && ( (
true&&!(((getCreateorigattrib()==0)))) ) )
122 graph->
evalOpParm(myOrigattrib, nodeidx,
"origattrib", time, 0);
138 template <
typename T>
145 if (idx.
size() != instance.
size()+1)
150 coerceValue(value, myGroup);
153 coerceValue(value, myGrouptype);
156 coerceValue(value, myAttrib);
159 coerceValue(value, myDeleteTargetPointAttrib);
162 coerceValue(value, myRecurse);
165 coerceValue(value, myKeepunusedpoints);
168 coerceValue(value, myCreateorigattrib);
171 coerceValue(value, myOrigattrib);
187 { doGetParmValue(idx, instance, value); }
189 { doGetParmValue(idx, instance, value); }
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 template <
typename T>
216 if (idx.
size() != instance.
size()+1)
221 coerceValue(myGroup, ( ( value ) ));
224 coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
227 coerceValue(myAttrib, ( ( value ) ));
230 coerceValue(myDeleteTargetPointAttrib, ( ( value ) ));
233 coerceValue(myRecurse, ( ( value ) ));
236 coerceValue(myKeepunusedpoints, ( ( value ) ));
239 coerceValue(myCreateorigattrib, ( ( value ) ));
242 coerceValue(myOrigattrib, ( ( value ) ));
249 { doSetParmValue(idx, instance, value); }
251 { doSetParmValue(idx, instance, value); }
253 { doSetParmValue(idx, instance, value); }
255 { doSetParmValue(idx, instance, value); }
257 { doSetParmValue(idx, instance, value); }
259 { doSetParmValue(idx, instance, value); }
261 { doSetParmValue(idx, instance, value); }
263 { doSetParmValue(idx, instance, value); }
265 { doSetParmValue(idx, instance, value); }
267 { doSetParmValue(idx, instance, value); }
269 { doSetParmValue(idx, instance, value); }
285 if (fieldnum.
size() < 1)
296 return "deletetargetpointattrib";
300 return "keepunusedpoints";
302 return "createorigattrib";
312 if (fieldnum.
size() < 1)
313 return PARM_UNSUPPORTED;
334 return PARM_UNSUPPORTED;
370 loadData(is, rampdata);
388 int typelen = colon - data.
buffer();
402 {
int64 iv =
v; UTwrite(os, &iv); }
404 { UTwrite<fpreal64>(os, &
v); }
406 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
408 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
409 UTwrite<fpreal64>(os, &v.
z()); }
411 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
412 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
424 if (s) s->save(ostr);
426 saveData(os, result);
433 ostr << s->getDataTypeToken();
438 saveData(os, result);
442 void save(std::ostream &os)
const
446 saveData(os, myGroup);
447 saveData(os, myGrouptype);
448 saveData(os, myAttrib);
449 saveData(os, myDeleteTargetPointAttrib);
450 saveData(os, myRecurse);
451 saveData(os, myKeepunusedpoints);
452 saveData(os, myCreateorigattrib);
453 saveData(os, myOrigattrib);
466 loadData(is, myGroup);
467 loadData(is, myGrouptype);
468 loadData(is, myAttrib);
469 loadData(is, myDeleteTargetPointAttrib);
470 loadData(is, myRecurse);
471 loadData(is, myKeepunusedpoints);
472 loadData(is, myCreateorigattrib);
473 loadData(is, myOrigattrib);
483 if (!thissop)
return getGroup();
485 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
493 if (!thissop)
return getGrouptype();
495 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
503 if (!thissop)
return getAttrib();
505 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
513 if (!thissop)
return getDeleteTargetPointAttrib();
515 OP_Utils::evalOpParm(result, thissop,
"deletetargetpointattrib", cookparms.
getCookTime(), 0);
523 if (!thissop)
return getRecurse();
525 OP_Utils::evalOpParm(result, thissop,
"recurse", cookparms.
getCookTime(), 0);
533 if (!thissop)
return getKeepunusedpoints();
535 OP_Utils::evalOpParm(result, thissop,
"keepunusedpoints", cookparms.
getCookTime(), 0);
543 if (!thissop)
return getCreateorigattrib();
545 OP_Utils::evalOpParm(result, thissop,
"createorigattrib", cookparms.
getCookTime(), 0);
553 if (!thissop)
return getOrigattrib();
555 OP_Utils::evalOpParm(result, thissop,
"origattrib", cookparms.
getCookTime(), 0);
563 bool myDeleteTargetPointAttrib;
565 bool myKeepunusedpoints;
566 bool myCreateorigattrib;
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opOrigattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool opKeepunusedpoints(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
SOP_Node * getNode() const
void setAttrib(const UT_StringHolder &val)
void setKeepunusedpoints(bool val)
bool operator==(const SOP_RewireParms &src) const
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, fpreal64 &v)
bool load(UT_IStream &is)
bool getDeleteTargetPointAttrib() const
void setGrouptype(Grouptype val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
exint getNestNumParms(TempIndex idx) const override
bool opDeleteTargetPointAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
bool opRecurse(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
void copyFrom(const OP_NodeParms *src) override
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
**But if you need a result
bool getCreateorigattrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_Vector4D 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.
bool opCreateorigattrib(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const UT_StringHolder & getAttrib() const
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
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
bool getKeepunusedpoints() const
void setDeleteTargetPointAttrib(bool val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
void setCreateorigattrib(bool val)
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
Grouptype getGrouptype() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setOrigattrib(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
void setRecurse(bool val)
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getOrigattrib() const
fpreal getCookTime() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const char * findChar(int c) const
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, fpreal64 v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool operator!=(const SOP_RewireParms &src) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept