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;
254 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
255 myPointGroup =
""_UTsh;
256 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
257 graph->
evalOpParm(myPointGroup, nodeidx,
"ptgroup", time, graph->
isDirect()?
nullptr:depnode);
258 myPrimitiveGroup =
""_UTsh;
259 if (
true && ( (
true&&!(((
int64(getMethod())!=0)))) ) )
260 graph->
evalOpParm(myPrimitiveGroup, nodeidx,
"primgroup", time, graph->
isDirect()?
nullptr:depnode);
261 myAttribute =
"dist"_UTsh;
263 graph->
evalOpParm(myAttribute, nodeidx,
"attribute", time, graph->
isDirect()?
nullptr:depnode);
266 graph->
evalOpParm(myCurveDir, nodeidx,
"curvedir", time, graph->
isDirect()?
nullptr:depnode);
267 myParentAttribute =
"parent"_UTsh;
268 if (
true && ( (
true&&!(((
int64(getMethod())!=2)))) ) )
269 graph->
evalOpParm(myParentAttribute, nodeidx,
"parentattribute", time, graph->
isDirect()?
nullptr:depnode);
271 if (
true && ( (
true&&!(((
int64(getMethod())!=1)))) ) )
272 graph->
evalOpParm(myRootType, nodeidx,
"roottype", time, graph->
isDirect()?
nullptr:depnode);
273 myRootGroup =
"0"_UTsh;
274 if (
true && ( (
true&&!(((
int64(getRootType())!=2))||((
int64(getMethod())!=1)))) ) )
275 graph->
evalOpParm(myRootGroup, nodeidx,
"rootgroup", time, graph->
isDirect()?
nullptr:depnode);
278 graph->
evalOpParm(myOperation, nodeidx,
"operation", time, graph->
isDirect()?
nullptr:depnode);
279 myUseNormalization =
false;
281 graph->
evalOpParm(myUseNormalization, nodeidx,
"donormalization", time, graph->
isDirect()?
nullptr:depnode);
283 if (
true && ( (
true&&!(((getUseNormalization()==0)))) ) )
284 graph->
evalOpParm(myNormalization, nodeidx,
"normalization", time, graph->
isDirect()?
nullptr:depnode);
286 if (
true && ( (
true&&!(((
int64(getOperation())!=0)))) ) )
287 graph->
evalOpParm(myRootValue, nodeidx,
"rootvalue", time, graph->
isDirect()?
nullptr:depnode);
288 myIgnoreAttribute =
true;
289 if (
true && ( (
true&&!(((
int64(getOperation())!=2)))) ) )
290 graph->
evalOpParm(myIgnoreAttribute, nodeidx,
"ignoreattribute", time, graph->
isDirect()?
nullptr:depnode);
291 myScaleByEdge =
true;
292 if (
true && ( (
true&&!(((
int64(getOperation())!=2)))) ) )
293 graph->
evalOpParm(myScaleByEdge, nodeidx,
"scalebyedge", time, graph->
isDirect()?
nullptr:depnode);
294 myRotateByEdge =
false;
295 if (
true && ( (
true&&!(((
int64(getMethod())!=0)&&(
int64(getCurveDir())==1)))) ) )
296 graph->
evalOpParm(myRotateByEdge, nodeidx,
"rotatebyedge", time, graph->
isDirect()?
nullptr:depnode);
298 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((
int64(getCurveDir())!=0)))) ) )
299 graph->
evalOpParm(mySplitMethod, nodeidx,
"splitmethod", time, graph->
isDirect()?
nullptr:depnode);
301 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((
int64(getCurveDir())!=1)))) ) )
302 graph->
evalOpParm(myMergeMethod, nodeidx,
"mergemethod", time, graph->
isDirect()?
nullptr:depnode);
318 template <
typename T>
325 if (idx.
size() != instance.
size()+1)
330 coerceValue(value, myMethod);
333 coerceValue(value, myPointGroup);
336 coerceValue(value, myPrimitiveGroup);
339 coerceValue(value, myAttribute);
342 coerceValue(value, myCurveDir);
345 coerceValue(value, myParentAttribute);
348 coerceValue(value, myRootType);
351 coerceValue(value, myRootGroup);
354 coerceValue(value, myOperation);
357 coerceValue(value, myUseNormalization);
360 coerceValue(value, myNormalization);
363 coerceValue(value, myRootValue);
366 coerceValue(value, myIgnoreAttribute);
369 coerceValue(value, myScaleByEdge);
372 coerceValue(value, myRotateByEdge);
375 coerceValue(value, mySplitMethod);
378 coerceValue(value, myMergeMethod);
394 { doGetParmValue(idx, instance, value); }
396 { doGetParmValue(idx, instance, value); }
398 { doGetParmValue(idx, instance, value); }
400 { doGetParmValue(idx, instance, value); }
402 { doGetParmValue(idx, instance, value); }
404 { doGetParmValue(idx, instance, value); }
406 { doGetParmValue(idx, instance, value); }
408 { doGetParmValue(idx, instance, value); }
410 { doGetParmValue(idx, instance, value); }
412 { doGetParmValue(idx, instance, value); }
414 { doGetParmValue(idx, instance, value); }
416 template <
typename T>
423 if (idx.
size() != instance.
size()+1)
428 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
431 coerceValue(myPointGroup, ( ( value ) ));
434 coerceValue(myPrimitiveGroup, ( ( value ) ));
437 coerceValue(myAttribute, ( ( value ) ));
440 coerceValue(myCurveDir, clampMinValue(0, clampMaxValue(1, value ) ));
443 coerceValue(myParentAttribute, ( ( value ) ));
446 coerceValue(myRootType, clampMinValue(0, clampMaxValue(2, value ) ));
449 coerceValue(myRootGroup, ( ( value ) ));
452 coerceValue(myOperation, clampMinValue(0, clampMaxValue(4, value ) ));
455 coerceValue(myUseNormalization, ( ( value ) ));
458 coerceValue(myNormalization, clampMinValue(0, clampMaxValue(1, value ) ));
461 coerceValue(myRootValue, clampMinValue(0, clampMaxValue(1, value ) ));
464 coerceValue(myIgnoreAttribute, ( ( value ) ));
467 coerceValue(myScaleByEdge, ( ( value ) ));
470 coerceValue(myRotateByEdge, ( ( value ) ));
473 coerceValue(mySplitMethod, clampMinValue(0, clampMaxValue(1, value ) ));
476 coerceValue(myMergeMethod, clampMinValue(0, clampMaxValue(2, value ) ));
483 { doSetParmValue(idx, instance, value); }
485 { doSetParmValue(idx, instance, value); }
487 { doSetParmValue(idx, instance, value); }
489 { doSetParmValue(idx, instance, value); }
491 { doSetParmValue(idx, instance, value); }
493 { doSetParmValue(idx, instance, value); }
495 { doSetParmValue(idx, instance, value); }
497 { doSetParmValue(idx, instance, value); }
499 { doSetParmValue(idx, instance, value); }
501 { doSetParmValue(idx, instance, value); }
503 { doSetParmValue(idx, instance, value); }
519 if (fieldnum.
size() < 1)
534 return "parentattribute";
542 return "donormalization";
544 return "normalization";
548 return "ignoreattribute";
550 return "scalebyedge";
552 return "rotatebyedge";
554 return "splitmethod";
556 return "mergemethod";
564 if (fieldnum.
size() < 1)
565 return PARM_UNSUPPORTED;
604 return PARM_UNSUPPORTED;
640 loadData(is, rampdata);
658 int typelen = colon - data.
buffer();
672 {
int64 iv =
v; UTwrite(os, &iv); }
674 { UTwrite<fpreal64>(os, &
v); }
676 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
678 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
679 UTwrite<fpreal64>(os, &v.
z()); }
681 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
682 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
694 if (s) s->save(ostr);
696 saveData(os, result);
703 ostr << s->getDataTypeToken();
708 saveData(os, result);
712 void save(std::ostream &os)
const
716 saveData(os, myMethod);
717 saveData(os, myPointGroup);
718 saveData(os, myPrimitiveGroup);
719 saveData(os, myAttribute);
720 saveData(os, myCurveDir);
721 saveData(os, myParentAttribute);
722 saveData(os, myRootType);
723 saveData(os, myRootGroup);
724 saveData(os, myOperation);
725 saveData(os, myUseNormalization);
726 saveData(os, myNormalization);
727 saveData(os, myRootValue);
728 saveData(os, myIgnoreAttribute);
729 saveData(os, myScaleByEdge);
730 saveData(os, myRotateByEdge);
731 saveData(os, mySplitMethod);
732 saveData(os, myMergeMethod);
745 loadData(is, myMethod);
746 loadData(is, myPointGroup);
747 loadData(is, myPrimitiveGroup);
748 loadData(is, myAttribute);
749 loadData(is, myCurveDir);
750 loadData(is, myParentAttribute);
751 loadData(is, myRootType);
752 loadData(is, myRootGroup);
753 loadData(is, myOperation);
754 loadData(is, myUseNormalization);
755 loadData(is, myNormalization);
756 loadData(is, myRootValue);
757 loadData(is, myIgnoreAttribute);
758 loadData(is, myScaleByEdge);
759 loadData(is, myRotateByEdge);
760 loadData(is, mySplitMethod);
761 loadData(is, myMergeMethod);
771 if (!thissop)
return getMethod();
773 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getPointGroup();
783 OP_Utils::evalOpParm(result, thissop,
"ptgroup", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getPrimitiveGroup();
793 OP_Utils::evalOpParm(result, thissop,
"primgroup", cookparms.
getCookTime(), 0);
801 if (!thissop)
return getAttribute();
803 OP_Utils::evalOpParm(result, thissop,
"attribute", cookparms.
getCookTime(), 0);
811 if (!thissop)
return getCurveDir();
813 OP_Utils::evalOpParm(result, thissop,
"curvedir", cookparms.
getCookTime(), 0);
821 if (!thissop)
return getParentAttribute();
823 OP_Utils::evalOpParm(result, thissop,
"parentattribute", cookparms.
getCookTime(), 0);
831 if (!thissop)
return getRootType();
833 OP_Utils::evalOpParm(result, thissop,
"roottype", cookparms.
getCookTime(), 0);
841 if (!thissop)
return getRootGroup();
843 OP_Utils::evalOpParm(result, thissop,
"rootgroup", cookparms.
getCookTime(), 0);
851 if (!thissop)
return getOperation();
853 OP_Utils::evalOpParm(result, thissop,
"operation", cookparms.
getCookTime(), 0);
861 if (!thissop)
return getUseNormalization();
863 OP_Utils::evalOpParm(result, thissop,
"donormalization", cookparms.
getCookTime(), 0);
871 if (!thissop)
return getNormalization();
873 OP_Utils::evalOpParm(result, thissop,
"normalization", cookparms.
getCookTime(), 0);
881 if (!thissop)
return getRootValue();
883 OP_Utils::evalOpParm(result, thissop,
"rootvalue", cookparms.
getCookTime(), 0);
891 if (!thissop)
return getIgnoreAttribute();
893 OP_Utils::evalOpParm(result, thissop,
"ignoreattribute", cookparms.
getCookTime(), 0);
901 if (!thissop)
return getScaleByEdge();
903 OP_Utils::evalOpParm(result, thissop,
"scalebyedge", cookparms.
getCookTime(), 0);
911 if (!thissop)
return getRotateByEdge();
913 OP_Utils::evalOpParm(result, thissop,
"rotatebyedge", cookparms.
getCookTime(), 0);
921 if (!thissop)
return getSplitMethod();
923 OP_Utils::evalOpParm(result, thissop,
"splitmethod", cookparms.
getCookTime(), 0);
931 if (!thissop)
return getMergeMethod();
933 OP_Utils::evalOpParm(result, thissop,
"mergemethod", cookparms.
getCookTime(), 0);
947 bool myUseNormalization;
948 int64 myNormalization;
950 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
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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