23 namespace SOP_BoxEnums
39 using namespace UT::Literal;
66 using namespace UT::Literal;
91 myConsolidatePoints =
true;
101 myOrientedBoundingBox =
false;
102 myVertexNormals =
false;
115 if (myType != src.myType)
return false;
116 if (mySurfType != src.mySurfType)
return false;
117 if (myConsolidatePoints != src.myConsolidatePoints)
return false;
118 if (mySize != src.mySize)
return false;
119 if (myCenter != src.myCenter)
return false;
120 if (myRotate != src.myRotate)
return false;
121 if (myScale != src.myScale)
return false;
122 if (myDivRate != src.myDivRate)
return false;
123 if (
myOrder != src.myOrder)
return false;
124 if (myDoDivs != src.myDoDivs)
return false;
125 if (myDivs != src.myDivs)
return false;
126 if (myRebar != src.myRebar)
return false;
127 if (myOrientedBoundingBox != src.myOrientedBoundingBox)
return false;
128 if (myVertexNormals != src.myVertexNormals)
return false;
145 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
148 graph->
evalOpParm(mySurfType, nodeidx,
"surftype", time, 0);
149 myConsolidatePoints =
true;
151 graph->
evalOpParm(myConsolidatePoints, nodeidx,
"consolidatepts", time, 0);
154 graph->
evalOpParm(mySize, nodeidx,
"size", time, 0);
157 graph->
evalOpParm(myCenter, nodeidx,
"t", time, 0);
160 graph->
evalOpParm(myRotate, nodeidx,
"r", time, 0);
163 graph->
evalOpParm(myScale, nodeidx,
"scale", time, 0);
166 graph->
evalOpParm(myDivRate, nodeidx,
"divrate", time, 0);
172 graph->
evalOpParm(myDoDivs, nodeidx,
"dodivs", time, 0);
175 graph->
evalOpParm(myDivs, nodeidx,
"divs", time, 0);
178 graph->
evalOpParm(myRebar, nodeidx,
"rebar", time, 0);
179 myOrientedBoundingBox =
false;
181 graph->
evalOpParm(myOrientedBoundingBox, nodeidx,
"orientedbbox", time, 0);
182 myVertexNormals =
false;
184 graph->
evalOpParm(myVertexNormals, nodeidx,
"vertexnormals", time, 0);
200 template <
typename T>
207 if (idx.
size() != instance.
size()+1)
212 coerceValue(value, myType);
215 coerceValue(value, mySurfType);
218 coerceValue(value, myConsolidatePoints);
221 coerceValue(value, mySize);
224 coerceValue(value, myCenter);
227 coerceValue(value, myRotate);
230 coerceValue(value, myScale);
233 coerceValue(value, myDivRate);
239 coerceValue(value, myDoDivs);
242 coerceValue(value, myDivs);
245 coerceValue(value, myRebar);
248 coerceValue(value, myOrientedBoundingBox);
251 coerceValue(value, myVertexNormals);
267 { doGetParmValue(idx, instance, value); }
269 { doGetParmValue(idx, instance, value); }
271 { doGetParmValue(idx, instance, value); }
273 { doGetParmValue(idx, instance, value); }
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
296 if (idx.
size() != instance.
size()+1)
301 coerceValue(myType, clampMinValue(0, clampMaxValue(6, value ) ));
304 coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
307 coerceValue(myConsolidatePoints, ( ( value ) ));
310 coerceValue(mySize, ( ( value ) ));
313 coerceValue(myCenter, ( ( value ) ));
316 coerceValue(myRotate, ( ( value ) ));
319 coerceValue(myScale, ( ( value ) ));
322 coerceValue(myDivRate, clampMinValue(1, ( value ) ));
325 coerceValue(
myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
328 coerceValue(myDoDivs, ( ( value ) ));
331 coerceValue(myDivs, clampMinValue(1, ( value ) ));
334 coerceValue(myRebar, ( ( value ) ));
337 coerceValue(myOrientedBoundingBox, ( ( value ) ));
340 coerceValue(myVertexNormals, ( ( 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)
392 return "consolidatepts";
412 return "orientedbbox";
414 return "vertexnormals";
422 if (fieldnum.
size() < 1)
423 return PARM_UNSUPPORTED;
456 return PARM_UNSUPPORTED;
492 loadData(is, rampdata);
510 int typelen = colon - data.
buffer();
524 {
int64 iv =
v; UTwrite(os, &iv); }
526 { UTwrite<fpreal64>(os, &
v); }
528 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
530 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
531 UTwrite<fpreal64>(os, &v.
z()); }
533 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
534 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
546 if (s) s->save(ostr);
548 saveData(os, result);
555 ostr << s->getDataTypeToken();
560 saveData(os, result);
564 void save(std::ostream &os)
const
568 saveData(os, myType);
569 saveData(os, mySurfType);
570 saveData(os, myConsolidatePoints);
571 saveData(os, mySize);
572 saveData(os, myCenter);
573 saveData(os, myRotate);
574 saveData(os, myScale);
575 saveData(os, myDivRate);
577 saveData(os, myDoDivs);
578 saveData(os, myDivs);
579 saveData(os, myRebar);
580 saveData(os, myOrientedBoundingBox);
581 saveData(os, myVertexNormals);
594 loadData(is, myType);
595 loadData(is, mySurfType);
596 loadData(is, myConsolidatePoints);
597 loadData(is, mySize);
598 loadData(is, myCenter);
599 loadData(is, myRotate);
600 loadData(is, myScale);
601 loadData(is, myDivRate);
603 loadData(is, myDoDivs);
604 loadData(is, myDivs);
605 loadData(is, myRebar);
606 loadData(is, myOrientedBoundingBox);
607 loadData(is, myVertexNormals);
617 if (!thissop)
return getType();
619 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
627 if (!thissop)
return getSurfType();
629 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getConsolidatePoints();
639 OP_Utils::evalOpParm(result, thissop,
"consolidatepts", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getSize();
649 OP_Utils::evalOpParm(result, thissop,
"size", cookparms.
getCookTime(), 0);
657 if (!thissop)
return getCenter();
659 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
667 if (!thissop)
return getRotate();
669 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
679 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
687 if (!thissop)
return getDivRate();
689 OP_Utils::evalOpParm(result, thissop,
"divrate", cookparms.
getCookTime(), 0);
697 if (!thissop)
return getOrder();
699 OP_Utils::evalOpParm(result, thissop,
"orderrate", cookparms.
getCookTime(), 0);
707 if (!thissop)
return getDoDivs();
709 OP_Utils::evalOpParm(result, thissop,
"dodivs", cookparms.
getCookTime(), 0);
717 if (!thissop)
return getDivs();
719 OP_Utils::evalOpParm(result, thissop,
"divs", cookparms.
getCookTime(), 0);
727 if (!thissop)
return getRebar();
729 OP_Utils::evalOpParm(result, thissop,
"rebar", cookparms.
getCookTime(), 0);
737 if (!thissop)
return getOrientedBoundingBox();
739 OP_Utils::evalOpParm(result, thissop,
"orientedbbox", cookparms.
getCookTime(), 0);
747 if (!thissop)
return getVertexNormals();
749 OP_Utils::evalOpParm(result, thissop,
"vertexnormals", cookparms.
getCookTime(), 0);
756 bool myConsolidatePoints;
766 bool myOrientedBoundingBox;
767 bool myVertexNormals;
SurfType opSurfType(const SOP_NodeVerb::CookParms &cookparms) const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, UT_StringHolder s)
void setCenter(UT_Vector3D val)
bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
bool opVertexNormals(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I getDivRate() const
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_Vector3D getSize() const
exint getNestNumParms(TempIndex idx) const override
void save(std::ostream &os) const
fpreal64 getScale() const
bool getOrientedBoundingBox() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
bool operator==(const SOP_BoxParms &src) const
UT_Vector3D opRotate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool operator!=(const SOP_BoxParms &src) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
UT_Vector3D getCenter() const
void setSurfType(SurfType val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
**But if you need a result
UT_Vector3T< int64 > UT_Vector3I
static void loadData(UT_IStream &is, UT_Vector2I &v)
SurfType getSurfType() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector2D &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 saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void copyFrom(const OP_NodeParms *src) override
void setSize(UT_Vector3D val)
static void loadData(UT_IStream &is, int64 &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool load(UT_IStream &is)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, fpreal64 v)
bool getVertexNormals() const
bool getConsolidatePoints() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_Vector3T< fpreal64 > UT_Vector3D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opSize(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setScale(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setVertexNormals(bool val)
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opOrientedBoundingBox(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setConsolidatePoints(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool opConsolidatePoints(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getRotate() const
void setOrientedBoundingBox(bool val)
UT_Vector3D opCenter(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
DEP_MicroNode * depnode() const
static void loadData(UT_IStream &is, fpreal64 &v)
LeafData & operator=(const LeafData &)=delete
static void saveData(std::ostream &os, UT_Matrix2D v)
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
void setDivRate(UT_Vector3I val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_Vector3I getOrder() const
void setOrder(UT_Vector3I val)
fpreal getCookTime() const
void setDivs(UT_Vector3I val)
bool isParmColorRamp(exint idx) const override
const char * findChar(int c) const
UT_Vector3I getDivs() const
bool opDoDivs(const SOP_NodeVerb::CookParms &cookparms) const
void setRotate(UT_Vector3D val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_Vector3I opDivRate(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I opDivs(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_Vector3I opOrder(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)