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;
254 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
260 graph->
evalOpParm(myConnecttype, nodeidx,
"connecttype", time, graph->
isDirect()?
nullptr:depnode);
263 graph->
evalOpParm(myCloseu, nodeidx,
"closeu", time, graph->
isDirect()?
nullptr:depnode);
266 graph->
evalOpParm(myClosev, nodeidx,
"closev", time, graph->
isDirect()?
nullptr:depnode);
269 graph->
evalOpParm(myFirstuclamp, nodeidx,
"firstuclamp", time, graph->
isDirect()?
nullptr:depnode);
272 graph->
evalOpParm(myLastuclamp, nodeidx,
"lastuclamp", time, graph->
isDirect()?
nullptr:depnode);
275 graph->
evalOpParm(myFirstvclamp, nodeidx,
"firstvclamp", time, graph->
isDirect()?
nullptr:depnode);
278 graph->
evalOpParm(myLastvclamp, nodeidx,
"lastvclamp", time, graph->
isDirect()?
nullptr:depnode);
281 graph->
evalOpParm(myDivisions, nodeidx,
"divisions", time, graph->
isDirect()?
nullptr:depnode);
284 graph->
evalOpParm(myPolys, nodeidx,
"polys", time, graph->
isDirect()?
nullptr:depnode);
300 template <
typename T>
307 if (idx.
size() != instance.
size()+1)
312 coerceValue(value, myGroup);
318 coerceValue(value, myConnecttype);
321 coerceValue(value, myCloseu);
324 coerceValue(value, myClosev);
327 coerceValue(value, myFirstuclamp);
330 coerceValue(value, myLastuclamp);
333 coerceValue(value, myFirstvclamp);
336 coerceValue(value, myLastvclamp);
339 coerceValue(value, myDivisions);
342 coerceValue(value, myPolys);
358 { doGetParmValue(idx, instance, value); }
360 { doGetParmValue(idx, instance, value); }
362 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
387 if (idx.
size() != instance.
size()+1)
392 coerceValue(myGroup, ( ( value ) ));
395 coerceValue(
myBasis, clampMinValue(0, clampMaxValue(1, value ) ));
398 coerceValue(myConnecttype, clampMinValue(0, clampMaxValue(7, value ) ));
401 coerceValue(myCloseu, clampMinValue(0, clampMaxValue(2, value ) ));
404 coerceValue(myClosev, clampMinValue(0, clampMaxValue(2, value ) ));
407 coerceValue(myFirstuclamp, clampMinValue(0, clampMaxValue(2, value ) ));
410 coerceValue(myLastuclamp, clampMinValue(0, clampMaxValue(2, value ) ));
413 coerceValue(myFirstvclamp, clampMinValue(0, clampMaxValue(2, value ) ));
416 coerceValue(myLastvclamp, clampMinValue(0, clampMaxValue(2, value ) ));
419 coerceValue(myDivisions, clampMinValue(1, ( value ) ));
422 coerceValue(myPolys, ( ( value ) ));
429 { doSetParmValue(idx, instance, value); }
431 { doSetParmValue(idx, instance, value); }
433 { doSetParmValue(idx, instance, value); }
435 { doSetParmValue(idx, instance, value); }
437 { doSetParmValue(idx, instance, value); }
439 { doSetParmValue(idx, instance, value); }
441 { doSetParmValue(idx, instance, value); }
443 { doSetParmValue(idx, instance, value); }
445 { doSetParmValue(idx, instance, value); }
447 { doSetParmValue(idx, instance, value); }
449 { doSetParmValue(idx, instance, value); }
465 if (fieldnum.
size() < 1)
474 return "connecttype";
480 return "firstuclamp";
484 return "firstvclamp";
498 if (fieldnum.
size() < 1)
499 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);
640 saveData(os, myConnecttype);
641 saveData(os, myCloseu);
642 saveData(os, myClosev);
643 saveData(os, myFirstuclamp);
644 saveData(os, myLastuclamp);
645 saveData(os, myFirstvclamp);
646 saveData(os, myLastvclamp);
647 saveData(os, myDivisions);
648 saveData(os, myPolys);
661 loadData(is, myGroup);
663 loadData(is, myConnecttype);
664 loadData(is, myCloseu);
665 loadData(is, myClosev);
666 loadData(is, myFirstuclamp);
667 loadData(is, myLastuclamp);
668 loadData(is, myFirstvclamp);
669 loadData(is, myLastvclamp);
670 loadData(is, myDivisions);
671 loadData(is, myPolys);
681 if (!thissop)
return getGroup();
683 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
691 if (!thissop)
return getBasis();
693 OP_Utils::evalOpParm(result, thissop,
"basis", cookparms.
getCookTime(), 0);
694 return Basis(result);
701 if (!thissop)
return getConnecttype();
703 OP_Utils::evalOpParm(result, thissop,
"connecttype", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getCloseu();
713 OP_Utils::evalOpParm(result, thissop,
"closeu", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getClosev();
723 OP_Utils::evalOpParm(result, thissop,
"closev", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getFirstuclamp();
733 OP_Utils::evalOpParm(result, thissop,
"firstuclamp", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getLastuclamp();
743 OP_Utils::evalOpParm(result, thissop,
"lastuclamp", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getFirstvclamp();
753 OP_Utils::evalOpParm(result, thissop,
"firstvclamp", cookparms.
getCookTime(), 0);
761 if (!thissop)
return getLastvclamp();
763 OP_Utils::evalOpParm(result, thissop,
"lastvclamp", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getDivisions();
773 OP_Utils::evalOpParm(result, thissop,
"divisions", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getPolys();
783 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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
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