32 myCreaseGroup =
""_UTsh;
34 myOverrideCreaseWeight =
false;
37 myOutputCreaseGroup =
"creases"_UTsh;
41 mySmoothVertex =
true;
42 myEnforceConsistentTopology =
false;
43 myLinearCreases =
false;
45 myBuildPolygonSoup =
false;
46 myTreatCurvesIndependent =
false;
47 myUpdateNormals =
true;
49 myVtxBoundaryInterp =
"corner"_UTsh;
50 myFVarLinearInterp =
"corner1"_UTsh;
51 myCreasingMethod =
"uniform"_UTsh;
52 myTriangleSubd =
"catclark"_UTsh;
65 if (myGroup != src.myGroup)
return false;
66 if (myCreaseGroup != src.myCreaseGroup)
return false;
67 if (myDepth != src.myDepth)
return false;
68 if (myOverrideCreaseWeight != src.myOverrideCreaseWeight)
return false;
69 if (myCreaseWeight != src.myCreaseWeight)
return false;
70 if (myOutputCreases != src.myOutputCreases)
return false;
71 if (myOutputCreaseGroup != src.myOutputCreaseGroup)
return false;
72 if (myCloseCracks != src.myCloseCracks)
return false;
73 if (myDivideChoice != src.myDivideChoice)
return false;
74 if (myBias != src.myBias)
return false;
75 if (mySmoothVertex != src.mySmoothVertex)
return false;
76 if (myEnforceConsistentTopology != src.myEnforceConsistentTopology)
return false;
77 if (myLinearCreases != src.myLinearCreases)
return false;
78 if (myAlgorithm != src.myAlgorithm)
return false;
79 if (myBuildPolygonSoup != src.myBuildPolygonSoup)
return false;
80 if (myTreatCurvesIndependent != src.myTreatCurvesIndependent)
return false;
81 if (myUpdateNormals != src.myUpdateNormals)
return false;
82 if (myRemoveHoles != src.myRemoveHoles)
return false;
83 if (myVtxBoundaryInterp != src.myVtxBoundaryInterp)
return false;
84 if (myFVarLinearInterp != src.myFVarLinearInterp)
return false;
85 if (myCreasingMethod != src.myCreasingMethod)
return false;
86 if (myTriangleSubd != src.myTriangleSubd)
return false;
101 graph->
evalOpParm(myGroup, nodeidx,
"subdivide", time, 0);
102 myCreaseGroup =
""_UTsh;
104 graph->
evalOpParm(myCreaseGroup, nodeidx,
"creases", time, 0);
107 graph->
evalOpParm(myDepth, nodeidx,
"iterations", time, 0);
108 myOverrideCreaseWeight =
false;
110 graph->
evalOpParm(myOverrideCreaseWeight, nodeidx,
"overridecrease", time, 0);
113 graph->
evalOpParm(myCreaseWeight, nodeidx,
"creaseweight", time, 0);
116 graph->
evalOpParm(myOutputCreases, nodeidx,
"outputcrease", time, 0);
117 myOutputCreaseGroup =
"creases"_UTsh;
119 graph->
evalOpParm(myOutputCreaseGroup, nodeidx,
"outcreasegroup", time, 0);
122 graph->
evalOpParm(myCloseCracks, nodeidx,
"closeholes", time, 0);
125 graph->
evalOpParm(myDivideChoice, nodeidx,
"surroundpoly", time, 0);
128 graph->
evalOpParm(myBias, nodeidx,
"bias", time, 0);
129 mySmoothVertex =
true;
131 graph->
evalOpParm(mySmoothVertex, nodeidx,
"smoothvertex", time, 0);
132 myEnforceConsistentTopology =
false;
134 graph->
evalOpParm(myEnforceConsistentTopology, nodeidx,
"consisttopology", time, 0);
135 myLinearCreases =
false;
137 graph->
evalOpParm(myLinearCreases, nodeidx,
"linearcreases", time, 0);
140 graph->
evalOpParm(myAlgorithm, nodeidx,
"algorithm", time, 0);
141 myBuildPolygonSoup =
false;
143 graph->
evalOpParm(myBuildPolygonSoup, nodeidx,
"buildpolysoups", time, 0);
144 myTreatCurvesIndependent =
false;
146 graph->
evalOpParm(myTreatCurvesIndependent, nodeidx,
"indepcurves", time, 0);
147 myUpdateNormals =
true;
149 graph->
evalOpParm(myUpdateNormals, nodeidx,
"updatenmls", time, 0);
150 myRemoveHoles =
true;
152 graph->
evalOpParm(myRemoveHoles, nodeidx,
"removeholes", time, 0);
153 myVtxBoundaryInterp =
"corner"_UTsh;
155 graph->
evalOpParm(myVtxBoundaryInterp, nodeidx,
"vtxboundary", time, 0);
156 myFVarLinearInterp =
"corner1"_UTsh;
158 graph->
evalOpParm(myFVarLinearInterp, nodeidx,
"fvarlinear", time, 0);
159 myCreasingMethod =
"uniform"_UTsh;
161 graph->
evalOpParm(myCreasingMethod, nodeidx,
"creasemethod", time, 0);
162 myTriangleSubd =
"catclark"_UTsh;
164 graph->
evalOpParm(myTriangleSubd, nodeidx,
"trianglesubd", time, 0);
180 template <
typename T>
187 if (idx.
size() != instance.
size()+1)
271 { doGetParmValue(idx, instance, value); }
273 { doGetParmValue(idx, instance, value); }
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 template <
typename T>
300 if (idx.
size() != instance.
size()+1)
314 coerceValue(myOverrideCreaseWeight, ( ( value ) ));
338 coerceValue(myEnforceConsistentTopology, ( ( value ) ));
350 coerceValue(myTreatCurvesIndependent, ( ( value ) ));
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
383 { doSetParmValue(idx, instance, value); }
385 { doSetParmValue(idx, instance, value); }
387 { doSetParmValue(idx, instance, value); }
389 { doSetParmValue(idx, instance, value); }
391 { doSetParmValue(idx, instance, value); }
393 { doSetParmValue(idx, instance, value); }
395 { doSetParmValue(idx, instance, value); }
411 if (fieldnum.
size() < 1)
422 return "overridecrease";
424 return "creaseweight";
426 return "outputcrease";
428 return "outcreasegroup";
432 return "surroundpoly";
436 return "smoothvertex";
438 return "consisttopology";
440 return "linearcreases";
444 return "buildpolysoups";
446 return "indepcurves";
450 return "removeholes";
452 return "vtxboundary";
456 return "creasemethod";
458 return "trianglesubd";
466 if (fieldnum.
size() < 1)
467 return PARM_UNSUPPORTED;
552 loadData(is, rampdata);
570 int typelen = colon - data.
buffer();
584 {
int64 iv =
v; UTwrite(os, &iv); }
586 { UTwrite<fpreal64>(os, &
v); }
588 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
590 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
591 UTwrite<fpreal64>(os, &v.
z()); }
593 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
594 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
606 if (s) s->save(ostr);
608 saveData(os, result);
615 ostr << s->getDataTypeToken();
620 saveData(os, result);
624 void save(std::ostream &os)
const
628 saveData(os, myGroup);
629 saveData(os, myCreaseGroup);
630 saveData(os, myDepth);
631 saveData(os, myOverrideCreaseWeight);
632 saveData(os, myCreaseWeight);
633 saveData(os, myOutputCreases);
634 saveData(os, myOutputCreaseGroup);
635 saveData(os, myCloseCracks);
636 saveData(os, myDivideChoice);
637 saveData(os, myBias);
638 saveData(os, mySmoothVertex);
639 saveData(os, myEnforceConsistentTopology);
640 saveData(os, myLinearCreases);
641 saveData(os, myAlgorithm);
642 saveData(os, myBuildPolygonSoup);
643 saveData(os, myTreatCurvesIndependent);
644 saveData(os, myUpdateNormals);
645 saveData(os, myRemoveHoles);
646 saveData(os, myVtxBoundaryInterp);
647 saveData(os, myFVarLinearInterp);
648 saveData(os, myCreasingMethod);
649 saveData(os, myTriangleSubd);
662 loadData(is, myGroup);
663 loadData(is, myCreaseGroup);
664 loadData(is, myDepth);
665 loadData(is, myOverrideCreaseWeight);
666 loadData(is, myCreaseWeight);
667 loadData(is, myOutputCreases);
668 loadData(is, myOutputCreaseGroup);
669 loadData(is, myCloseCracks);
670 loadData(is, myDivideChoice);
671 loadData(is, myBias);
672 loadData(is, mySmoothVertex);
673 loadData(is, myEnforceConsistentTopology);
674 loadData(is, myLinearCreases);
675 loadData(is, myAlgorithm);
676 loadData(is, myBuildPolygonSoup);
677 loadData(is, myTreatCurvesIndependent);
678 loadData(is, myUpdateNormals);
679 loadData(is, myRemoveHoles);
680 loadData(is, myVtxBoundaryInterp);
681 loadData(is, myFVarLinearInterp);
682 loadData(is, myCreasingMethod);
683 loadData(is, myTriangleSubd);
693 if (!thissop)
return getGroup();
695 OP_Utils::evalOpParm(result, thissop,
"subdivide", cookparms.
getCookTime(), 0);
703 if (!thissop)
return getCreaseGroup();
705 OP_Utils::evalOpParm(result, thissop,
"creases", cookparms.
getCookTime(), 0);
713 if (!thissop)
return getDepth();
715 OP_Utils::evalOpParm(result, thissop,
"iterations", cookparms.
getCookTime(), 0);
723 if (!thissop)
return getOverrideCreaseWeight();
725 OP_Utils::evalOpParm(result, thissop,
"overridecrease", cookparms.
getCookTime(), 0);
733 if (!thissop)
return getCreaseWeight();
735 OP_Utils::evalOpParm(result, thissop,
"creaseweight", cookparms.
getCookTime(), 0);
743 if (!thissop)
return getOutputCreases();
745 OP_Utils::evalOpParm(result, thissop,
"outputcrease", cookparms.
getCookTime(), 0);
753 if (!thissop)
return getOutputCreaseGroup();
755 OP_Utils::evalOpParm(result, thissop,
"outcreasegroup", cookparms.
getCookTime(), 0);
763 if (!thissop)
return getCloseCracks();
765 OP_Utils::evalOpParm(result, thissop,
"closeholes", cookparms.
getCookTime(), 0);
773 if (!thissop)
return getDivideChoice();
775 OP_Utils::evalOpParm(result, thissop,
"surroundpoly", cookparms.
getCookTime(), 0);
783 if (!thissop)
return getBias();
785 OP_Utils::evalOpParm(result, thissop,
"bias", cookparms.
getCookTime(), 0);
793 if (!thissop)
return getSmoothVertex();
795 OP_Utils::evalOpParm(result, thissop,
"smoothvertex", cookparms.
getCookTime(), 0);
803 if (!thissop)
return getEnforceConsistentTopology();
805 OP_Utils::evalOpParm(result, thissop,
"consisttopology", cookparms.
getCookTime(), 0);
813 if (!thissop)
return getLinearCreases();
815 OP_Utils::evalOpParm(result, thissop,
"linearcreases", cookparms.
getCookTime(), 0);
823 if (!thissop)
return getAlgorithm();
825 OP_Utils::evalOpParm(result, thissop,
"algorithm", cookparms.
getCookTime(), 0);
833 if (!thissop)
return getBuildPolygonSoup();
835 OP_Utils::evalOpParm(result, thissop,
"buildpolysoups", cookparms.
getCookTime(), 0);
843 if (!thissop)
return getTreatCurvesIndependent();
845 OP_Utils::evalOpParm(result, thissop,
"indepcurves", cookparms.
getCookTime(), 0);
853 if (!thissop)
return getUpdateNormals();
855 OP_Utils::evalOpParm(result, thissop,
"updatenmls", cookparms.
getCookTime(), 0);
863 if (!thissop)
return getRemoveHoles();
865 OP_Utils::evalOpParm(result, thissop,
"removeholes", cookparms.
getCookTime(), 0);
873 if (!thissop)
return getVtxBoundaryInterp();
875 OP_Utils::evalOpParm(result, thissop,
"vtxboundary", cookparms.
getCookTime(), 0);
883 if (!thissop)
return getFVarLinearInterp();
885 OP_Utils::evalOpParm(result, thissop,
"fvarlinear", cookparms.
getCookTime(), 0);
893 if (!thissop)
return getCreasingMethod();
895 OP_Utils::evalOpParm(result, thissop,
"creasemethod", cookparms.
getCookTime(), 0);
903 if (!thissop)
return getTriangleSubd();
905 OP_Utils::evalOpParm(result, thissop,
"trianglesubd", cookparms.
getCookTime(), 0);
913 bool myOverrideCreaseWeight;
915 bool myOutputCreases;
918 int64 myDivideChoice;
921 bool myEnforceConsistentTopology;
922 bool myLinearCreases;
924 bool myBuildPolygonSoup;
925 bool myTreatCurvesIndependent;
926 bool myUpdateNormals;
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool getTreatCurvesIndependent() const
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setCloseCracks(int64 val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
SOP_Node * getNode() const
int64 opCloseCracks(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getTriangleSubd() const
fpreal64 getCreaseWeight() const
bool getLinearCreases() const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool operator==(const SOP_SubdivideParms &src) const
bool opUpdateNormals(const SOP_NodeVerb::CookParms &cookparms) const
int64 getCloseCracks() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
void setLinearCreases(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getOverrideCreaseWeight() const
static void saveData(std::ostream &os, UT_Vector3D v)
const OP_Context & context() const
bool opBuildPolygonSoup(const SOP_NodeVerb::CookParms &cookparms) const
void setDivideChoice(int64 val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
void save(std::ostream &os) const
An output stream object that owns its own string buffer storage.
**But if you need a result
int64 opDivideChoice(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCreaseGroup(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) 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 setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setCreaseGroup(const UT_StringHolder &val)
UT_StringHolder opTriangleSubd(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setBuildPolygonSoup(bool val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opTreatCurvesIndependent(const SOP_NodeVerb::CookParms &cookparms) const
bool opEnforceConsistentTopology(const SOP_NodeVerb::CookParms &cookparms) const
void setTriangleSubd(const UT_StringHolder &val)
bool opOverrideCreaseWeight(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, int64 &v)
void setOutputCreases(bool val)
void setSmoothVertex(bool val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool isParmColorRamp(exint idx) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void saveData(std::ostream &os, UT_Matrix4D v)
const UT_StringHolder & getCreasingMethod() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool getOutputCreases() const
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder opCreasingMethod(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
void setFVarLinearInterp(const UT_StringHolder &val)
bool opSmoothVertex(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getOutputCreaseGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setTreatCurvesIndependent(bool val)
const UT_StringHolder & getFVarLinearInterp() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setEnforceConsistentTopology(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setUpdateNormals(bool val)
bool opLinearCreases(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setOutputCreaseGroup(const UT_StringHolder &val)
void setOverrideCreaseWeight(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setVtxBoundaryInterp(const UT_StringHolder &val)
bool getSmoothVertex() const
exint getNestNumParms(TempIndex idx) const override
bool getBuildPolygonSoup() const
void loadFromOpSubclass(const LoadParms &loadparms) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, UT_Matrix3D v)
void setBias(fpreal64 val)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, int64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
int64 opDepth(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opCreaseWeight(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_StringHolder & getCreaseGroup() const
static void saveData(std::ostream &os, UT_Matrix2D v)
void coerceValue(T &result, const S &src) const
static void saveData(std::ostream &os, UT_StringHolder s)
int64 opAlgorithm(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
bool getUpdateNormals() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
void setCreasingMethod(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
bool opOutputCreases(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool load(UT_IStream &is)
fpreal getCookTime() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool getEnforceConsistentTopology() const
void setCreaseWeight(fpreal64 val)
static void loadData(UT_IStream &is, bool &v)
const char * findChar(int c) const
const UT_StringHolder & getVtxBoundaryInterp() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_StringHolder opVtxBoundaryInterp(const SOP_NodeVerb::CookParms &cookparms) const
bool getRemoveHoles() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opOutputCreaseGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
int64 getAlgorithm() const
void setAlgorithm(int64 val)
bool opRemoveHoles(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setRemoveHoles(bool val)
int64 getDivideChoice() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
bool operator!=(const SOP_SubdivideParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_StringHolder opFVarLinearInterp(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
fpreal64 opBias(const SOP_NodeVerb::CookParms &cookparms) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
void setGroup(const UT_StringHolder &val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & x() noexcept