23 namespace SOP_RewireEnums
45 myAttrib =
"rewire_to"_UTsh;
46 myDeleteTargetPointAttrib =
false;
48 myKeepunusedpoints =
false;
49 myCreateorigattrib =
false;
50 myOrigattrib =
"rewired_from"_UTsh;
63 if (myGroup != src.myGroup)
return false;
64 if (myGrouptype != src.myGrouptype)
return false;
65 if (myAttrib != src.myAttrib)
return false;
66 if (myDeleteTargetPointAttrib != src.myDeleteTargetPointAttrib)
return false;
67 if (myRecurse != src.myRecurse)
return false;
68 if (myKeepunusedpoints != src.myKeepunusedpoints)
return false;
69 if (myCreateorigattrib != src.myCreateorigattrib)
return false;
70 if (myOrigattrib != src.myOrigattrib)
return false;
86 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
89 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, 0);
90 myAttrib =
"rewire_to"_UTsh;
92 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
93 myDeleteTargetPointAttrib =
false;
95 graph->
evalOpParm(myDeleteTargetPointAttrib, nodeidx,
"deletetargetpointattrib", time, 0);
98 graph->
evalOpParm(myRecurse, nodeidx,
"recurse", time, 0);
99 myKeepunusedpoints =
false;
101 graph->
evalOpParm(myKeepunusedpoints, nodeidx,
"keepunusedpoints", time, 0);
102 myCreateorigattrib =
false;
104 graph->
evalOpParm(myCreateorigattrib, nodeidx,
"createorigattrib", time, 0);
105 myOrigattrib =
"rewired_from"_UTsh;
106 if (
true && ( (
true&&!(((getCreateorigattrib()==0)))) ) )
107 graph->
evalOpParm(myOrigattrib, nodeidx,
"origattrib", time, 0);
123 template <
typename T>
130 if (idx.
size() != instance.
size()+1)
172 { doGetParmValue(idx, instance, value); }
174 { doGetParmValue(idx, instance, value); }
176 { doGetParmValue(idx, instance, value); }
178 { doGetParmValue(idx, instance, value); }
180 { doGetParmValue(idx, instance, value); }
182 { doGetParmValue(idx, instance, value); }
184 { doGetParmValue(idx, instance, value); }
186 { doGetParmValue(idx, instance, value); }
188 { doGetParmValue(idx, instance, value); }
190 { doGetParmValue(idx, instance, value); }
192 { doGetParmValue(idx, instance, value); }
194 template <
typename T>
201 if (idx.
size() != instance.
size()+1)
215 coerceValue(myDeleteTargetPointAttrib, ( ( value ) ));
234 { doSetParmValue(idx, instance, value); }
236 { doSetParmValue(idx, instance, value); }
238 { doSetParmValue(idx, instance, value); }
240 { doSetParmValue(idx, instance, value); }
242 { doSetParmValue(idx, instance, value); }
244 { doSetParmValue(idx, instance, value); }
246 { doSetParmValue(idx, instance, value); }
248 { doSetParmValue(idx, instance, value); }
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, value); }
254 { doSetParmValue(idx, instance, value); }
270 if (fieldnum.
size() < 1)
281 return "deletetargetpointattrib";
285 return "keepunusedpoints";
287 return "createorigattrib";
297 if (fieldnum.
size() < 1)
298 return PARM_UNSUPPORTED;
338 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
340 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
342 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
355 loadData(is, rampdata);
373 int typelen = colon - data.
buffer();
387 {
int64 iv =
v; UTwrite(os, &iv); }
389 { UTwrite<fpreal64>(os, &
v); }
391 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
393 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
394 UTwrite<fpreal64>(os, &v.
z()); }
396 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
397 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
409 if (s) s->save(ostr);
411 saveData(os, result);
418 ostr << s->getDataTypeToken();
423 saveData(os, result);
427 void save(std::ostream &os)
const
431 saveData(os, myGroup);
432 saveData(os, myGrouptype);
433 saveData(os, myAttrib);
434 saveData(os, myDeleteTargetPointAttrib);
435 saveData(os, myRecurse);
436 saveData(os, myKeepunusedpoints);
437 saveData(os, myCreateorigattrib);
438 saveData(os, myOrigattrib);
451 loadData(is, myGroup);
452 loadData(is, myGrouptype);
453 loadData(is, myAttrib);
454 loadData(is, myDeleteTargetPointAttrib);
455 loadData(is, myRecurse);
456 loadData(is, myKeepunusedpoints);
457 loadData(is, myCreateorigattrib);
458 loadData(is, myOrigattrib);
468 if (!thissop)
return getGroup();
470 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
478 if (!thissop)
return getGrouptype();
480 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
488 if (!thissop)
return getAttrib();
490 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
498 if (!thissop)
return getDeleteTargetPointAttrib();
500 OP_Utils::evalOpParm(result, thissop,
"deletetargetpointattrib", cookparms.
getCookTime(), 0);
508 if (!thissop)
return getRecurse();
510 OP_Utils::evalOpParm(result, thissop,
"recurse", cookparms.
getCookTime(), 0);
518 if (!thissop)
return getKeepunusedpoints();
520 OP_Utils::evalOpParm(result, thissop,
"keepunusedpoints", cookparms.
getCookTime(), 0);
528 if (!thissop)
return getCreateorigattrib();
530 OP_Utils::evalOpParm(result, thissop,
"createorigattrib", cookparms.
getCookTime(), 0);
538 if (!thissop)
return getOrigattrib();
540 OP_Utils::evalOpParm(result, thissop,
"origattrib", cookparms.
getCookTime(), 0);
548 bool myDeleteTargetPointAttrib;
550 bool myKeepunusedpoints;
551 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
T clampMaxValue(fpreal maxvalue, const T &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
T clampMinValue(fpreal minvalue, const T &src) const
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
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)
void coerceValue(T &result, const S &src) const
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
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)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept