23 namespace SOP_RefineEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
101 if (myGroup != src.myGroup)
return false;
102 if (myFirstu != src.myFirstu)
return false;
103 if (myDomainu1 != src.myDomainu1)
return false;
104 if (mySecondu != src.mySecondu)
return false;
105 if (myDomainu2 != src.myDomainu2)
return false;
106 if (myFirstv != src.myFirstv)
return false;
107 if (myDomainv1 != src.myDomainv1)
return false;
108 if (mySecondv != src.mySecondv)
return false;
109 if (myDomainv2 != src.myDomainv2)
return false;
110 if (myRefineu != src.myRefineu)
return false;
111 if (myRefinev != src.myRefinev)
return false;
112 if (myRefinespace != src.myRefinespace)
return false;
113 if (myStdswitcher != src.myStdswitcher)
return false;
114 if (myUnrefineu != src.myUnrefineu)
return false;
115 if (myUnrefinev != src.myUnrefinev)
return false;
116 if (myTolu != src.myTolu)
return false;
117 if (myTolv != src.myTolv)
return false;
118 if (mySubdivspace != src.mySubdivspace)
return false;
119 if (myDivsu != src.myDivsu)
return false;
120 if (myDivsv != src.myDivsv)
return false;
137 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
140 graph->
evalOpParm(myFirstu, nodeidx,
"firstu", time, 0);
142 if (
true && ( (
true&&!(((getFirstu()==0)))) ) )
143 graph->
evalOpParm(myDomainu1, nodeidx,
"domainu1", time, 0);
146 graph->
evalOpParm(mySecondu, nodeidx,
"secondu", time, 0);
148 if (
true && ( (
true&&!(((getSecondu()==0)))) ) )
149 graph->
evalOpParm(myDomainu2, nodeidx,
"domainu2", time, 0);
152 graph->
evalOpParm(myFirstv, nodeidx,
"firstv", time, 0);
154 if (
true && ( (
true&&!(((getFirstv()==0)))) ) )
155 graph->
evalOpParm(myDomainv1, nodeidx,
"domainv1", time, 0);
158 graph->
evalOpParm(mySecondv, nodeidx,
"secondv", time, 0);
160 if (
true && ( (
true&&!(((getSecondv()==0)))) ) )
161 graph->
evalOpParm(myDomainv2, nodeidx,
"domainv2", time, 0);
163 if (
true && ( (
true&&!(((getFirstu()==0)&&(getSecondu()==0)))) ) )
164 graph->
evalOpParm(myRefineu, nodeidx,
"refineu", time, 0);
166 if (
true && ( (
true&&!(((getFirstv()==0)&&(getSecondv()==0)))) ) )
167 graph->
evalOpParm(myRefinev, nodeidx,
"refinev", time, 0);
169 if (
true && ( (
true&&!(((getFirstu()==0)&&(getFirstv()==0))||((getFirstu()==0)&&(getSecondv()==0))||((getSecondu()==0)&&(getFirstv()==0))||((getSecondu()==0)&&(getSecondv()==0)))) ) )
170 graph->
evalOpParm(myRefinespace, nodeidx,
"refinespace", time, 0);
173 graph->
evalOpParm(myStdswitcher, nodeidx,
"stdswitcher", time, 0);
175 if (
true && ( (
true&&!(((getFirstu()==0)&&(getSecondu()==0)))) ) )
176 graph->
evalOpParm(myUnrefineu, nodeidx,
"unrefineu", time, 0);
178 if (
true && ( (
true&&!(((getFirstv()==0)&&(getSecondv()==0)))) ) )
179 graph->
evalOpParm(myUnrefinev, nodeidx,
"unrefinev", time, 0);
181 if (
true && ( (
true&&!(((getFirstu()==0)&&(getSecondu()==0)))) ) )
182 graph->
evalOpParm(myTolu, nodeidx,
"tolu", time, 0);
184 if (
true && ( (
true&&!(((getFirstv()==0)&&(getSecondv()==0)))) ) )
185 graph->
evalOpParm(myTolv, nodeidx,
"tolv", time, 0);
187 if (
true && ( (
true&&!(((getFirstu()==0)&&(getFirstv()==0))||((getFirstu()==0)&&(getSecondv()==0))||((getSecondu()==0)&&(getFirstv()==0))||((getSecondu()==0)&&(getSecondv()==0)))) ) )
188 graph->
evalOpParm(mySubdivspace, nodeidx,
"subdivspace", time, 0);
190 if (
true && ( (
true&&!(((getFirstu()==0))||((getSecondu()==0))||((
int64(getStdswitcher())==1)))) ) )
191 graph->
evalOpParm(myDivsu, nodeidx,
"divsu", time, 0);
193 if (
true && ( (
true&&!(((getFirstv()==0))||((getSecondv()==0))||((
int64(getStdswitcher())==1)))) ) )
194 graph->
evalOpParm(myDivsv, nodeidx,
"divsv", time, 0);
210 template <
typename T>
217 if (idx.
size() != instance.
size()+1)
222 coerceValue(value, myGroup);
225 coerceValue(value, myFirstu);
228 coerceValue(value, myDomainu1);
231 coerceValue(value, mySecondu);
234 coerceValue(value, myDomainu2);
237 coerceValue(value, myFirstv);
240 coerceValue(value, myDomainv1);
243 coerceValue(value, mySecondv);
246 coerceValue(value, myDomainv2);
249 coerceValue(value, myRefineu);
252 coerceValue(value, myRefinev);
255 coerceValue(value, myRefinespace);
258 coerceValue(value, myStdswitcher);
261 coerceValue(value, myUnrefineu);
264 coerceValue(value, myUnrefinev);
267 coerceValue(value, myTolu);
270 coerceValue(value, myTolv);
273 coerceValue(value, mySubdivspace);
276 coerceValue(value, myDivsu);
279 coerceValue(value, myDivsv);
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 { doGetParmValue(idx, instance, value); }
301 { doGetParmValue(idx, instance, value); }
303 { doGetParmValue(idx, instance, value); }
305 { doGetParmValue(idx, instance, value); }
307 { doGetParmValue(idx, instance, value); }
309 { doGetParmValue(idx, instance, value); }
311 { doGetParmValue(idx, instance, value); }
313 { doGetParmValue(idx, instance, value); }
315 { doGetParmValue(idx, instance, value); }
317 template <
typename T>
324 if (idx.
size() != instance.
size()+1)
329 coerceValue(myGroup, ( ( value ) ));
332 coerceValue(myFirstu, ( ( value ) ));
335 coerceValue(myDomainu1, clampMinValue(0, clampMaxValue(1, value ) ));
338 coerceValue(mySecondu, ( ( value ) ));
341 coerceValue(myDomainu2, clampMinValue(0, clampMaxValue(1, value ) ));
344 coerceValue(myFirstv, ( ( value ) ));
347 coerceValue(myDomainv1, clampMinValue(0, clampMaxValue(1, value ) ));
350 coerceValue(mySecondv, ( ( value ) ));
353 coerceValue(myDomainv2, clampMinValue(0, clampMaxValue(1, value ) ));
356 coerceValue(myRefineu, clampMinValue(1, ( value ) ));
359 coerceValue(myRefinev, clampMinValue(1, ( value ) ));
362 coerceValue(myRefinespace, clampMinValue(0, clampMaxValue(1, value ) ));
365 coerceValue(myStdswitcher, ( ( value ) ));
368 coerceValue(myUnrefineu, clampMinValue(1, ( value ) ));
371 coerceValue(myUnrefinev, clampMinValue(1, ( value ) ));
374 coerceValue(myTolu, clampMinValue(0, ( value ) ));
377 coerceValue(myTolv, clampMinValue(0, ( value ) ));
380 coerceValue(mySubdivspace, clampMinValue(0, clampMaxValue(1, value ) ));
383 coerceValue(myDivsu, clampMinValue(2, ( value ) ));
386 coerceValue(myDivsv, clampMinValue(2, ( value ) ));
393 { doSetParmValue(idx, instance, value); }
395 { doSetParmValue(idx, instance, value); }
397 { doSetParmValue(idx, instance, value); }
399 { doSetParmValue(idx, instance, value); }
401 { doSetParmValue(idx, instance, value); }
403 { doSetParmValue(idx, instance, value); }
405 { doSetParmValue(idx, instance, value); }
407 { doSetParmValue(idx, instance, value); }
409 { doSetParmValue(idx, instance, value); }
411 { doSetParmValue(idx, instance, value); }
413 { doSetParmValue(idx, instance, value); }
429 if (fieldnum.
size() < 1)
456 return "refinespace";
458 return "stdswitcher";
468 return "subdivspace";
480 if (fieldnum.
size() < 1)
481 return PARM_UNSUPPORTED;
526 return PARM_UNSUPPORTED;
562 loadData(is, rampdata);
580 int typelen = colon - data.
buffer();
594 {
int64 iv =
v; UTwrite(os, &iv); }
596 { UTwrite<fpreal64>(os, &
v); }
598 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
600 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
601 UTwrite<fpreal64>(os, &v.
z()); }
603 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
604 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
616 if (s) s->save(ostr);
618 saveData(os, result);
625 ostr << s->getDataTypeToken();
630 saveData(os, result);
634 void save(std::ostream &os)
const
638 saveData(os, myGroup);
639 saveData(os, myFirstu);
640 saveData(os, myDomainu1);
641 saveData(os, mySecondu);
642 saveData(os, myDomainu2);
643 saveData(os, myFirstv);
644 saveData(os, myDomainv1);
645 saveData(os, mySecondv);
646 saveData(os, myDomainv2);
647 saveData(os, myRefineu);
648 saveData(os, myRefinev);
649 saveData(os, myRefinespace);
650 saveData(os, myStdswitcher);
651 saveData(os, myUnrefineu);
652 saveData(os, myUnrefinev);
653 saveData(os, myTolu);
654 saveData(os, myTolv);
655 saveData(os, mySubdivspace);
656 saveData(os, myDivsu);
657 saveData(os, myDivsv);
670 loadData(is, myGroup);
671 loadData(is, myFirstu);
672 loadData(is, myDomainu1);
673 loadData(is, mySecondu);
674 loadData(is, myDomainu2);
675 loadData(is, myFirstv);
676 loadData(is, myDomainv1);
677 loadData(is, mySecondv);
678 loadData(is, myDomainv2);
679 loadData(is, myRefineu);
680 loadData(is, myRefinev);
681 loadData(is, myRefinespace);
682 loadData(is, myStdswitcher);
683 loadData(is, myUnrefineu);
684 loadData(is, myUnrefinev);
685 loadData(is, myTolu);
686 loadData(is, myTolv);
687 loadData(is, mySubdivspace);
688 loadData(is, myDivsu);
689 loadData(is, myDivsv);
699 if (!thissop)
return getGroup();
701 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getFirstu();
711 OP_Utils::evalOpParm(result, thissop,
"firstu", cookparms.
getCookTime(), 0);
719 if (!thissop)
return getDomainu1();
721 OP_Utils::evalOpParm(result, thissop,
"domainu1", cookparms.
getCookTime(), 0);
729 if (!thissop)
return getSecondu();
731 OP_Utils::evalOpParm(result, thissop,
"secondu", cookparms.
getCookTime(), 0);
739 if (!thissop)
return getDomainu2();
741 OP_Utils::evalOpParm(result, thissop,
"domainu2", cookparms.
getCookTime(), 0);
749 if (!thissop)
return getFirstv();
751 OP_Utils::evalOpParm(result, thissop,
"firstv", cookparms.
getCookTime(), 0);
759 if (!thissop)
return getDomainv1();
761 OP_Utils::evalOpParm(result, thissop,
"domainv1", cookparms.
getCookTime(), 0);
769 if (!thissop)
return getSecondv();
771 OP_Utils::evalOpParm(result, thissop,
"secondv", cookparms.
getCookTime(), 0);
779 if (!thissop)
return getDomainv2();
781 OP_Utils::evalOpParm(result, thissop,
"domainv2", cookparms.
getCookTime(), 0);
789 if (!thissop)
return getRefineu();
791 OP_Utils::evalOpParm(result, thissop,
"refineu", cookparms.
getCookTime(), 0);
799 if (!thissop)
return getRefinev();
801 OP_Utils::evalOpParm(result, thissop,
"refinev", cookparms.
getCookTime(), 0);
809 if (!thissop)
return getRefinespace();
811 OP_Utils::evalOpParm(result, thissop,
"refinespace", cookparms.
getCookTime(), 0);
819 if (!thissop)
return getStdswitcher();
821 OP_Utils::evalOpParm(result, thissop,
"stdswitcher", cookparms.
getCookTime(), 0);
829 if (!thissop)
return getUnrefineu();
831 OP_Utils::evalOpParm(result, thissop,
"unrefineu", cookparms.
getCookTime(), 0);
839 if (!thissop)
return getUnrefinev();
841 OP_Utils::evalOpParm(result, thissop,
"unrefinev", cookparms.
getCookTime(), 0);
849 if (!thissop)
return getTolu();
851 OP_Utils::evalOpParm(result, thissop,
"tolu", cookparms.
getCookTime(), 0);
859 if (!thissop)
return getTolv();
861 OP_Utils::evalOpParm(result, thissop,
"tolv", cookparms.
getCookTime(), 0);
869 if (!thissop)
return getSubdivspace();
871 OP_Utils::evalOpParm(result, thissop,
"subdivspace", cookparms.
getCookTime(), 0);
879 if (!thissop)
return getDivsu();
881 OP_Utils::evalOpParm(result, thissop,
"divsu", cookparms.
getCookTime(), 0);
889 if (!thissop)
return getDivsv();
891 OP_Utils::evalOpParm(result, thissop,
"divsv", cookparms.
getCookTime(), 0);
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
Refinespace getRefinespace() const
bool opSecondv(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SOP_Node * getNode() const
bool opFirstv(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDomainv2(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
int64 getUnrefinev() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setDomainu2(fpreal64 val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setDomainv1(fpreal64 val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setUnrefineu(int64 val)
const OP_Context & context() const
fpreal64 opDomainu2(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & z() noexcept
Subdivspace opSubdivspace(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
int64 opDivsu(const SOP_NodeVerb::CookParms &cookparms) const
void setRefinespace(Refinespace val)
An output stream object that owns its own string buffer storage.
void setSecondv(bool val)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
**But if you need a result
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
Subdivspace getSubdivspace() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 opTolu(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool load(UT_IStream &is)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
const char * getNestParmName(TempIndex fieldnum) const override
void setDomainu1(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, int64 v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void save(std::ostream &os) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool operator==(const SOP_RefineParms &src) const
fpreal64 getDomainu2() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal64 opDomainv1(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setStdswitcher(int64 val)
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_Vector4D v)
fpreal64 opDomainu1(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
int64 getUnrefineu() const
const OP_GraphProxy * graph() const
bool opSecondu(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setTolu(fpreal64 val)
int64 opDivsv(const SOP_NodeVerb::CookParms &cookparms) const
int64 opUnrefineu(const SOP_NodeVerb::CookParms &cookparms) const
void setDomainv2(fpreal64 val)
void setTolv(fpreal64 val)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, fpreal64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
int64 opRefinev(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setRefinev(int64 val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
SYS_FORCE_INLINE UT_StringHolder getToken(Refinespace enum_value)
GT_API const UT_StringHolder version
Refinespace opRefinespace(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setSubdivspace(Subdivspace val)
int64 opRefineu(const SOP_NodeVerb::CookParms &cookparms) const
void setUnrefinev(int64 val)
void setGroup(const UT_StringHolder &val)
void setSecondu(bool val)
fpreal64 opTolv(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal64 getDomainv2() const
int64 opUnrefinev(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
int64 opStdswitcher(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
bool opFirstu(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getDomainu1() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_Vector3D v)
fpreal64 getDomainv1() const
int64 getStdswitcher() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setRefineu(int64 val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator!=(const SOP_RefineParms &src) const