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;
181 graph->
evalOpParm(myMode, nodeidx,
"mode", time, 0);
182 myRestAttribName =
"rest"_UTsh;
184 graph->
evalOpParm(myRestAttribName, nodeidx,
"restattribname", time, 0);
186 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==1))||((
int64(getMode())!=0)))) ) )
187 graph->
evalOpParm(myFile, nodeidx,
"file", time, 0);
190 graph->
evalOpParm(myNml, nodeidx,
"nml", time, 0);
191 myNormalsAttribName =
"rnml"_UTsh;
192 if (
true && ( (
true&&!(((
int64(getNml())==0)))) ) )
193 graph->
evalOpParm(myNormalsAttribName, nodeidx,
"normalattribname", time, 0);
196 graph->
evalOpParm(myXform, nodeidx,
"xform", time, 0);
197 myXformAttribName =
"restxform"_UTsh;
198 if (
true && ( (
true&&!(((
int64(getXform())==0)))) ) )
199 graph->
evalOpParm(myXformAttribName, nodeidx,
"xformattribname", time, 0);
202 graph->
evalOpParm(myQuadric, nodeidx,
"quadric", time, 0);
203 myQuadricAttribName =
"Pref"_UTsh;
204 if (
true && ( (
true&&!(((
int64(getQuadric())==0)))) ) )
205 graph->
evalOpParm(myQuadricAttribName, nodeidx,
"quadricattribname", time, 0);
208 graph->
evalOpParm(myPrecision, nodeidx,
"precision", time, 0);
224 template <
typename T>
231 if (idx.
size() != instance.
size()+1)
236 coerceValue(value, myMode);
239 coerceValue(value, myRestAttribName);
242 coerceValue(value, myFile);
245 coerceValue(value, myNml);
248 coerceValue(value, myNormalsAttribName);
251 coerceValue(value, myXform);
254 coerceValue(value, myXformAttribName);
257 coerceValue(value, myQuadric);
260 coerceValue(value, myQuadricAttribName);
263 coerceValue(value, myPrecision);
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 { doGetParmValue(idx, instance, value); }
301 template <
typename T>
308 if (idx.
size() != instance.
size()+1)
313 coerceValue(myMode, clampMinValue(0, clampMaxValue(2, value ) ));
316 coerceValue(myRestAttribName, ( ( value ) ));
319 coerceValue(myFile, ( ( value ) ));
322 coerceValue(myNml, clampMinValue(0, clampMaxValue(2, value ) ));
325 coerceValue(myNormalsAttribName, ( ( value ) ));
328 coerceValue(myXform, clampMinValue(0, clampMaxValue(2, value ) ));
331 coerceValue(myXformAttribName, ( ( value ) ));
334 coerceValue(myQuadric, clampMinValue(0, clampMaxValue(2, value ) ));
337 coerceValue(myQuadricAttribName, ( ( value ) ));
340 coerceValue(myPrecision, clampMinValue(0, clampMaxValue(2, value ) ));
347 { doSetParmValue(idx, instance, value); }
349 { doSetParmValue(idx, instance, value); }
351 { doSetParmValue(idx, instance, value); }
353 { doSetParmValue(idx, instance, value); }
355 { doSetParmValue(idx, instance, value); }
357 { doSetParmValue(idx, instance, value); }
359 { doSetParmValue(idx, instance, value); }
361 { doSetParmValue(idx, instance, value); }
363 { doSetParmValue(idx, instance, value); }
365 { doSetParmValue(idx, instance, value); }
367 { doSetParmValue(idx, instance, value); }
383 if (fieldnum.
size() < 1)
390 return "restattribname";
396 return "normalattribname";
400 return "xformattribname";
404 return "quadricattribname";
414 if (fieldnum.
size() < 1)
415 return PARM_UNSUPPORTED;
440 return PARM_UNSUPPORTED;
476 loadData(is, rampdata);
494 int typelen = colon - data.
buffer();
508 {
int64 iv =
v; UTwrite(os, &iv); }
510 { UTwrite<fpreal64>(os, &
v); }
512 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
514 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
515 UTwrite<fpreal64>(os, &v.
z()); }
517 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
518 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
530 if (s) s->save(ostr);
532 saveData(os, result);
539 ostr << s->getDataTypeToken();
544 saveData(os, result);
548 void save(std::ostream &os)
const
552 saveData(os, myMode);
553 saveData(os, myRestAttribName);
554 saveData(os, myFile);
556 saveData(os, myNormalsAttribName);
557 saveData(os, myXform);
558 saveData(os, myXformAttribName);
559 saveData(os, myQuadric);
560 saveData(os, myQuadricAttribName);
561 saveData(os, myPrecision);
574 loadData(is, myMode);
575 loadData(is, myRestAttribName);
576 loadData(is, myFile);
578 loadData(is, myNormalsAttribName);
579 loadData(is, myXform);
580 loadData(is, myXformAttribName);
581 loadData(is, myQuadric);
582 loadData(is, myQuadricAttribName);
583 loadData(is, myPrecision);
593 if (!thissop)
return getMode();
595 OP_Utils::evalOpParm(result, thissop,
"mode", cookparms.
getCookTime(), 0);
603 if (!thissop)
return getRestAttribName();
605 OP_Utils::evalOpParm(result, thissop,
"restattribname", cookparms.
getCookTime(), 0);
613 if (!thissop)
return getFile();
615 OP_Utils::evalOpParm(result, thissop,
"file", cookparms.
getCookTime(), 0);
623 if (!thissop)
return getNml();
625 OP_Utils::evalOpParm(result, thissop,
"nml", cookparms.
getCookTime(), 0);
633 if (!thissop)
return getNormalsAttribName();
635 OP_Utils::evalOpParm(result, thissop,
"normalattribname", cookparms.
getCookTime(), 0);
643 if (!thissop)
return getXform();
645 OP_Utils::evalOpParm(result, thissop,
"xform", cookparms.
getCookTime(), 0);
646 return Xform(result);
653 if (!thissop)
return getXformAttribName();
655 OP_Utils::evalOpParm(result, thissop,
"xformattribname", cookparms.
getCookTime(), 0);
663 if (!thissop)
return getQuadric();
665 OP_Utils::evalOpParm(result, thissop,
"quadric", cookparms.
getCookTime(), 0);
673 if (!thissop)
return getQuadricAttribName();
675 OP_Utils::evalOpParm(result, thissop,
"quadricattribname", cookparms.
getCookTime(), 0);
683 if (!thissop)
return getPrecision();
685 OP_Utils::evalOpParm(result, thissop,
"precision", cookparms.
getCookTime(), 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
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)
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
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)
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
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
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)