23 namespace SOP_GroupExpandEnums
37 using namespace UT::Literal;
60 using namespace UT::Literal;
81 myOutputgroup =
""_UTsh;
84 myPrimshareedge =
false;
87 myUsestepattrib =
false;
88 myStepattrib =
"step"_UTsh;
91 myOverridenormal =
false;
92 myNormalattrib =
"N"_UTsh;
93 myUseconnectivityattrib =
false;
94 myConnectivityattrib =
"uv"_UTsh;
95 myUsecolgroup =
false;
98 myColgroupinvert =
false;
99 myColgroupallowonbound =
false;
112 if (myOutputgroup != src.myOutputgroup)
return false;
113 if (myGroup != src.myGroup)
return false;
114 if (myGrouptype != src.myGrouptype)
return false;
115 if (myPrimshareedge != src.myPrimshareedge)
return false;
116 if (myFloodfill != src.myFloodfill)
return false;
117 if (myNumsteps != src.myNumsteps)
return false;
118 if (myUsestepattrib != src.myUsestepattrib)
return false;
119 if (myStepattrib != src.myStepattrib)
return false;
120 if (myBynormal != src.myBynormal)
return false;
121 if (myNormalangle != src.myNormalangle)
return false;
122 if (myOverridenormal != src.myOverridenormal)
return false;
123 if (myNormalattrib != src.myNormalattrib)
return false;
124 if (myUseconnectivityattrib != src.myUseconnectivityattrib)
return false;
125 if (myConnectivityattrib != src.myConnectivityattrib)
return false;
126 if (myUsecolgroup != src.myUsecolgroup)
return false;
127 if (myColgroup != src.myColgroup)
return false;
128 if (myColgrouptype != src.myColgrouptype)
return false;
129 if (myColgroupinvert != src.myColgroupinvert)
return false;
130 if (myColgroupallowonbound != src.myColgroupallowonbound)
return false;
145 myOutputgroup =
""_UTsh;
147 graph->
evalOpParm(myOutputgroup, nodeidx,
"outputgroup", time, 0);
150 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
153 graph->
evalOpParm(myGrouptype, nodeidx,
"grouptype", time, 0);
154 myPrimshareedge =
false;
155 if (
true && ( (
true&&!(((
int64(getGrouptype())==1))||((
int64(getGrouptype())==2))||((
int64(getGrouptype())==3)))) ) )
156 graph->
evalOpParm(myPrimshareedge, nodeidx,
"primshareedge", time, 0);
159 graph->
evalOpParm(myFloodfill, nodeidx,
"floodfill", time, 0);
161 if (
true && ( (
true&&!(((getFloodfill()==1)))) ) )
162 graph->
evalOpParm(myNumsteps, nodeidx,
"numsteps", time, 0);
163 myUsestepattrib =
false;
165 graph->
evalOpParm(myUsestepattrib, nodeidx,
"usestepattrib", time, 0);
166 myStepattrib =
"step"_UTsh;
167 if (
true && ( (
true&&!(((getUsestepattrib()==0)))) ) )
168 graph->
evalOpParm(myStepattrib, nodeidx,
"stepattrib", time, 0);
171 graph->
evalOpParm(myBynormal, nodeidx,
"bynormal", time, 0);
173 if (
true && ( (
true&&!(((getBynormal()==0)))) ) )
174 graph->
evalOpParm(myNormalangle, nodeidx,
"normalangle", time, 0);
175 myOverridenormal =
false;
176 if (
true && ( (
true&&!(((getBynormal()==0)))) ) )
177 graph->
evalOpParm(myOverridenormal, nodeidx,
"overridenormal", time, 0);
178 myNormalattrib =
"N"_UTsh;
179 if (
true && ( (
true&&!(((getBynormal()==0))||((getOverridenormal()==0)))) ) )
180 graph->
evalOpParm(myNormalattrib, nodeidx,
"normalattrib", time, 0);
181 myUseconnectivityattrib =
false;
183 graph->
evalOpParm(myUseconnectivityattrib, nodeidx,
"useconnectivityattrib", time, 0);
184 myConnectivityattrib =
"uv"_UTsh;
185 if (
true && ( (
true&&!(((getUseconnectivityattrib()==0)))) ) )
186 graph->
evalOpParm(myConnectivityattrib, nodeidx,
"connectivityattrib", time, 0);
187 myUsecolgroup =
false;
189 graph->
evalOpParm(myUsecolgroup, nodeidx,
"usecolgroup", time, 0);
190 myColgroup =
""_UTsh;
191 if (
true && ( (
true&&!(((getUsecolgroup()==0)))) ) )
192 graph->
evalOpParm(myColgroup, nodeidx,
"colgroup", time, 0);
194 if (
true && ( (
true&&!(((getUsecolgroup()==0)))) ) )
195 graph->
evalOpParm(myColgrouptype, nodeidx,
"colgrouptype", time, 0);
196 myColgroupinvert =
false;
197 if (
true && ( (
true&&!(((getUsecolgroup()==0)))) ) )
198 graph->
evalOpParm(myColgroupinvert, nodeidx,
"colgroupinvert", time, 0);
199 myColgroupallowonbound =
false;
200 if (
true && ( (
true&&!(((getUsecolgroup()==0))||((getColgroupinvert()==1)))) ) )
201 graph->
evalOpParm(myColgroupallowonbound, nodeidx,
"colgroupallowonbound", time, 0);
217 template <
typename T>
224 if (idx.
size() != instance.
size()+1)
229 coerceValue(value, myOutputgroup);
232 coerceValue(value, myGroup);
235 coerceValue(value, myGrouptype);
238 coerceValue(value, myPrimshareedge);
241 coerceValue(value, myFloodfill);
244 coerceValue(value, myNumsteps);
247 coerceValue(value, myUsestepattrib);
250 coerceValue(value, myStepattrib);
253 coerceValue(value, myBynormal);
256 coerceValue(value, myNormalangle);
259 coerceValue(value, myOverridenormal);
262 coerceValue(value, myNormalattrib);
265 coerceValue(value, myUseconnectivityattrib);
268 coerceValue(value, myConnectivityattrib);
271 coerceValue(value, myUsecolgroup);
274 coerceValue(value, myColgroup);
277 coerceValue(value, myColgrouptype);
280 coerceValue(value, myColgroupinvert);
283 coerceValue(value, myColgroupallowonbound);
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 { doGetParmValue(idx, instance, value); }
319 { doGetParmValue(idx, instance, value); }
321 template <
typename T>
328 if (idx.
size() != instance.
size()+1)
333 coerceValue(myOutputgroup, ( ( value ) ));
336 coerceValue(myGroup, ( ( value ) ));
339 coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
342 coerceValue(myPrimshareedge, ( ( value ) ));
345 coerceValue(myFloodfill, ( ( value ) ));
348 coerceValue(myNumsteps, ( ( value ) ));
351 coerceValue(myUsestepattrib, ( ( value ) ));
354 coerceValue(myStepattrib, ( ( value ) ));
357 coerceValue(myBynormal, ( ( value ) ));
360 coerceValue(myNormalangle, ( ( value ) ));
363 coerceValue(myOverridenormal, ( ( value ) ));
366 coerceValue(myNormalattrib, ( ( value ) ));
369 coerceValue(myUseconnectivityattrib, ( ( value ) ));
372 coerceValue(myConnectivityattrib, ( ( value ) ));
375 coerceValue(myUsecolgroup, ( ( value ) ));
378 coerceValue(myColgroup, ( ( value ) ));
381 coerceValue(myColgrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
384 coerceValue(myColgroupinvert, ( ( value ) ));
387 coerceValue(myColgroupallowonbound, ( ( value ) ));
394 { doSetParmValue(idx, instance, value); }
396 { doSetParmValue(idx, instance, value); }
398 { doSetParmValue(idx, instance, value); }
400 { doSetParmValue(idx, instance, value); }
402 { doSetParmValue(idx, instance, value); }
404 { doSetParmValue(idx, instance, value); }
406 { doSetParmValue(idx, instance, value); }
408 { doSetParmValue(idx, instance, value); }
410 { doSetParmValue(idx, instance, value); }
412 { doSetParmValue(idx, instance, value); }
414 { doSetParmValue(idx, instance, value); }
430 if (fieldnum.
size() < 1)
435 return "outputgroup";
441 return "primshareedge";
447 return "usestepattrib";
453 return "normalangle";
455 return "overridenormal";
457 return "normalattrib";
459 return "useconnectivityattrib";
461 return "connectivityattrib";
463 return "usecolgroup";
467 return "colgrouptype";
469 return "colgroupinvert";
471 return "colgroupallowonbound";
479 if (fieldnum.
size() < 1)
480 return PARM_UNSUPPORTED;
523 return PARM_UNSUPPORTED;
559 loadData(is, rampdata);
577 int typelen = colon - data.
buffer();
591 {
int64 iv =
v; UTwrite(os, &iv); }
593 { UTwrite<fpreal64>(os, &
v); }
595 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
597 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
598 UTwrite<fpreal64>(os, &v.
z()); }
600 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
601 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
613 if (s) s->save(ostr);
615 saveData(os, result);
622 ostr << s->getDataTypeToken();
627 saveData(os, result);
631 void save(std::ostream &os)
const
635 saveData(os, myOutputgroup);
636 saveData(os, myGroup);
637 saveData(os, myGrouptype);
638 saveData(os, myPrimshareedge);
639 saveData(os, myFloodfill);
640 saveData(os, myNumsteps);
641 saveData(os, myUsestepattrib);
642 saveData(os, myStepattrib);
643 saveData(os, myBynormal);
644 saveData(os, myNormalangle);
645 saveData(os, myOverridenormal);
646 saveData(os, myNormalattrib);
647 saveData(os, myUseconnectivityattrib);
648 saveData(os, myConnectivityattrib);
649 saveData(os, myUsecolgroup);
650 saveData(os, myColgroup);
651 saveData(os, myColgrouptype);
652 saveData(os, myColgroupinvert);
653 saveData(os, myColgroupallowonbound);
666 loadData(is, myOutputgroup);
667 loadData(is, myGroup);
668 loadData(is, myGrouptype);
669 loadData(is, myPrimshareedge);
670 loadData(is, myFloodfill);
671 loadData(is, myNumsteps);
672 loadData(is, myUsestepattrib);
673 loadData(is, myStepattrib);
674 loadData(is, myBynormal);
675 loadData(is, myNormalangle);
676 loadData(is, myOverridenormal);
677 loadData(is, myNormalattrib);
678 loadData(is, myUseconnectivityattrib);
679 loadData(is, myConnectivityattrib);
680 loadData(is, myUsecolgroup);
681 loadData(is, myColgroup);
682 loadData(is, myColgrouptype);
683 loadData(is, myColgroupinvert);
684 loadData(is, myColgroupallowonbound);
694 if (!thissop)
return getOutputgroup();
696 OP_Utils::evalOpParm(result, thissop,
"outputgroup", cookparms.
getCookTime(), 0);
704 if (!thissop)
return getGroup();
706 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
714 if (!thissop)
return getGrouptype();
716 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
724 if (!thissop)
return getPrimshareedge();
726 OP_Utils::evalOpParm(result, thissop,
"primshareedge", cookparms.
getCookTime(), 0);
734 if (!thissop)
return getFloodfill();
736 OP_Utils::evalOpParm(result, thissop,
"floodfill", cookparms.
getCookTime(), 0);
744 if (!thissop)
return getNumsteps();
746 OP_Utils::evalOpParm(result, thissop,
"numsteps", cookparms.
getCookTime(), 0);
754 if (!thissop)
return getUsestepattrib();
756 OP_Utils::evalOpParm(result, thissop,
"usestepattrib", cookparms.
getCookTime(), 0);
764 if (!thissop)
return getStepattrib();
766 OP_Utils::evalOpParm(result, thissop,
"stepattrib", cookparms.
getCookTime(), 0);
774 if (!thissop)
return getBynormal();
776 OP_Utils::evalOpParm(result, thissop,
"bynormal", cookparms.
getCookTime(), 0);
784 if (!thissop)
return getNormalangle();
786 OP_Utils::evalOpParm(result, thissop,
"normalangle", cookparms.
getCookTime(), 0);
794 if (!thissop)
return getOverridenormal();
796 OP_Utils::evalOpParm(result, thissop,
"overridenormal", cookparms.
getCookTime(), 0);
804 if (!thissop)
return getNormalattrib();
806 OP_Utils::evalOpParm(result, thissop,
"normalattrib", cookparms.
getCookTime(), 0);
814 if (!thissop)
return getUseconnectivityattrib();
816 OP_Utils::evalOpParm(result, thissop,
"useconnectivityattrib", cookparms.
getCookTime(), 0);
824 if (!thissop)
return getConnectivityattrib();
826 OP_Utils::evalOpParm(result, thissop,
"connectivityattrib", cookparms.
getCookTime(), 0);
834 if (!thissop)
return getUsecolgroup();
836 OP_Utils::evalOpParm(result, thissop,
"usecolgroup", cookparms.
getCookTime(), 0);
844 if (!thissop)
return getColgroup();
846 OP_Utils::evalOpParm(result, thissop,
"colgroup", cookparms.
getCookTime(), 0);
854 if (!thissop)
return getColgrouptype();
856 OP_Utils::evalOpParm(result, thissop,
"colgrouptype", cookparms.
getCookTime(), 0);
864 if (!thissop)
return getColgroupinvert();
866 OP_Utils::evalOpParm(result, thissop,
"colgroupinvert", cookparms.
getCookTime(), 0);
874 if (!thissop)
return getColgroupallowonbound();
876 OP_Utils::evalOpParm(result, thissop,
"colgroupallowonbound", cookparms.
getCookTime(), 0);
884 bool myPrimshareedge;
887 bool myUsestepattrib;
891 bool myOverridenormal;
893 bool myUseconnectivityattrib;
897 int64 myColgrouptype;
898 bool myColgroupinvert;
899 bool myColgroupallowonbound;
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNumsteps(int64 val)
UT_StringHolder opOutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
void setConnectivityattrib(const UT_StringHolder &val)
const UT_StringHolder & getConnectivityattrib() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool opColgroupinvert(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const UT_StringHolder & getColgroup() const
SOP_Node * getNode() const
int64 getNumsteps() const
static void loadData(UT_IStream &is, int64 &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const UT_StringHolder & getGroup() const
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool load(UT_IStream &is)
exint bread(int32 *buffer, exint asize=1)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
fpreal64 getNormalangle() const
void setColgroupinvert(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getUseconnectivityattrib() const
const OP_Context & context() const
const UT_StringHolder & getStepattrib() const
bool opOverridenormal(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_Matrix3D v)
Colgrouptype opColgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
void setBynormal(bool val)
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setPrimshareedge(bool val)
void setStepattrib(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
**But if you need a result
bool opPrimshareedge(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
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 getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setOverridenormal(bool val)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
Colgrouptype getColgrouptype() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
bool opUseconnectivityattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opColgroupallowonbound(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_StringHolder opColgroup(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
bool getOverridenormal() 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
void setOutputgroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setFloodfill(bool val)
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setColgrouptype(Colgrouptype val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_StringHolder & getOutputgroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
Grouptype getGrouptype() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setUseconnectivityattrib(bool val)
UT_StringHolder opConnectivityattrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getNormalattrib() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Vector4D v)
bool operator==(const SOP_GroupExpandParms &src) const
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, bool &v)
void setColgroupallowonbound(bool val)
void setNormalattrib(const UT_StringHolder &val)
void setColgroup(const UT_StringHolder &val)
bool getFloodfill() const
bool opUsestepattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
UT_StringHolder opNormalattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
DEP_MicroNode * depnode() const
void save(std::ostream &os) const
LeafData & operator=(const LeafData &)=delete
bool opUsecolgroup(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
void setUsecolgroup(bool val)
void setGrouptype(Grouptype val)
bool getUsestepattrib() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal getCookTime() const
bool getColgroupallowonbound() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
int64 opNumsteps(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
ParmType getNestParmType(TempIndex fieldnum) const override
void setUsestepattrib(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal64 opNormalangle(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
void setNormalangle(fpreal64 val)
bool opBynormal(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool getUsecolgroup() const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opFloodfill(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opStepattrib(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool getPrimshareedge() const
bool operator!=(const SOP_GroupExpandParms &src) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & x() noexcept
bool getColgroupinvert() const