23 namespace SOP_EdgeTransportEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
71 using namespace UT::Literal;
92 using namespace UT::Literal;
112 using namespace UT::Literal;
113 switch (enum_value) {
129 using namespace UT::Literal;
130 switch (enum_value) {
146 using namespace UT::Literal;
147 switch (enum_value) {
164 using namespace UT::Literal;
165 switch (enum_value) {
184 myPointGroup =
""_UTsh;
185 myPrimitiveGroup =
""_UTsh;
186 myAttribute =
"dist"_UTsh;
188 myParentAttribute =
"parent"_UTsh;
190 myRootGroup =
"0"_UTsh;
192 myUseNormalization =
false;
195 myIgnoreAttribute =
true;
196 myScaleByEdge =
true;
197 myRotateByEdge =
false;
212 if (myMethod != src.myMethod)
return false;
213 if (myPointGroup != src.myPointGroup)
return false;
214 if (myPrimitiveGroup != src.myPrimitiveGroup)
return false;
215 if (myAttribute != src.myAttribute)
return false;
216 if (myCurveDir != src.myCurveDir)
return false;
217 if (myParentAttribute != src.myParentAttribute)
return false;
218 if (myRootType != src.myRootType)
return false;
219 if (myRootGroup != src.myRootGroup)
return false;
220 if (myOperation != src.myOperation)
return false;
221 if (myUseNormalization != src.myUseNormalization)
return false;
222 if (myNormalization != src.myNormalization)
return false;
223 if (myRootValue != src.myRootValue)
return false;
224 if (myIgnoreAttribute != src.myIgnoreAttribute)
return false;
225 if (myScaleByEdge != src.myScaleByEdge)
return false;
226 if (myRotateByEdge != src.myRotateByEdge)
return false;
227 if (mySplitMethod != src.mySplitMethod)
return false;
228 if (myMergeMethod != src.myMergeMethod)
return false;
251 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
252 myPointGroup =
""_UTsh;
253 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
254 graph->
evalOpParm(myPointGroup, nodeidx,
"ptgroup", time, 0);
255 myPrimitiveGroup =
""_UTsh;
256 if (
true && ( (
true&&!(((
int64(getMethod())!=0)))) ) )
257 graph->
evalOpParm(myPrimitiveGroup, nodeidx,
"primgroup", time, 0);
258 myAttribute =
"dist"_UTsh;
260 graph->
evalOpParm(myAttribute, nodeidx,
"attribute", time, 0);
263 graph->
evalOpParm(myCurveDir, nodeidx,
"curvedir", time, 0);
264 myParentAttribute =
"parent"_UTsh;
265 if (
true && ( (
true&&!(((
int64(getMethod())!=2)))) ) )
266 graph->
evalOpParm(myParentAttribute, nodeidx,
"parentattribute", time, 0);
268 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
269 graph->
evalOpParm(myRootType, nodeidx,
"roottype", time, 0);
270 myRootGroup =
"0"_UTsh;
271 if (
true && ( (
true&&!(((
int64(getRootType())!=2))||((
int64(getMethod())!=1)))) ) )
272 graph->
evalOpParm(myRootGroup, nodeidx,
"rootgroup", time, 0);
275 graph->
evalOpParm(myOperation, nodeidx,
"operation", time, 0);
276 myUseNormalization =
false;
278 graph->
evalOpParm(myUseNormalization, nodeidx,
"donormalization", time, 0);
280 if (
true && ( (
true&&!(((getUseNormalization()==0)))) ) )
281 graph->
evalOpParm(myNormalization, nodeidx,
"normalization", time, 0);
283 if (
true && ( (
true&&!(((
int64(getOperation())!=0)))) ) )
284 graph->
evalOpParm(myRootValue, nodeidx,
"rootvalue", time, 0);
285 myIgnoreAttribute =
true;
286 if (
true && ( (
true&&!(((
int64(getOperation())!=2)))) ) )
287 graph->
evalOpParm(myIgnoreAttribute, nodeidx,
"ignoreattribute", time, 0);
288 myScaleByEdge =
true;
289 if (
true && ( (
true&&!(((
int64(getOperation())!=2)))) ) )
290 graph->
evalOpParm(myScaleByEdge, nodeidx,
"scalebyedge", time, 0);
291 myRotateByEdge =
false;
292 if (
true && ( (
true&&!(((
int64(getMethod())!=0)&&(
int64(getCurveDir())==1)))) ) )
293 graph->
evalOpParm(myRotateByEdge, nodeidx,
"rotatebyedge", time, 0);
295 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((
int64(getCurveDir())!=0)))) ) )
296 graph->
evalOpParm(mySplitMethod, nodeidx,
"splitmethod", time, 0);
298 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((
int64(getCurveDir())!=1)))) ) )
299 graph->
evalOpParm(myMergeMethod, nodeidx,
"mergemethod", time, 0);
315 template <
typename T>
322 if (idx.
size() != instance.
size()+1)
327 coerceValue(value, myMethod);
330 coerceValue(value, myPointGroup);
333 coerceValue(value, myPrimitiveGroup);
336 coerceValue(value, myAttribute);
339 coerceValue(value, myCurveDir);
342 coerceValue(value, myParentAttribute);
345 coerceValue(value, myRootType);
348 coerceValue(value, myRootGroup);
351 coerceValue(value, myOperation);
354 coerceValue(value, myUseNormalization);
357 coerceValue(value, myNormalization);
360 coerceValue(value, myRootValue);
363 coerceValue(value, myIgnoreAttribute);
366 coerceValue(value, myScaleByEdge);
369 coerceValue(value, myRotateByEdge);
372 coerceValue(value, mySplitMethod);
375 coerceValue(value, myMergeMethod);
391 { doGetParmValue(idx, instance, value); }
393 { doGetParmValue(idx, instance, value); }
395 { doGetParmValue(idx, instance, value); }
397 { doGetParmValue(idx, instance, value); }
399 { doGetParmValue(idx, instance, value); }
401 { doGetParmValue(idx, instance, value); }
403 { doGetParmValue(idx, instance, value); }
405 { doGetParmValue(idx, instance, value); }
407 { doGetParmValue(idx, instance, value); }
409 { doGetParmValue(idx, instance, value); }
411 { doGetParmValue(idx, instance, value); }
413 template <
typename T>
420 if (idx.
size() != instance.
size()+1)
425 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
428 coerceValue(myPointGroup, ( ( value ) ));
431 coerceValue(myPrimitiveGroup, ( ( value ) ));
434 coerceValue(myAttribute, ( ( value ) ));
437 coerceValue(myCurveDir, clampMinValue(0, clampMaxValue(1, value ) ));
440 coerceValue(myParentAttribute, ( ( value ) ));
443 coerceValue(myRootType, clampMinValue(0, clampMaxValue(2, value ) ));
446 coerceValue(myRootGroup, ( ( value ) ));
449 coerceValue(myOperation, clampMinValue(0, clampMaxValue(4, value ) ));
452 coerceValue(myUseNormalization, ( ( value ) ));
455 coerceValue(myNormalization, clampMinValue(0, clampMaxValue(1, value ) ));
458 coerceValue(myRootValue, clampMinValue(0, clampMaxValue(1, value ) ));
461 coerceValue(myIgnoreAttribute, ( ( value ) ));
464 coerceValue(myScaleByEdge, ( ( value ) ));
467 coerceValue(myRotateByEdge, ( ( value ) ));
470 coerceValue(mySplitMethod, clampMinValue(0, clampMaxValue(1, value ) ));
473 coerceValue(myMergeMethod, clampMinValue(0, clampMaxValue(2, value ) ));
480 { doSetParmValue(idx, instance, value); }
482 { doSetParmValue(idx, instance, value); }
484 { doSetParmValue(idx, instance, value); }
486 { doSetParmValue(idx, instance, value); }
488 { doSetParmValue(idx, instance, value); }
490 { doSetParmValue(idx, instance, value); }
492 { doSetParmValue(idx, instance, value); }
494 { doSetParmValue(idx, instance, value); }
496 { doSetParmValue(idx, instance, value); }
498 { doSetParmValue(idx, instance, value); }
500 { doSetParmValue(idx, instance, value); }
516 if (fieldnum.
size() < 1)
531 return "parentattribute";
539 return "donormalization";
541 return "normalization";
545 return "ignoreattribute";
547 return "scalebyedge";
549 return "rotatebyedge";
551 return "splitmethod";
553 return "mergemethod";
561 if (fieldnum.
size() < 1)
562 return PARM_UNSUPPORTED;
601 return PARM_UNSUPPORTED;
637 loadData(is, rampdata);
655 int typelen = colon - data.
buffer();
669 {
int64 iv =
v; UTwrite(os, &iv); }
671 { UTwrite<fpreal64>(os, &
v); }
673 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
675 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
676 UTwrite<fpreal64>(os, &v.
z()); }
678 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
679 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
691 if (s) s->save(ostr);
693 saveData(os, result);
700 ostr << s->getDataTypeToken();
705 saveData(os, result);
709 void save(std::ostream &os)
const
713 saveData(os, myMethod);
714 saveData(os, myPointGroup);
715 saveData(os, myPrimitiveGroup);
716 saveData(os, myAttribute);
717 saveData(os, myCurveDir);
718 saveData(os, myParentAttribute);
719 saveData(os, myRootType);
720 saveData(os, myRootGroup);
721 saveData(os, myOperation);
722 saveData(os, myUseNormalization);
723 saveData(os, myNormalization);
724 saveData(os, myRootValue);
725 saveData(os, myIgnoreAttribute);
726 saveData(os, myScaleByEdge);
727 saveData(os, myRotateByEdge);
728 saveData(os, mySplitMethod);
729 saveData(os, myMergeMethod);
742 loadData(is, myMethod);
743 loadData(is, myPointGroup);
744 loadData(is, myPrimitiveGroup);
745 loadData(is, myAttribute);
746 loadData(is, myCurveDir);
747 loadData(is, myParentAttribute);
748 loadData(is, myRootType);
749 loadData(is, myRootGroup);
750 loadData(is, myOperation);
751 loadData(is, myUseNormalization);
752 loadData(is, myNormalization);
753 loadData(is, myRootValue);
754 loadData(is, myIgnoreAttribute);
755 loadData(is, myScaleByEdge);
756 loadData(is, myRotateByEdge);
757 loadData(is, mySplitMethod);
758 loadData(is, myMergeMethod);
768 if (!thissop)
return getMethod();
770 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
778 if (!thissop)
return getPointGroup();
780 OP_Utils::evalOpParm(result, thissop,
"ptgroup", cookparms.
getCookTime(), 0);
788 if (!thissop)
return getPrimitiveGroup();
790 OP_Utils::evalOpParm(result, thissop,
"primgroup", cookparms.
getCookTime(), 0);
798 if (!thissop)
return getAttribute();
800 OP_Utils::evalOpParm(result, thissop,
"attribute", cookparms.
getCookTime(), 0);
808 if (!thissop)
return getCurveDir();
810 OP_Utils::evalOpParm(result, thissop,
"curvedir", cookparms.
getCookTime(), 0);
818 if (!thissop)
return getParentAttribute();
820 OP_Utils::evalOpParm(result, thissop,
"parentattribute", cookparms.
getCookTime(), 0);
828 if (!thissop)
return getRootType();
830 OP_Utils::evalOpParm(result, thissop,
"roottype", cookparms.
getCookTime(), 0);
838 if (!thissop)
return getRootGroup();
840 OP_Utils::evalOpParm(result, thissop,
"rootgroup", cookparms.
getCookTime(), 0);
848 if (!thissop)
return getOperation();
850 OP_Utils::evalOpParm(result, thissop,
"operation", cookparms.
getCookTime(), 0);
858 if (!thissop)
return getUseNormalization();
860 OP_Utils::evalOpParm(result, thissop,
"donormalization", cookparms.
getCookTime(), 0);
868 if (!thissop)
return getNormalization();
870 OP_Utils::evalOpParm(result, thissop,
"normalization", cookparms.
getCookTime(), 0);
878 if (!thissop)
return getRootValue();
880 OP_Utils::evalOpParm(result, thissop,
"rootvalue", cookparms.
getCookTime(), 0);
888 if (!thissop)
return getIgnoreAttribute();
890 OP_Utils::evalOpParm(result, thissop,
"ignoreattribute", cookparms.
getCookTime(), 0);
898 if (!thissop)
return getScaleByEdge();
900 OP_Utils::evalOpParm(result, thissop,
"scalebyedge", cookparms.
getCookTime(), 0);
908 if (!thissop)
return getRotateByEdge();
910 OP_Utils::evalOpParm(result, thissop,
"rotatebyedge", cookparms.
getCookTime(), 0);
918 if (!thissop)
return getSplitMethod();
920 OP_Utils::evalOpParm(result, thissop,
"splitmethod", cookparms.
getCookTime(), 0);
928 if (!thissop)
return getMergeMethod();
930 OP_Utils::evalOpParm(result, thissop,
"mergemethod", cookparms.
getCookTime(), 0);
944 bool myUseNormalization;
945 int64 myNormalization;
947 bool myIgnoreAttribute;
Normalization getNormalization() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setPointGroup(const UT_StringHolder &val)
RootValue getRootValue() const
SOP_Node * getNode() const
bool isParmColorRamp(exint idx) const override
void setParentAttribute(const UT_StringHolder &val)
Operation getOperation() const
void setScaleByEdge(bool val)
const UT_StringHolder & getPrimitiveGroup() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool opScaleByEdge(const SOP_NodeVerb::CookParms &cookparms) const
Normalization opNormalization(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint bread(int32 *buffer, exint asize=1)
RootType opRootType(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder time
void setRotateByEdge(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setOperation(Operation val)
RootType getRootType() const
bool getRotateByEdge() const
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opRootGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setUseNormalization(bool val)
bool getIgnoreAttribute() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void saveData(std::ostream &os, UT_Vector2D v)
void setRootType(RootType val)
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getAttribute() const
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
CurveDir getCurveDir() const
void setNormalization(Normalization val)
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getPointGroup() const
**But if you need a result
UT_StringHolder opAttribute(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
SplitMethod opSplitMethod(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setCurveDir(CurveDir val)
bool getScaleByEdge() const
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const SOP_EdgeTransportParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool opRotateByEdge(const SOP_NodeVerb::CookParms &cookparms) const
void setMethod(Method val)
bool operator!=(const SOP_EdgeTransportParms &src) 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, fpreal64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, bool v)
const OP_GraphProxy * graph() const
SplitMethod getSplitMethod() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
Operation opOperation(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getRootGroup() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
MergeMethod opMergeMethod(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GT_API const UT_StringHolder version
void setSplitMethod(SplitMethod val)
void setRootValue(RootValue val)
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setRootGroup(const UT_StringHolder &val)
void setPrimitiveGroup(const UT_StringHolder &val)
bool load(UT_IStream &is)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool getUseNormalization() const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
RootValue opRootValue(const SOP_NodeVerb::CookParms &cookparms) const
void setMergeMethod(MergeMethod val)
constexpr SYS_FORCE_INLINE T & w() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const UT_StringHolder & getParentAttribute() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal getCookTime() const
void setAttribute(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const char * findChar(int c) const
ParmType getNestParmType(TempIndex fieldnum) const override
bool opIgnoreAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setIgnoreAttribute(bool val)
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder opPrimitiveGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
CurveDir opCurveDir(const SOP_NodeVerb::CookParms &cookparms) const
MergeMethod getMergeMethod() const
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opPointGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opUseNormalization(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opParentAttribute(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Matrix4D &v)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const