23 namespace SOP_GroupPromoteEnums
76 includeunshared =
true;
77 includecurveunshared =
true;
78 useconnectivityattrib =
false;
79 connectivityattrib =
"uv"_UTsh;
80 primsbyattribbndpts =
false;
82 onlyprimsedge =
false;
90 if (enable != src.
enable)
return false;
91 if (fromtype != src.
fromtype)
return false;
92 if (totype != src.
totype)
return false;
93 if (group != src.
group)
return false;
94 if (newname != src.
newname)
return false;
95 if (preserve != src.
preserve)
return false;
102 if (onlyfull != src.
onlyfull)
return false;
105 if (toattrib != src.
toattrib)
return false;
121 for (
int i = 0; i < list.
entries(); i++)
127 buf.
appendSprintf(
"%s", (list(i).enable) ?
"true" :
"false");
137 buf.
appendSprintf(
"%s", (list(i).preserve) ?
"true" :
"false");
139 buf.
appendSprintf(
"%s", (list(i).onlyboundary) ?
"true" :
"false");
141 buf.
appendSprintf(
"%s", (list(i).includeunshared) ?
"true" :
"false");
143 buf.
appendSprintf(
"%s", (list(i).includecurveunshared) ?
"true" :
"false");
145 buf.
appendSprintf(
"%s", (list(i).useconnectivityattrib) ?
"true" :
"false");
149 buf.
appendSprintf(
"%s", (list(i).primsbyattribbndpts) ?
"true" :
"false");
151 buf.
appendSprintf(
"%s", (list(i).onlyfull) ?
"true" :
"false");
153 buf.
appendSprintf(
"%s", (list(i).onlyprimsedge) ?
"true" :
"false");
155 buf.
appendSprintf(
"%s", (list(i).removedegen) ?
"true" :
"false");
157 buf.
appendSprintf(
"%s", (list(i).toattrib) ?
"true" :
"false");
169 myPromotions.setSize(1);
182 if (myPromotions != src.myPromotions)
return false;
200 graph->
evalOpParm(length, nodeidx,
"promotions", time, 0);
201 if (length < 0) length = 0;
202 myPromotions.setSize(length);
209 auto && _curentry = myPromotions(i);
211 _curentry.enable =
true;
213 graph->
evalOpParmInst(_curentry.enable, nodeidx,
"enable#", parmidx, offsets, time, 0, 2-1);
214 _curentry.fromtype = 0;
215 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
216 graph->
evalOpParmInst(_curentry.fromtype, nodeidx,
"fromtype#", parmidx, offsets, time, 0, 2-1);
217 _curentry.totype = 1;
218 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
219 graph->
evalOpParmInst(_curentry.totype, nodeidx,
"totype#", parmidx, offsets, time, 0, 2-1);
220 _curentry.group =
""_UTsh;
221 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
222 graph->
evalOpParmInst(_curentry.group, nodeidx,
"group#", parmidx, offsets, time, 0, 2-1);
223 _curentry.newname =
""_UTsh;
224 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
225 graph->
evalOpParmInst(_curentry.newname, nodeidx,
"newname#", parmidx, offsets, time, 0, 2-1);
226 _curentry.preserve =
false;
227 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
228 graph->
evalOpParmInst(_curentry.preserve, nodeidx,
"preserve#", parmidx, offsets, time, 0, 2-1);
229 _curentry.onlyboundary =
false;
230 if (
true && ( (
true&&!(((_curentry.enable==0)))) ) )
231 graph->
evalOpParmInst(_curentry.onlyboundary, nodeidx,
"onlyboundary#", parmidx, offsets, time, 0, 2-1);
232 _curentry.includeunshared =
true;
233 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.onlyboundary==0)))) ) )
234 graph->
evalOpParmInst(_curentry.includeunshared, nodeidx,
"includeunshared#", parmidx, offsets, time, 0, 2-1);
235 _curentry.includecurveunshared =
true;
236 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.onlyboundary==0))||((_curentry.includeunshared==0)))) ) )
237 graph->
evalOpParmInst(_curentry.includecurveunshared, nodeidx,
"includecurveunshared#", parmidx, offsets, time, 0, 2-1);
238 _curentry.useconnectivityattrib =
false;
239 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.onlyboundary==0)))) ) )
240 graph->
evalOpParmInst(_curentry.useconnectivityattrib, nodeidx,
"useconnectivityattrib#", parmidx, offsets, time, 0, 2-1);
241 _curentry.connectivityattrib =
"uv"_UTsh;
242 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.onlyboundary==0))||((_curentry.useconnectivityattrib==0)))) ) )
243 graph->
evalOpParmInst(_curentry.connectivityattrib, nodeidx,
"connectivityattrib#", parmidx, offsets, time, 0, 2-1);
244 _curentry.primsbyattribbndpts =
false;
245 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.onlyboundary==0))||((_curentry.totype!=0)))) ) )
246 graph->
evalOpParmInst(_curentry.primsbyattribbndpts, nodeidx,
"primsbyattribbndpts#", parmidx, offsets, time, 0, 2-1);
247 _curentry.onlyfull =
false;
248 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.totype==1))||((_curentry.onlyboundary==1)))) ) )
249 graph->
evalOpParmInst(_curentry.onlyfull, nodeidx,
"onlyfull#", parmidx, offsets, time, 0, 2-1);
250 _curentry.onlyprimsedge =
false;
251 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.totype!=0))||((_curentry.fromtype==1))||((_curentry.onlyboundary==1))||((_curentry.onlyfull==1)))) ) )
252 graph->
evalOpParmInst(_curentry.onlyprimsedge, nodeidx,
"onlyprimsedge#", parmidx, offsets, time, 0, 2-1);
253 _curentry.removedegen =
false;
254 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.totype==0)))) ) )
255 graph->
evalOpParmInst(_curentry.removedegen, nodeidx,
"removedegen#", parmidx, offsets, time, 0, 2-1);
256 _curentry.toattrib =
false;
257 if (
true && ( (
true&&!(((_curentry.enable==0))||((_curentry.totype==2)))) ) )
258 graph->
evalOpParmInst(_curentry.toattrib, nodeidx,
"toattrib#", parmidx, offsets, time, 0, 2-1);
263 myPromotions.clear();
279 template <
typename T>
286 if (idx.
size() != instance.
size()+1)
293 else if (instance[0] < myPromotions.entries())
295 auto && _data = myPromotions(instance[0]);
364 { doGetParmValue(idx, instance, value); }
366 { doGetParmValue(idx, instance, value); }
368 { doGetParmValue(idx, instance, value); }
370 { doGetParmValue(idx, instance, value); }
372 { doGetParmValue(idx, instance, value); }
374 { doGetParmValue(idx, instance, value); }
376 { doGetParmValue(idx, instance, value); }
378 { doGetParmValue(idx, instance, value); }
380 { doGetParmValue(idx, instance, value); }
382 { doGetParmValue(idx, instance, value); }
384 { doGetParmValue(idx, instance, value); }
386 template <
typename T>
393 if (idx.
size() != instance.
size()+1)
402 if (newsize < 0) newsize = 0;
403 myPromotions.setSize(newsize);
409 myPromotions.setSizeIfNeeded(instance[0]+1);
410 auto && _data = myPromotions(instance[0]);
470 { doSetParmValue(idx, instance, value); }
472 { doSetParmValue(idx, instance, value); }
474 { doSetParmValue(idx, instance, value); }
476 { doSetParmValue(idx, instance, value); }
478 { doSetParmValue(idx, instance, 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); }
508 if (fieldnum.
size() < 1)
513 if (fieldnum.
size() == 1)
530 return "onlyboundary#";
532 return "includeunshared#";
534 return "includecurveunshared#";
536 return "useconnectivityattrib#";
538 return "connectivityattrib#";
540 return "primsbyattribbndpts#";
544 return "onlyprimsedge#";
546 return "removedegen#";
559 if (fieldnum.
size() < 1)
560 return PARM_UNSUPPORTED;
564 if (fieldnum.
size() == 1)
565 return PARM_MULTIPARM;
624 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
626 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
628 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
641 loadData(is, rampdata);
659 int typelen = colon - data.
buffer();
673 {
int64 iv =
v; UTwrite(os, &iv); }
675 { UTwrite<fpreal64>(os, &
v); }
677 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
679 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
680 UTwrite<fpreal64>(os, &v.
z()); }
682 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
683 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
695 if (s) s->save(ostr);
697 saveData(os, result);
704 ostr << s->getDataTypeToken();
709 saveData(os, result);
713 void save(std::ostream &os)
const
719 UTwrite(os, &length);
722 auto && _curentry = myPromotions(i);
724 saveData(os, _curentry.enable);
725 saveData(os, _curentry.fromtype);
726 saveData(os, _curentry.totype);
727 saveData(os, _curentry.group);
728 saveData(os, _curentry.newname);
729 saveData(os, _curentry.preserve);
730 saveData(os, _curentry.onlyboundary);
731 saveData(os, _curentry.includeunshared);
732 saveData(os, _curentry.includecurveunshared);
733 saveData(os, _curentry.useconnectivityattrib);
734 saveData(os, _curentry.connectivityattrib);
735 saveData(os, _curentry.primsbyattribbndpts);
736 saveData(os, _curentry.onlyfull);
737 saveData(os, _curentry.onlyprimsedge);
738 saveData(os, _curentry.removedegen);
739 saveData(os, _curentry.toattrib);
758 myPromotions.setSize(length);
761 auto && _curentry = myPromotions(i);
763 loadData(is, _curentry.enable);
764 loadData(is, _curentry.fromtype);
765 loadData(is, _curentry.totype);
766 loadData(is, _curentry.group);
767 loadData(is, _curentry.newname);
768 loadData(is, _curentry.preserve);
769 loadData(is, _curentry.onlyboundary);
770 loadData(is, _curentry.includeunshared);
771 loadData(is, _curentry.includecurveunshared);
772 loadData(is, _curentry.useconnectivityattrib);
773 loadData(is, _curentry.connectivityattrib);
774 loadData(is, _curentry.primsbyattribbndpts);
775 loadData(is, _curentry.onlyfull);
776 loadData(is, _curentry.onlyprimsedge);
777 loadData(is, _curentry.removedegen);
778 loadData(is, _curentry.toattrib);
791 if (!thissop)
return getPromotions().entries();
793 OP_Utils::evalOpParm(result, thissop,
"promotions", cookparms.
getCookTime(), 0);
797 {
return opinstPromotions_enable(cookparms, &_idx); }
801 if (!thissop)
return (myPromotions(_idx[0]).enable);
803 _parmidx[1-1] = _idx[1-1] + 1;
806 OP_Utils::evalOpParmInst(result, thissop,
"enable#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
810 {
return opinstPromotions_fromtype(cookparms, &_idx); }
814 if (!thissop)
return (myPromotions(_idx[0]).fromtype);
816 _parmidx[1-1] = _idx[1-1] + 1;
819 OP_Utils::evalOpParmInst(result, thissop,
"fromtype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
823 {
return opinstPromotions_totype(cookparms, &_idx); }
827 if (!thissop)
return (myPromotions(_idx[0]).totype);
829 _parmidx[1-1] = _idx[1-1] + 1;
832 OP_Utils::evalOpParmInst(result, thissop,
"totype#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
836 {
return opinstPromotions_group(cookparms, &_idx); }
840 if (!thissop)
return (myPromotions(_idx[0]).group);
842 _parmidx[1-1] = _idx[1-1] + 1;
845 OP_Utils::evalOpParmInst(result, thissop,
"group#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
849 {
return opinstPromotions_newname(cookparms, &_idx); }
853 if (!thissop)
return (myPromotions(_idx[0]).newname);
855 _parmidx[1-1] = _idx[1-1] + 1;
858 OP_Utils::evalOpParmInst(result, thissop,
"newname#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
862 {
return opinstPromotions_preserve(cookparms, &_idx); }
866 if (!thissop)
return (myPromotions(_idx[0]).preserve);
868 _parmidx[1-1] = _idx[1-1] + 1;
871 OP_Utils::evalOpParmInst(result, thissop,
"preserve#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
875 {
return opinstPromotions_onlyboundary(cookparms, &_idx); }
879 if (!thissop)
return (myPromotions(_idx[0]).onlyboundary);
881 _parmidx[1-1] = _idx[1-1] + 1;
884 OP_Utils::evalOpParmInst(result, thissop,
"onlyboundary#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
888 {
return opinstPromotions_includeunshared(cookparms, &_idx); }
892 if (!thissop)
return (myPromotions(_idx[0]).includeunshared);
894 _parmidx[1-1] = _idx[1-1] + 1;
897 OP_Utils::evalOpParmInst(result, thissop,
"includeunshared#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
901 {
return opinstPromotions_includecurveunshared(cookparms, &_idx); }
905 if (!thissop)
return (myPromotions(_idx[0]).includecurveunshared);
907 _parmidx[1-1] = _idx[1-1] + 1;
910 OP_Utils::evalOpParmInst(result, thissop,
"includecurveunshared#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
914 {
return opinstPromotions_useconnectivityattrib(cookparms, &_idx); }
918 if (!thissop)
return (myPromotions(_idx[0]).useconnectivityattrib);
920 _parmidx[1-1] = _idx[1-1] + 1;
923 OP_Utils::evalOpParmInst(result, thissop,
"useconnectivityattrib#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
927 {
return opinstPromotions_connectivityattrib(cookparms, &_idx); }
931 if (!thissop)
return (myPromotions(_idx[0]).connectivityattrib);
933 _parmidx[1-1] = _idx[1-1] + 1;
936 OP_Utils::evalOpParmInst(result, thissop,
"connectivityattrib#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
940 {
return opinstPromotions_primsbyattribbndpts(cookparms, &_idx); }
944 if (!thissop)
return (myPromotions(_idx[0]).primsbyattribbndpts);
946 _parmidx[1-1] = _idx[1-1] + 1;
949 OP_Utils::evalOpParmInst(result, thissop,
"primsbyattribbndpts#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
953 {
return opinstPromotions_onlyfull(cookparms, &_idx); }
957 if (!thissop)
return (myPromotions(_idx[0]).onlyfull);
959 _parmidx[1-1] = _idx[1-1] + 1;
962 OP_Utils::evalOpParmInst(result, thissop,
"onlyfull#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
966 {
return opinstPromotions_onlyprimsedge(cookparms, &_idx); }
970 if (!thissop)
return (myPromotions(_idx[0]).onlyprimsedge);
972 _parmidx[1-1] = _idx[1-1] + 1;
975 OP_Utils::evalOpParmInst(result, thissop,
"onlyprimsedge#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
979 {
return opinstPromotions_removedegen(cookparms, &_idx); }
983 if (!thissop)
return (myPromotions(_idx[0]).removedegen);
985 _parmidx[1-1] = _idx[1-1] + 1;
988 OP_Utils::evalOpParmInst(result, thissop,
"removedegen#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
992 {
return opinstPromotions_toattrib(cookparms, &_idx); }
996 if (!thissop)
return (myPromotions(_idx[0]).toattrib);
998 _parmidx[1-1] = _idx[1-1] + 1;
1001 OP_Utils::evalOpParmInst(result, thissop,
"toattrib#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
GLenum GLuint GLenum GLsizei const GLchar * buf
SOP_Node * getNode() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
constexpr SYS_FORCE_INLINE T & x() noexcept
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
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
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void coerceValue(T &result, const S &src) const
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
fpreal getCookTime() const
const char * findChar(int c) const
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept