23 namespace SOP_RestEnums
35 using namespace UT::Literal;
54 using namespace UT::Literal;
73 using namespace UT::Literal;
92 using namespace UT::Literal;
111 using namespace UT::Literal;
112 switch (enum_value) {
131 myRestAttribName =
"rest"_UTsh;
134 myNormalsAttribName =
"rnml"_UTsh;
136 myXformAttribName =
"restxform"_UTsh;
138 myQuadricAttribName =
"Pref"_UTsh;
152 if (myMode != src.myMode)
return false;
153 if (myRestAttribName != src.myRestAttribName)
return false;
154 if (myFile != src.myFile)
return false;
155 if (myNml != src.myNml)
return false;
156 if (myNormalsAttribName != src.myNormalsAttribName)
return false;
157 if (myXform != src.myXform)
return false;
158 if (myXformAttribName != src.myXformAttribName)
return false;
159 if (myQuadric != src.myQuadric)
return false;
160 if (myQuadricAttribName != src.myQuadricAttribName)
return false;
161 if (myPrecision != src.myPrecision)
return false;
185 myRestAttribName =
"rest"_UTsh;
187 graph->
evalOpParm(myRestAttribName, nodeidx,
"restattribname", time, graph->
isDirect()?
nullptr:depnode);
189 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==1))||((
int64(getMode())!=0)))) ) )
194 myNormalsAttribName =
"rnml"_UTsh;
195 if (
true && ( (
true&&!(((
int64(getNml())==0)))) ) )
196 graph->
evalOpParm(myNormalsAttribName, nodeidx,
"normalattribname", time, graph->
isDirect()?
nullptr:depnode);
199 graph->
evalOpParm(myXform, nodeidx,
"xform", time, graph->
isDirect()?
nullptr:depnode);
200 myXformAttribName =
"restxform"_UTsh;
201 if (
true && ( (
true&&!(((
int64(getXform())==0)))) ) )
202 graph->
evalOpParm(myXformAttribName, nodeidx,
"xformattribname", time, graph->
isDirect()?
nullptr:depnode);
205 graph->
evalOpParm(myQuadric, nodeidx,
"quadric", time, graph->
isDirect()?
nullptr:depnode);
206 myQuadricAttribName =
"Pref"_UTsh;
207 if (
true && ( (
true&&!(((
int64(getQuadric())==0)))) ) )
208 graph->
evalOpParm(myQuadricAttribName, nodeidx,
"quadricattribname", time, graph->
isDirect()?
nullptr:depnode);
211 graph->
evalOpParm(myPrecision, nodeidx,
"precision", time, graph->
isDirect()?
nullptr:depnode);
227 template <
typename T>
234 if (idx.
size() != instance.
size()+1)
239 coerceValue(value, myMode);
242 coerceValue(value, myRestAttribName);
245 coerceValue(value, myFile);
248 coerceValue(value, myNml);
251 coerceValue(value, myNormalsAttribName);
254 coerceValue(value, myXform);
257 coerceValue(value, myXformAttribName);
260 coerceValue(value, myQuadric);
263 coerceValue(value, myQuadricAttribName);
266 coerceValue(value, myPrecision);
282 { doGetParmValue(idx, instance, value); }
284 { doGetParmValue(idx, instance, value); }
286 { doGetParmValue(idx, instance, value); }
288 { doGetParmValue(idx, instance, value); }
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 { doGetParmValue(idx, instance, value); }
298 { doGetParmValue(idx, instance, value); }
300 { doGetParmValue(idx, instance, value); }
302 { doGetParmValue(idx, instance, value); }
304 template <
typename T>
311 if (idx.
size() != instance.
size()+1)
316 coerceValue(myMode, clampMinValue(0, clampMaxValue(2, value ) ));
319 coerceValue(myRestAttribName, ( ( value ) ));
322 coerceValue(myFile, ( ( value ) ));
325 coerceValue(myNml, clampMinValue(0, clampMaxValue(2, value ) ));
328 coerceValue(myNormalsAttribName, ( ( value ) ));
331 coerceValue(myXform, clampMinValue(0, clampMaxValue(2, value ) ));
334 coerceValue(myXformAttribName, ( ( value ) ));
337 coerceValue(myQuadric, clampMinValue(0, clampMaxValue(2, value ) ));
340 coerceValue(myQuadricAttribName, ( ( value ) ));
343 coerceValue(myPrecision, clampMinValue(0, clampMaxValue(2, value ) ));
350 { doSetParmValue(idx, instance, value); }
352 { doSetParmValue(idx, instance, value); }
354 { doSetParmValue(idx, instance, value); }
356 { doSetParmValue(idx, instance, value); }
358 { doSetParmValue(idx, instance, value); }
360 { doSetParmValue(idx, instance, value); }
362 { doSetParmValue(idx, instance, value); }
364 { doSetParmValue(idx, instance, value); }
366 { doSetParmValue(idx, instance, value); }
368 { doSetParmValue(idx, instance, value); }
370 { doSetParmValue(idx, instance, value); }
386 if (fieldnum.
size() < 1)
393 return "restattribname";
399 return "normalattribname";
403 return "xformattribname";
407 return "quadricattribname";
417 if (fieldnum.
size() < 1)
418 return PARM_UNSUPPORTED;
443 return PARM_UNSUPPORTED;
479 loadData(is, rampdata);
497 int typelen = colon - data.
buffer();
511 {
int64 iv =
v; UTwrite(os, &iv); }
513 { UTwrite<fpreal64>(os, &
v); }
515 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
517 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
518 UTwrite<fpreal64>(os, &v.
z()); }
520 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
521 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
533 if (s) s->save(ostr);
535 saveData(os, result);
542 ostr << s->getDataTypeToken();
547 saveData(os, result);
551 void save(std::ostream &os)
const
555 saveData(os, myMode);
556 saveData(os, myRestAttribName);
557 saveData(os, myFile);
559 saveData(os, myNormalsAttribName);
560 saveData(os, myXform);
561 saveData(os, myXformAttribName);
562 saveData(os, myQuadric);
563 saveData(os, myQuadricAttribName);
564 saveData(os, myPrecision);
577 loadData(is, myMode);
578 loadData(is, myRestAttribName);
579 loadData(is, myFile);
581 loadData(is, myNormalsAttribName);
582 loadData(is, myXform);
583 loadData(is, myXformAttribName);
584 loadData(is, myQuadric);
585 loadData(is, myQuadricAttribName);
586 loadData(is, myPrecision);
596 if (!thissop)
return getMode();
598 OP_Utils::evalOpParm(result, thissop,
"mode", cookparms.
getCookTime(), 0);
606 if (!thissop)
return getRestAttribName();
608 OP_Utils::evalOpParm(result, thissop,
"restattribname", cookparms.
getCookTime(), 0);
616 if (!thissop)
return getFile();
618 OP_Utils::evalOpParm(result, thissop,
"file", cookparms.
getCookTime(), 0);
626 if (!thissop)
return getNml();
628 OP_Utils::evalOpParm(result, thissop,
"nml", cookparms.
getCookTime(), 0);
636 if (!thissop)
return getNormalsAttribName();
638 OP_Utils::evalOpParm(result, thissop,
"normalattribname", cookparms.
getCookTime(), 0);
646 if (!thissop)
return getXform();
648 OP_Utils::evalOpParm(result, thissop,
"xform", cookparms.
getCookTime(), 0);
649 return Xform(result);
656 if (!thissop)
return getXformAttribName();
658 OP_Utils::evalOpParm(result, thissop,
"xformattribname", cookparms.
getCookTime(), 0);
666 if (!thissop)
return getQuadric();
668 OP_Utils::evalOpParm(result, thissop,
"quadric", cookparms.
getCookTime(), 0);
676 if (!thissop)
return getQuadricAttribName();
678 OP_Utils::evalOpParm(result, thissop,
"quadricattribname", cookparms.
getCookTime(), 0);
686 if (!thissop)
return getPrecision();
688 OP_Utils::evalOpParm(result, thissop,
"precision", cookparms.
getCookTime(), 0);
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
void setRestAttribName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Quadric getQuadric() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SOP_Node * getNode() const
UT_StringHolder opQuadricAttribName(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getXformAttribName() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opRestAttribName(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
const OP_Context & context() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getNormalsAttribName() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const 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, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Quadric opQuadric(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
const UT_StringHolder & getFile() const
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setPrecision(Precision val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool isParmColorRamp(exint idx) const override
bool operator==(const SOP_RestParms &src) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) 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
static void loadData(UT_IStream &is, UT_Vector4D &v)
const OP_GraphProxy * graph() const
UT_StringHolder opFile(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Precision opPrecision(const SOP_NodeVerb::CookParms &cookparms) const
Nml opNml(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
const UT_StringHolder & getRestAttribName() const
GT_API const UT_StringHolder version
SYS_FORCE_INLINE UT_StringHolder getToken(Mode enum_value)
void setNormalsAttribName(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, int64 &v)
bool operator!=(const SOP_RestParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
void copyFrom(const OP_NodeParms *src) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void saveData(std::ostream &os, UT_Vector4D v)
void setQuadricAttribName(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & w() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
virtual UT_StringHolder baseGetSignature() const
static void saveData(std::ostream &os, UT_Vector3D v)
exint getNestNumParms(TempIndex idx) const override
const UT_StringHolder & getQuadricAttribName() const
fpreal getCookTime() const
void setFile(const UT_StringHolder &val)
void setXformAttribName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, fpreal64 v)
const char * findChar(int c) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
Xform opXform(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setQuadric(Quadric val)
Precision getPrecision() const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_StringHolder opXformAttribName(const SOP_NodeVerb::CookParms &cookparms) const
void save(std::ostream &os) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, bool v)
Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
ParmType getNestParmType(TempIndex fieldnum) const override
UT_StringHolder opNormalsAttribName(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)