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;
104 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
107 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, graph->
isDirect()?
nullptr:depnode);
108 myAttrib =
"rewire_to"_UTsh;
110 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, graph->
isDirect()?
nullptr:depnode);
111 myDeleteTargetPointAttrib =
false;
113 graph->
evalOpParm(myDeleteTargetPointAttrib, nodeidx,
"deletetargetpointattrib", time, graph->
isDirect()?
nullptr:depnode);
116 graph->
evalOpParm(myRecurse, nodeidx,
"recurse", time, graph->
isDirect()?
nullptr:depnode);
117 myKeepunusedpoints =
false;
119 graph->
evalOpParm(myKeepunusedpoints, nodeidx,
"keepunusedpoints", time, graph->
isDirect()?
nullptr:depnode);
120 myCreateorigattrib =
false;
122 graph->
evalOpParm(myCreateorigattrib, nodeidx,
"createorigattrib", time, graph->
isDirect()?
nullptr:depnode);
123 myOrigattrib =
"rewired_from"_UTsh;
124 if (
true && ( (
true&&!(((getCreateorigattrib()==0)))) ) )
125 graph->
evalOpParm(myOrigattrib, nodeidx,
"origattrib", time, graph->
isDirect()?
nullptr:depnode);
141 template <
typename T>
148 if (idx.
size() != instance.
size()+1)
153 coerceValue(value, myGroup);
156 coerceValue(value, myGrouptype);
159 coerceValue(value, myAttrib);
162 coerceValue(value, myDeleteTargetPointAttrib);
165 coerceValue(value, myRecurse);
168 coerceValue(value, myKeepunusedpoints);
171 coerceValue(value, myCreateorigattrib);
174 coerceValue(value, myOrigattrib);
190 { doGetParmValue(idx, instance, value); }
192 { doGetParmValue(idx, instance, value); }
194 { doGetParmValue(idx, instance, value); }
196 { doGetParmValue(idx, instance, value); }
198 { doGetParmValue(idx, instance, value); }
200 { doGetParmValue(idx, instance, value); }
202 { doGetParmValue(idx, instance, value); }
204 { doGetParmValue(idx, instance, value); }
206 { doGetParmValue(idx, instance, value); }
208 { doGetParmValue(idx, instance, value); }
210 { doGetParmValue(idx, instance, value); }
212 template <
typename T>
219 if (idx.
size() != instance.
size()+1)
224 coerceValue(myGroup, ( ( value ) ));
227 coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
230 coerceValue(myAttrib, ( ( value ) ));
233 coerceValue(myDeleteTargetPointAttrib, ( ( value ) ));
236 coerceValue(myRecurse, ( ( value ) ));
239 coerceValue(myKeepunusedpoints, ( ( value ) ));
242 coerceValue(myCreateorigattrib, ( ( value ) ));
245 coerceValue(myOrigattrib, ( ( value ) ));
252 { doSetParmValue(idx, instance, value); }
254 { doSetParmValue(idx, instance, value); }
256 { doSetParmValue(idx, instance, value); }
258 { doSetParmValue(idx, instance, value); }
260 { doSetParmValue(idx, instance, value); }
262 { doSetParmValue(idx, instance, value); }
264 { doSetParmValue(idx, instance, value); }
266 { doSetParmValue(idx, instance, value); }
268 { doSetParmValue(idx, instance, value); }
270 { doSetParmValue(idx, instance, value); }
272 { doSetParmValue(idx, instance, value); }
288 if (fieldnum.
size() < 1)
299 return "deletetargetpointattrib";
303 return "keepunusedpoints";
305 return "createorigattrib";
315 if (fieldnum.
size() < 1)
316 return PARM_UNSUPPORTED;
337 return PARM_UNSUPPORTED;
373 loadData(is, rampdata);
391 int typelen = colon - data.
buffer();
405 {
int64 iv =
v; UTwrite(os, &iv); }
407 { UTwrite<fpreal64>(os, &
v); }
409 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
411 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
412 UTwrite<fpreal64>(os, &v.
z()); }
414 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
415 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
427 if (s) s->save(ostr);
429 saveData(os, result);
436 ostr << s->getDataTypeToken();
441 saveData(os, result);
445 void save(std::ostream &os)
const
449 saveData(os, myGroup);
450 saveData(os, myGrouptype);
451 saveData(os, myAttrib);
452 saveData(os, myDeleteTargetPointAttrib);
453 saveData(os, myRecurse);
454 saveData(os, myKeepunusedpoints);
455 saveData(os, myCreateorigattrib);
456 saveData(os, myOrigattrib);
469 loadData(is, myGroup);
470 loadData(is, myGrouptype);
471 loadData(is, myAttrib);
472 loadData(is, myDeleteTargetPointAttrib);
473 loadData(is, myRecurse);
474 loadData(is, myKeepunusedpoints);
475 loadData(is, myCreateorigattrib);
476 loadData(is, myOrigattrib);
486 if (!thissop)
return getGroup();
488 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
496 if (!thissop)
return getGrouptype();
498 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
506 if (!thissop)
return getAttrib();
508 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
516 if (!thissop)
return getDeleteTargetPointAttrib();
518 OP_Utils::evalOpParm(result, thissop,
"deletetargetpointattrib", cookparms.
getCookTime(), 0);
526 if (!thissop)
return getRecurse();
528 OP_Utils::evalOpParm(result, thissop,
"recurse", cookparms.
getCookTime(), 0);
536 if (!thissop)
return getKeepunusedpoints();
538 OP_Utils::evalOpParm(result, thissop,
"keepunusedpoints", cookparms.
getCookTime(), 0);
546 if (!thissop)
return getCreateorigattrib();
548 OP_Utils::evalOpParm(result, thissop,
"createorigattrib", cookparms.
getCookTime(), 0);
556 if (!thissop)
return getOrigattrib();
558 OP_Utils::evalOpParm(result, thissop,
"origattrib", cookparms.
getCookTime(), 0);
566 bool myDeleteTargetPointAttrib;
568 bool myKeepunusedpoints;
569 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
bool operator!=(const SOP_RewireParms &src) const
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