23 namespace SOP_UnsubdivideEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
70 myUsepieceattrib =
false;
71 myPieceattrib =
"name"_UTsh;
76 myAllowpartialunsub =
true;
79 myPreferuniform =
false;
81 myUseconnectivityattribute =
false;
82 myConnectivityattribute =
"uv"_UTsh;
83 myConnectivitytol = 1e-6;
84 myUseoutputdepthattribute =
false;
85 myOutputdepthattribute =
"depth"_UTsh;
98 if (myGroup != src.myGroup)
return false;
99 if (myUsepieceattrib != src.myUsepieceattrib)
return false;
100 if (myPieceattrib != src.myPieceattrib)
return false;
101 if (myAlgorithm != src.myAlgorithm)
return false;
102 if (myUseiter != src.myUseiter)
return false;
103 if (myIterations != src.myIterations)
return false;
104 if (myTol != src.myTol)
return false;
105 if (myAllowpartialunsub != src.myAllowpartialunsub)
return false;
106 if (myRepairmesh != src.myRepairmesh)
return false;
107 if (myStrategy != src.myStrategy)
return false;
108 if (myPreferuniform != src.myPreferuniform)
return false;
109 if (mySeed != src.mySeed)
return false;
110 if (myUseconnectivityattribute != src.myUseconnectivityattribute)
return false;
111 if (myConnectivityattribute != src.myConnectivityattribute)
return false;
112 if (myConnectivitytol != src.myConnectivitytol)
return false;
113 if (myUseoutputdepthattribute != src.myUseoutputdepthattribute)
return false;
114 if (myOutputdepthattribute != src.myOutputdepthattribute)
return false;
134 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
135 myUsepieceattrib =
false;
137 graph->
evalOpParm(myUsepieceattrib, nodeidx,
"usepieceattrib", time, graph->
isDirect()?
nullptr:depnode);
138 myPieceattrib =
"name"_UTsh;
139 if (
true && ( (
true&&!(((getUsepieceattrib()==0)))) ) )
140 graph->
evalOpParm(myPieceattrib, nodeidx,
"pieceattrib", time, graph->
isDirect()?
nullptr:depnode);
143 graph->
evalOpParm(myAlgorithm, nodeidx,
"algorithm", time, graph->
isDirect()?
nullptr:depnode);
146 graph->
evalOpParm(myUseiter, nodeidx,
"useiter", time, graph->
isDirect()?
nullptr:depnode);
148 if (
true && ( (
true&&!(((getUseiter()==0)))) ) )
149 graph->
evalOpParm(myIterations, nodeidx,
"iterations", time, graph->
isDirect()?
nullptr:depnode);
153 myAllowpartialunsub =
true;
155 graph->
evalOpParm(myAllowpartialunsub, nodeidx,
"allowpartialunsub", time, graph->
isDirect()?
nullptr:depnode);
157 if (
true && ( (
true&&!(((getAllowpartialunsub()==0)))) ) )
158 graph->
evalOpParm(myRepairmesh, nodeidx,
"repairmesh", time, graph->
isDirect()?
nullptr:depnode);
161 graph->
evalOpParm(myStrategy, nodeidx,
"strategy", time, graph->
isDirect()?
nullptr:depnode);
162 myPreferuniform =
false;
163 if (
true && ( (
true&&!(((
int64(getStrategy())!=0)))) ) )
164 graph->
evalOpParm(myPreferuniform, nodeidx,
"preferuniform", time, graph->
isDirect()?
nullptr:depnode);
166 if (
true && ( (
true&&!(((
int64(getStrategy())!=1)))) ) )
168 myUseconnectivityattribute =
false;
170 graph->
evalOpParm(myUseconnectivityattribute, nodeidx,
"useconnectivityattribute", time, graph->
isDirect()?
nullptr:depnode);
171 myConnectivityattribute =
"uv"_UTsh;
172 if (
true && ( (
true&&!(((getUseconnectivityattribute()==0)))) ) )
173 graph->
evalOpParm(myConnectivityattribute, nodeidx,
"connectivityattribute", time, graph->
isDirect()?
nullptr:depnode);
174 myConnectivitytol = 1e-6;
175 if (
true && ( (
true&&!(((getUseconnectivityattribute()==0)))) ) )
176 graph->
evalOpParm(myConnectivitytol, nodeidx,
"connectivitytol", time, graph->
isDirect()?
nullptr:depnode);
177 myUseoutputdepthattribute =
false;
179 graph->
evalOpParm(myUseoutputdepthattribute, nodeidx,
"useoutputdepthattribute", time, graph->
isDirect()?
nullptr:depnode);
180 myOutputdepthattribute =
"depth"_UTsh;
181 if (
true && ( (
true&&!(((getUseoutputdepthattribute()==0)))) ) )
182 graph->
evalOpParm(myOutputdepthattribute, nodeidx,
"outputdepthattribute", time, graph->
isDirect()?
nullptr:depnode);
198 template <
typename T>
205 if (idx.
size() != instance.
size()+1)
210 coerceValue(value, myGroup);
213 coerceValue(value, myUsepieceattrib);
216 coerceValue(value, myPieceattrib);
219 coerceValue(value, myAlgorithm);
222 coerceValue(value, myUseiter);
225 coerceValue(value, myIterations);
228 coerceValue(value, myTol);
231 coerceValue(value, myAllowpartialunsub);
234 coerceValue(value, myRepairmesh);
237 coerceValue(value, myStrategy);
240 coerceValue(value, myPreferuniform);
243 coerceValue(value, mySeed);
246 coerceValue(value, myUseconnectivityattribute);
249 coerceValue(value, myConnectivityattribute);
252 coerceValue(value, myConnectivitytol);
255 coerceValue(value, myUseoutputdepthattribute);
258 coerceValue(value, myOutputdepthattribute);
274 { doGetParmValue(idx, instance, value); }
276 { doGetParmValue(idx, instance, value); }
278 { doGetParmValue(idx, instance, value); }
280 { doGetParmValue(idx, instance, value); }
282 { doGetParmValue(idx, instance, value); }
284 { doGetParmValue(idx, instance, value); }
286 { doGetParmValue(idx, instance, value); }
288 { doGetParmValue(idx, instance, value); }
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 template <
typename T>
303 if (idx.
size() != instance.
size()+1)
308 coerceValue(myGroup, ( ( value ) ));
311 coerceValue(myUsepieceattrib, ( ( value ) ));
314 coerceValue(myPieceattrib, ( ( value ) ));
317 coerceValue(myAlgorithm, clampMinValue(0, clampMaxValue(1, value ) ));
320 coerceValue(myUseiter, ( ( value ) ));
323 coerceValue(myIterations, ( ( value ) ));
326 coerceValue(myTol, clampMinValue(0, ( value ) ));
329 coerceValue(myAllowpartialunsub, ( ( value ) ));
332 coerceValue(myRepairmesh, ( ( value ) ));
335 coerceValue(myStrategy, clampMinValue(0, clampMaxValue(1, value ) ));
338 coerceValue(myPreferuniform, ( ( value ) ));
341 coerceValue(mySeed, clampMinValue(0, clampMaxValue(3, value ) ));
344 coerceValue(myUseconnectivityattribute, ( ( value ) ));
347 coerceValue(myConnectivityattribute, ( ( value ) ));
350 coerceValue(myConnectivitytol, ( ( value ) ));
353 coerceValue(myUseoutputdepthattribute, ( ( value ) ));
356 coerceValue(myOutputdepthattribute, ( ( value ) ));
363 { doSetParmValue(idx, instance, value); }
365 { doSetParmValue(idx, instance, value); }
367 { doSetParmValue(idx, instance, value); }
369 { doSetParmValue(idx, instance, value); }
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, 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); }
399 if (fieldnum.
size() < 1)
406 return "usepieceattrib";
408 return "pieceattrib";
418 return "allowpartialunsub";
424 return "preferuniform";
428 return "useconnectivityattribute";
430 return "connectivityattribute";
432 return "connectivitytol";
434 return "useoutputdepthattribute";
436 return "outputdepthattribute";
444 if (fieldnum.
size() < 1)
445 return PARM_UNSUPPORTED;
484 return PARM_UNSUPPORTED;
520 loadData(is, rampdata);
538 int typelen = colon - data.
buffer();
552 {
int64 iv =
v; UTwrite(os, &iv); }
554 { UTwrite<fpreal64>(os, &
v); }
556 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
558 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
559 UTwrite<fpreal64>(os, &v.
z()); }
561 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
562 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
574 if (s) s->save(ostr);
576 saveData(os, result);
583 ostr << s->getDataTypeToken();
588 saveData(os, result);
592 void save(std::ostream &os)
const
596 saveData(os, myGroup);
597 saveData(os, myUsepieceattrib);
598 saveData(os, myPieceattrib);
599 saveData(os, myAlgorithm);
600 saveData(os, myUseiter);
601 saveData(os, myIterations);
603 saveData(os, myAllowpartialunsub);
604 saveData(os, myRepairmesh);
605 saveData(os, myStrategy);
606 saveData(os, myPreferuniform);
607 saveData(os, mySeed);
608 saveData(os, myUseconnectivityattribute);
609 saveData(os, myConnectivityattribute);
610 saveData(os, myConnectivitytol);
611 saveData(os, myUseoutputdepthattribute);
612 saveData(os, myOutputdepthattribute);
625 loadData(is, myGroup);
626 loadData(is, myUsepieceattrib);
627 loadData(is, myPieceattrib);
628 loadData(is, myAlgorithm);
629 loadData(is, myUseiter);
630 loadData(is, myIterations);
632 loadData(is, myAllowpartialunsub);
633 loadData(is, myRepairmesh);
634 loadData(is, myStrategy);
635 loadData(is, myPreferuniform);
636 loadData(is, mySeed);
637 loadData(is, myUseconnectivityattribute);
638 loadData(is, myConnectivityattribute);
639 loadData(is, myConnectivitytol);
640 loadData(is, myUseoutputdepthattribute);
641 loadData(is, myOutputdepthattribute);
651 if (!thissop)
return getGroup();
653 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
661 if (!thissop)
return getUsepieceattrib();
663 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
671 if (!thissop)
return getPieceattrib();
673 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
681 if (!thissop)
return getAlgorithm();
683 OP_Utils::evalOpParm(result, thissop,
"algorithm", cookparms.
getCookTime(), 0);
691 if (!thissop)
return getUseiter();
693 OP_Utils::evalOpParm(result, thissop,
"useiter", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getIterations();
703 OP_Utils::evalOpParm(result, thissop,
"iterations", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getTol();
713 OP_Utils::evalOpParm(result, thissop,
"tol", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getAllowpartialunsub();
723 OP_Utils::evalOpParm(result, thissop,
"allowpartialunsub", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getRepairmesh();
733 OP_Utils::evalOpParm(result, thissop,
"repairmesh", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getStrategy();
743 OP_Utils::evalOpParm(result, thissop,
"strategy", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getPreferuniform();
753 OP_Utils::evalOpParm(result, thissop,
"preferuniform", cookparms.
getCookTime(), 0);
761 if (!thissop)
return getSeed();
763 OP_Utils::evalOpParm(result, thissop,
"seed", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getUseconnectivityattribute();
773 OP_Utils::evalOpParm(result, thissop,
"useconnectivityattribute", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getConnectivityattribute();
783 OP_Utils::evalOpParm(result, thissop,
"connectivityattribute", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getConnectivitytol();
793 OP_Utils::evalOpParm(result, thissop,
"connectivitytol", cookparms.
getCookTime(), 0);
801 if (!thissop)
return getUseoutputdepthattribute();
803 OP_Utils::evalOpParm(result, thissop,
"useoutputdepthattribute", cookparms.
getCookTime(), 0);
811 if (!thissop)
return getOutputdepthattribute();
813 OP_Utils::evalOpParm(result, thissop,
"outputdepthattribute", cookparms.
getCookTime(), 0);
819 bool myUsepieceattrib;
825 bool myAllowpartialunsub;
828 bool myPreferuniform;
830 bool myUseconnectivityattribute;
833 bool myUseoutputdepthattribute;
static void saveData(std::ostream &os, UT_Matrix3D v)
const UT_StringHolder & getOutputdepthattribute() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool getPreferuniform() const
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
SOP_Node * getNode() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setGroup(const UT_StringHolder &val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
GLsizei const GLfloat * value
void setRepairmesh(bool val)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, fpreal64 &v)
bool opAllowpartialunsub(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
void setStrategy(Strategy val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Strategy getStrategy() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
bool opRepairmesh(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPieceattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setUseconnectivityattribute(bool val)
An output stream object that owns its own string buffer storage.
const UT_StringHolder & getGroup() const
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal64 opTol(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 setUsepieceattrib(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opPreferuniform(const SOP_NodeVerb::CookParms &cookparms) const
void setTol(fpreal64 val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
bool getUseconnectivityattribute() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator!=(const SOP_UnsubdivideParms &src) const
void setOutputdepthattribute(const UT_StringHolder &val)
const UT_StringHolder & getConnectivityattribute() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
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_Vector3I &v)
const UT_StringHolder & getPieceattrib() const
static void saveData(std::ostream &os, fpreal64 v)
void setAlgorithm(Algorithm val)
bool opUseoutputdepthattribute(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opOutputdepthattribute(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
bool opUseconnectivityattribute(const SOP_NodeVerb::CookParms &cookparms) const
void setConnectivitytol(fpreal64 val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setPieceattrib(const UT_StringHolder &val)
UT_StringHolder opConnectivityattribute(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
void setConnectivityattribute(const UT_StringHolder &val)
bool load(UT_IStream &is)
fpreal64 opConnectivitytol(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getConnectivitytol() const
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
void setIterations(int64 val)
void setUseoutputdepthattribute(bool val)
static void saveData(std::ostream &os, bool 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
int64 opSeed(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
Algorithm getAlgorithm() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool getUsepieceattrib() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
void setAllowpartialunsub(bool val)
virtual UT_StringHolder baseGetSignature() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool operator==(const SOP_UnsubdivideParms &src) const
fpreal getCookTime() const
void setPreferuniform(bool val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint getNestNumParms(TempIndex idx) const override
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
bool opUsepieceattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
const char * findChar(int c) const
bool getAllowpartialunsub() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
int64 getIterations() const
constexpr SYS_FORCE_INLINE T & y() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool getUseoutputdepthattribute() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Strategy opStrategy(const SOP_NodeVerb::CookParms &cookparms) const
Algorithm opAlgorithm(const SOP_NodeVerb::CookParms &cookparms) const
bool getRepairmesh() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Algorithm enum_value)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool opUseiter(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setUseiter(bool val)