23 namespace SOP_RevolveEnums
39 using namespace UT::Literal;
62 using namespace UT::Literal;
104 if (myGroup != src.myGroup)
return false;
105 if (mySurftype != src.mySurftype)
return false;
106 if (myOrigin != src.myOrigin)
return false;
107 if (myDir != src.myDir)
return false;
108 if (myPolys != src.myPolys)
return false;
109 if (myImperfect != src.myImperfect)
return false;
110 if (myType != src.myType)
return false;
111 if (myAngle != src.myAngle)
return false;
112 if (myDivs != src.myDivs)
return false;
113 if (
myOrder != src.myOrder)
return false;
114 if (myCap != src.myCap)
return false;
131 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
134 graph->
evalOpParm(mySurftype, nodeidx,
"surftype", time, 0);
137 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, 0);
140 graph->
evalOpParm(myDir, nodeidx,
"dir", time, 0);
143 graph->
evalOpParm(myPolys, nodeidx,
"polys", time, 0);
146 graph->
evalOpParm(myImperfect, nodeidx,
"imperfect", time, 0);
149 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
152 graph->
evalOpParm(myAngle, nodeidx,
"angle", time, 0);
155 graph->
evalOpParm(myDivs, nodeidx,
"divs", time, 0);
161 graph->
evalOpParm(myCap, nodeidx,
"cap", time, 0);
177 template <
typename T>
184 if (idx.
size() != instance.
size()+1)
189 coerceValue(value, myGroup);
192 coerceValue(value, mySurftype);
195 coerceValue(value, myOrigin);
198 coerceValue(value, myDir);
201 coerceValue(value, myPolys);
204 coerceValue(value, myImperfect);
207 coerceValue(value, myType);
210 coerceValue(value, myAngle);
213 coerceValue(value, myDivs);
219 coerceValue(value, myCap);
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 template <
typename T>
264 if (idx.
size() != instance.
size()+1)
269 coerceValue(myGroup, ( ( value ) ));
272 coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
275 coerceValue(myOrigin, ( ( value ) ));
278 coerceValue(myDir, ( ( value ) ));
281 coerceValue(myPolys, ( ( value ) ));
284 coerceValue(myImperfect, ( ( value ) ));
287 coerceValue(myType, clampMinValue(0, clampMaxValue(2, value ) ));
290 coerceValue(myAngle, ( ( value ) ));
293 coerceValue(myDivs, clampMinValue(1, ( value ) ));
296 coerceValue(
myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
299 coerceValue(myCap, ( ( value ) ));
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
312 { doSetParmValue(idx, instance, value); }
314 { doSetParmValue(idx, instance, value); }
316 { doSetParmValue(idx, instance, value); }
318 { doSetParmValue(idx, instance, value); }
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
342 if (fieldnum.
size() < 1)
375 if (fieldnum.
size() < 1)
376 return PARM_UNSUPPORTED;
403 return PARM_UNSUPPORTED;
439 loadData(is, rampdata);
457 int typelen = colon - data.
buffer();
471 {
int64 iv =
v; UTwrite(os, &iv); }
473 { UTwrite<fpreal64>(os, &
v); }
475 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
477 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
478 UTwrite<fpreal64>(os, &v.
z()); }
480 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
481 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
493 if (s) s->save(ostr);
495 saveData(os, result);
502 ostr << s->getDataTypeToken();
507 saveData(os, result);
511 void save(std::ostream &os)
const
515 saveData(os, myGroup);
516 saveData(os, mySurftype);
517 saveData(os, myOrigin);
519 saveData(os, myPolys);
520 saveData(os, myImperfect);
521 saveData(os, myType);
522 saveData(os, myAngle);
523 saveData(os, myDivs);
538 loadData(is, myGroup);
539 loadData(is, mySurftype);
540 loadData(is, myOrigin);
542 loadData(is, myPolys);
543 loadData(is, myImperfect);
544 loadData(is, myType);
545 loadData(is, myAngle);
546 loadData(is, myDivs);
558 if (!thissop)
return getGroup();
560 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
568 if (!thissop)
return getSurftype();
570 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
578 if (!thissop)
return getOrigin();
580 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
588 if (!thissop)
return getDir();
590 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
598 if (!thissop)
return getPolys();
600 OP_Utils::evalOpParm(result, thissop,
"polys", cookparms.
getCookTime(), 0);
608 if (!thissop)
return getImperfect();
610 OP_Utils::evalOpParm(result, thissop,
"imperfect", cookparms.
getCookTime(), 0);
618 if (!thissop)
return getType();
620 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
628 if (!thissop)
return getAngle();
630 OP_Utils::evalOpParm(result, thissop,
"angle", cookparms.
getCookTime(), 0);
638 if (!thissop)
return getDivs();
640 OP_Utils::evalOpParm(result, thissop,
"divs", cookparms.
getCookTime(), 0);
648 if (!thissop)
return getOrder();
650 OP_Utils::evalOpParm(result, thissop,
"order", cookparms.
getCookTime(), 0);
658 if (!thissop)
return getCap();
660 OP_Utils::evalOpParm(result, thissop,
"cap", cookparms.
getCookTime(), 0);
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
bool operator!=(const SOP_RevolveParms &src) const
bool load(UT_IStream &is)
UT_Vector3D getOrigin() const
bool opPolys(const SOP_NodeVerb::CookParms &cookparms) const
int64 opOrder(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
void setAngle(UT_Vector2D val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opCap(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opAngle(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_Vector2T< fpreal64 > UT_Vector2D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool operator==(const SOP_RevolveParms &src) const
An output stream object that owns its own string buffer storage.
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
**But if you need a result
void setDir(UT_Vector3D val)
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool getImperfect() const
static void loadData(UT_IStream &is, bool &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
const OP_GraphProxy * graph() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Matrix4D v)
Surftype opSurftype(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_Vector3T< fpreal64 > UT_Vector3D
UT_Vector3D getDir() const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
int64 opDivs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setOrigin(UT_Vector3D val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
DEP_MicroNode * depnode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, bool v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setSurftype(Surftype val)
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal getCookTime() const
const char * findChar(int c) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setGroup(const UT_StringHolder &val)
Surftype getSurftype() const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setImperfect(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_Vector2D getAngle() const
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void save(std::ostream &os) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Surftype enum_value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept