23 namespace SOP_PolyPatchEnums
34 using namespace UT::Literal;
57 using namespace UT::Literal;
81 using namespace UT::Literal;
100 using namespace UT::Literal;
101 switch (enum_value) {
119 using namespace UT::Literal;
120 switch (enum_value) {
138 using namespace UT::Literal;
139 switch (enum_value) {
157 using namespace UT::Literal;
158 switch (enum_value) {
176 using namespace UT::Literal;
177 switch (enum_value) {
218 if (myGroup != src.myGroup)
return false;
219 if (
myBasis != src.myBasis)
return false;
220 if (myConnecttype != src.myConnecttype)
return false;
221 if (myCloseu != src.myCloseu)
return false;
222 if (myClosev != src.myClosev)
return false;
223 if (myFirstuclamp != src.myFirstuclamp)
return false;
224 if (myLastuclamp != src.myLastuclamp)
return false;
225 if (myFirstvclamp != src.myFirstvclamp)
return false;
226 if (myLastvclamp != src.myLastvclamp)
return false;
227 if (myDivisions != src.myDivisions)
return false;
228 if (myPolys != src.myPolys)
return false;
251 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
257 graph->
evalOpParm(myConnecttype, nodeidx,
"connecttype", time, 0);
260 graph->
evalOpParm(myCloseu, nodeidx,
"closeu", time, 0);
263 graph->
evalOpParm(myClosev, nodeidx,
"closev", time, 0);
266 graph->
evalOpParm(myFirstuclamp, nodeidx,
"firstuclamp", time, 0);
269 graph->
evalOpParm(myLastuclamp, nodeidx,
"lastuclamp", time, 0);
272 graph->
evalOpParm(myFirstvclamp, nodeidx,
"firstvclamp", time, 0);
275 graph->
evalOpParm(myLastvclamp, nodeidx,
"lastvclamp", time, 0);
278 graph->
evalOpParm(myDivisions, nodeidx,
"divisions", time, 0);
281 graph->
evalOpParm(myPolys, nodeidx,
"polys", time, 0);
297 template <
typename T>
304 if (idx.
size() != instance.
size()+1)
309 coerceValue(value, myGroup);
315 coerceValue(value, myConnecttype);
318 coerceValue(value, myCloseu);
321 coerceValue(value, myClosev);
324 coerceValue(value, myFirstuclamp);
327 coerceValue(value, myLastuclamp);
330 coerceValue(value, myFirstvclamp);
333 coerceValue(value, myLastvclamp);
336 coerceValue(value, myDivisions);
339 coerceValue(value, myPolys);
355 { doGetParmValue(idx, instance, value); }
357 { doGetParmValue(idx, instance, value); }
359 { doGetParmValue(idx, instance, value); }
361 { doGetParmValue(idx, instance, value); }
363 { doGetParmValue(idx, instance, value); }
365 { doGetParmValue(idx, instance, value); }
367 { doGetParmValue(idx, instance, value); }
369 { doGetParmValue(idx, instance, value); }
371 { doGetParmValue(idx, instance, value); }
373 { doGetParmValue(idx, instance, value); }
375 { doGetParmValue(idx, instance, value); }
377 template <
typename T>
384 if (idx.
size() != instance.
size()+1)
389 coerceValue(myGroup, ( ( value ) ));
392 coerceValue(
myBasis, clampMinValue(0, clampMaxValue(1, value ) ));
395 coerceValue(myConnecttype, clampMinValue(0, clampMaxValue(7, value ) ));
398 coerceValue(myCloseu, clampMinValue(0, clampMaxValue(2, value ) ));
401 coerceValue(myClosev, clampMinValue(0, clampMaxValue(2, value ) ));
404 coerceValue(myFirstuclamp, clampMinValue(0, clampMaxValue(2, value ) ));
407 coerceValue(myLastuclamp, clampMinValue(0, clampMaxValue(2, value ) ));
410 coerceValue(myFirstvclamp, clampMinValue(0, clampMaxValue(2, value ) ));
413 coerceValue(myLastvclamp, clampMinValue(0, clampMaxValue(2, value ) ));
416 coerceValue(myDivisions, clampMinValue(1, ( value ) ));
419 coerceValue(myPolys, ( ( value ) ));
426 { doSetParmValue(idx, instance, value); }
428 { doSetParmValue(idx, instance, value); }
430 { doSetParmValue(idx, instance, value); }
432 { doSetParmValue(idx, instance, value); }
434 { doSetParmValue(idx, instance, value); }
436 { doSetParmValue(idx, instance, value); }
438 { doSetParmValue(idx, instance, value); }
440 { doSetParmValue(idx, instance, value); }
442 { doSetParmValue(idx, instance, value); }
444 { doSetParmValue(idx, instance, value); }
446 { doSetParmValue(idx, instance, value); }
462 if (fieldnum.
size() < 1)
471 return "connecttype";
477 return "firstuclamp";
481 return "firstvclamp";
495 if (fieldnum.
size() < 1)
496 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, myGroup);
637 saveData(os, myConnecttype);
638 saveData(os, myCloseu);
639 saveData(os, myClosev);
640 saveData(os, myFirstuclamp);
641 saveData(os, myLastuclamp);
642 saveData(os, myFirstvclamp);
643 saveData(os, myLastvclamp);
644 saveData(os, myDivisions);
645 saveData(os, myPolys);
658 loadData(is, myGroup);
660 loadData(is, myConnecttype);
661 loadData(is, myCloseu);
662 loadData(is, myClosev);
663 loadData(is, myFirstuclamp);
664 loadData(is, myLastuclamp);
665 loadData(is, myFirstvclamp);
666 loadData(is, myLastvclamp);
667 loadData(is, myDivisions);
668 loadData(is, myPolys);
678 if (!thissop)
return getGroup();
680 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
688 if (!thissop)
return getBasis();
690 OP_Utils::evalOpParm(result, thissop,
"basis", cookparms.
getCookTime(), 0);
691 return Basis(result);
698 if (!thissop)
return getConnecttype();
700 OP_Utils::evalOpParm(result, thissop,
"connecttype", cookparms.
getCookTime(), 0);
708 if (!thissop)
return getCloseu();
710 OP_Utils::evalOpParm(result, thissop,
"closeu", cookparms.
getCookTime(), 0);
718 if (!thissop)
return getClosev();
720 OP_Utils::evalOpParm(result, thissop,
"closev", cookparms.
getCookTime(), 0);
728 if (!thissop)
return getFirstuclamp();
730 OP_Utils::evalOpParm(result, thissop,
"firstuclamp", cookparms.
getCookTime(), 0);
738 if (!thissop)
return getLastuclamp();
740 OP_Utils::evalOpParm(result, thissop,
"lastuclamp", cookparms.
getCookTime(), 0);
748 if (!thissop)
return getFirstvclamp();
750 OP_Utils::evalOpParm(result, thissop,
"firstvclamp", cookparms.
getCookTime(), 0);
758 if (!thissop)
return getLastvclamp();
760 OP_Utils::evalOpParm(result, thissop,
"lastvclamp", cookparms.
getCookTime(), 0);
768 if (!thissop)
return getDivisions();
770 OP_Utils::evalOpParm(result, thissop,
"divisions", cookparms.
getCookTime(), 0);
778 if (!thissop)
return getPolys();
780 OP_Utils::evalOpParm(result, thissop,
"polys", cookparms.
getCookTime(), 0);
void setLastuclamp(Lastuclamp val)
Lastvclamp opLastvclamp(const SOP_NodeVerb::CookParms &cookparms) const
bool opPolys(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Connecttype getConnecttype() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SOP_Node * getNode() const
void setLastvclamp(Lastvclamp val)
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setFirstvclamp(Firstvclamp val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const UT_StringHolder & getGroup() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
Firstuclamp getFirstuclamp() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE const char * buffer() const
void setGroup(const UT_StringHolder &val)
Firstvclamp getFirstvclamp() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
An output stream object that owns its own string buffer storage.
Basis opBasis(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
Lastvclamp getLastvclamp() const
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector3D &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.
static void loadData(UT_IStream &is, UT_StringHolder &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setClosev(Closev val)
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 saveData(std::ostream &os, fpreal64 v)
void setFirstuclamp(Firstuclamp val)
Lastuclamp opLastuclamp(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
Closev opClosev(const SOP_NodeVerb::CookParms &cookparms) const
void setConnecttype(Connecttype val)
void setCloseu(Closeu val)
Connecttype opConnecttype(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
bool operator!=(const SOP_PolyPatchParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, int64 v)
bool operator==(const SOP_PolyPatchParms &src) const
Firstvclamp opFirstvclamp(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, bool v)
exint getNestNumParms(TempIndex idx) const override
DEP_MicroNode * depnode() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void copyFrom(const OP_NodeParms *src) override
LeafData & operator=(const LeafData &)=delete
void setDivisions(UT_Vector2I val)
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Matrix4D &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Basis enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal getCookTime() const
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_StringHolder s)
UT_Vector2I opDivisions(const SOP_NodeVerb::CookParms &cookparms) const
Closeu opCloseu(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Lastuclamp getLastuclamp() const
Firstuclamp opFirstuclamp(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_Vector2I getDivisions() const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & x() noexcept