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;
134 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
137 graph->
evalOpParm(mySurftype, nodeidx,
"surftype", time, graph->
isDirect()?
nullptr:depnode);
140 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, graph->
isDirect()?
nullptr:depnode);
146 graph->
evalOpParm(myPolys, nodeidx,
"polys", time, graph->
isDirect()?
nullptr:depnode);
149 graph->
evalOpParm(myImperfect, nodeidx,
"imperfect", time, graph->
isDirect()?
nullptr:depnode);
155 graph->
evalOpParm(myAngle, nodeidx,
"angle", time, graph->
isDirect()?
nullptr:depnode);
180 template <
typename T>
187 if (idx.
size() != instance.
size()+1)
192 coerceValue(value, myGroup);
195 coerceValue(value, mySurftype);
198 coerceValue(value, myOrigin);
201 coerceValue(value, myDir);
204 coerceValue(value, myPolys);
207 coerceValue(value, myImperfect);
210 coerceValue(value, myType);
213 coerceValue(value, myAngle);
216 coerceValue(value, myDivs);
222 coerceValue(value, myCap);
238 { doGetParmValue(idx, instance, value); }
240 { doGetParmValue(idx, instance, value); }
242 { doGetParmValue(idx, instance, value); }
244 { doGetParmValue(idx, instance, value); }
246 { doGetParmValue(idx, instance, value); }
248 { doGetParmValue(idx, instance, value); }
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 { doGetParmValue(idx, instance, value); }
256 { doGetParmValue(idx, instance, value); }
258 { doGetParmValue(idx, instance, value); }
260 template <
typename T>
267 if (idx.
size() != instance.
size()+1)
272 coerceValue(myGroup, ( ( value ) ));
275 coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
278 coerceValue(myOrigin, ( ( value ) ));
281 coerceValue(myDir, ( ( value ) ));
284 coerceValue(myPolys, ( ( value ) ));
287 coerceValue(myImperfect, ( ( value ) ));
290 coerceValue(myType, clampMinValue(0, clampMaxValue(2, value ) ));
293 coerceValue(myAngle, ( ( value ) ));
296 coerceValue(myDivs, clampMinValue(1, ( value ) ));
299 coerceValue(
myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
302 coerceValue(myCap, ( ( value ) ));
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
345 if (fieldnum.
size() < 1)
378 if (fieldnum.
size() < 1)
379 return PARM_UNSUPPORTED;
406 return PARM_UNSUPPORTED;
442 loadData(is, rampdata);
460 int typelen = colon - data.
buffer();
474 {
int64 iv =
v; UTwrite(os, &iv); }
476 { UTwrite<fpreal64>(os, &
v); }
478 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
480 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
481 UTwrite<fpreal64>(os, &v.
z()); }
483 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
484 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
496 if (s) s->save(ostr);
498 saveData(os, result);
505 ostr << s->getDataTypeToken();
510 saveData(os, result);
514 void save(std::ostream &os)
const
518 saveData(os, myGroup);
519 saveData(os, mySurftype);
520 saveData(os, myOrigin);
522 saveData(os, myPolys);
523 saveData(os, myImperfect);
524 saveData(os, myType);
525 saveData(os, myAngle);
526 saveData(os, myDivs);
541 loadData(is, myGroup);
542 loadData(is, mySurftype);
543 loadData(is, myOrigin);
545 loadData(is, myPolys);
546 loadData(is, myImperfect);
547 loadData(is, myType);
548 loadData(is, myAngle);
549 loadData(is, myDivs);
561 if (!thissop)
return getGroup();
563 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
571 if (!thissop)
return getSurftype();
573 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
581 if (!thissop)
return getOrigin();
583 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
591 if (!thissop)
return getDir();
593 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
601 if (!thissop)
return getPolys();
603 OP_Utils::evalOpParm(result, thissop,
"polys", cookparms.
getCookTime(), 0);
611 if (!thissop)
return getImperfect();
613 OP_Utils::evalOpParm(result, thissop,
"imperfect", cookparms.
getCookTime(), 0);
621 if (!thissop)
return getType();
623 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
631 if (!thissop)
return getAngle();
633 OP_Utils::evalOpParm(result, thissop,
"angle", cookparms.
getCookTime(), 0);
641 if (!thissop)
return getDivs();
643 OP_Utils::evalOpParm(result, thissop,
"divs", cookparms.
getCookTime(), 0);
651 if (!thissop)
return getOrder();
653 OP_Utils::evalOpParm(result, thissop,
"order", cookparms.
getCookTime(), 0);
661 if (!thissop)
return getCap();
663 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
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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