23 namespace SOP_FacetEnums
35 using namespace UT::Literal;
56 using namespace UT::Literal;
87 myOrientpolys =
false;
106 if (myGroup != src.myGroup)
return false;
107 if (myGroupType != src.myGroupType)
return false;
108 if (myPrenml != src.myPrenml)
return false;
109 if (myUnit != src.myUnit)
return false;
110 if (myUnique != src.myUnique)
return false;
111 if (myCons != src.myCons)
return false;
112 if (myDist != src.myDist)
return false;
113 if (myAccurate != src.myAccurate)
return false;
114 if (myInline != src.myInline)
return false;
115 if (myInlinedist != src.myInlinedist)
return false;
116 if (myOrientpolys != src.myOrientpolys)
return false;
117 if (myCusp != src.myCusp)
return false;
118 if (myAngle != src.myAngle)
return false;
119 if (myRemove != src.myRemove)
return false;
120 if (myMkplanar != src.myMkplanar)
return false;
121 if (myPostnml != src.myPostnml)
return false;
122 if (myReversenml != src.myReversenml)
return false;
142 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
145 graph->
evalOpParm(myGroupType, nodeidx,
"grouptype", time, graph->
isDirect()?
nullptr:depnode);
148 graph->
evalOpParm(myPrenml, nodeidx,
"prenml", time, graph->
isDirect()?
nullptr:depnode);
150 if (
true && ( (
true&&!(((getPrenml()==1)))) ) )
154 graph->
evalOpParm(myUnique, nodeidx,
"unique", time, graph->
isDirect()?
nullptr:depnode);
159 if (
true && ( (
true&&!(((
int64(getCons())==0)))) ) )
162 if (
true && ( (
true&&!(((
int64(getCons())==0)))) ) )
163 graph->
evalOpParm(myAccurate, nodeidx,
"accurate", time, graph->
isDirect()?
nullptr:depnode);
166 graph->
evalOpParm(myInline, nodeidx,
"inline", time, graph->
isDirect()?
nullptr:depnode);
167 myInlinedist = 0.001;
168 if (
true && ( (
true&&!(((getInline()==0)))) ) )
169 graph->
evalOpParm(myInlinedist, nodeidx,
"inlinedist", time, graph->
isDirect()?
nullptr:depnode);
170 myOrientpolys =
false;
172 graph->
evalOpParm(myOrientpolys, nodeidx,
"orientPolys", time, graph->
isDirect()?
nullptr:depnode);
177 if (
true && ( (
true&&!(((getCusp()==0)))) ) )
178 graph->
evalOpParm(myAngle, nodeidx,
"angle", time, graph->
isDirect()?
nullptr:depnode);
181 graph->
evalOpParm(myRemove, nodeidx,
"remove", time, graph->
isDirect()?
nullptr:depnode);
184 graph->
evalOpParm(myMkplanar, nodeidx,
"mkplanar", time, graph->
isDirect()?
nullptr:depnode);
187 graph->
evalOpParm(myPostnml, nodeidx,
"postnml", time, graph->
isDirect()?
nullptr:depnode);
188 myReversenml =
false;
190 graph->
evalOpParm(myReversenml, nodeidx,
"reversenml", time, graph->
isDirect()?
nullptr:depnode);
206 template <
typename T>
213 if (idx.
size() != instance.
size()+1)
218 coerceValue(value, myGroup);
221 coerceValue(value, myGroupType);
224 coerceValue(value, myPrenml);
227 coerceValue(value, myUnit);
230 coerceValue(value, myUnique);
233 coerceValue(value, myCons);
236 coerceValue(value, myDist);
239 coerceValue(value, myAccurate);
242 coerceValue(value, myInline);
245 coerceValue(value, myInlinedist);
248 coerceValue(value, myOrientpolys);
251 coerceValue(value, myCusp);
254 coerceValue(value, myAngle);
257 coerceValue(value, myRemove);
260 coerceValue(value, myMkplanar);
263 coerceValue(value, myPostnml);
266 coerceValue(value, myReversenml);
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(myGroup, ( ( value ) ));
319 coerceValue(myGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
322 coerceValue(myPrenml, ( ( value ) ));
325 coerceValue(myUnit, ( ( value ) ));
328 coerceValue(myUnique, ( ( value ) ));
331 coerceValue(myCons, clampMinValue(0, clampMaxValue(4, value ) ));
334 coerceValue(myDist, ( ( value ) ));
337 coerceValue(myAccurate, ( ( value ) ));
340 coerceValue(myInline, ( ( value ) ));
343 coerceValue(myInlinedist, ( ( value ) ));
346 coerceValue(myOrientpolys, ( ( value ) ));
349 coerceValue(myCusp, ( ( value ) ));
352 coerceValue(myAngle, ( ( value ) ));
355 coerceValue(myRemove, ( ( value ) ));
358 coerceValue(myMkplanar, ( ( value ) ));
361 coerceValue(myPostnml, ( ( value ) ));
364 coerceValue(myReversenml, ( ( value ) ));
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, value); }
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
383 { doSetParmValue(idx, instance, value); }
385 { doSetParmValue(idx, instance, value); }
387 { doSetParmValue(idx, instance, value); }
389 { doSetParmValue(idx, instance, value); }
391 { doSetParmValue(idx, instance, value); }
407 if (fieldnum.
size() < 1)
432 return "orientPolys";
452 if (fieldnum.
size() < 1)
453 return PARM_UNSUPPORTED;
492 return PARM_UNSUPPORTED;
528 loadData(is, rampdata);
546 int typelen = colon - data.
buffer();
560 {
int64 iv =
v; UTwrite(os, &iv); }
562 { UTwrite<fpreal64>(os, &
v); }
564 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
566 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
567 UTwrite<fpreal64>(os, &v.
z()); }
569 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
570 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
582 if (s) s->save(ostr);
584 saveData(os, result);
591 ostr << s->getDataTypeToken();
596 saveData(os, result);
600 void save(std::ostream &os)
const
604 saveData(os, myGroup);
605 saveData(os, myGroupType);
606 saveData(os, myPrenml);
607 saveData(os, myUnit);
608 saveData(os, myUnique);
609 saveData(os, myCons);
610 saveData(os, myDist);
611 saveData(os, myAccurate);
612 saveData(os, myInline);
613 saveData(os, myInlinedist);
614 saveData(os, myOrientpolys);
615 saveData(os, myCusp);
616 saveData(os, myAngle);
617 saveData(os, myRemove);
618 saveData(os, myMkplanar);
619 saveData(os, myPostnml);
620 saveData(os, myReversenml);
633 loadData(is, myGroup);
634 loadData(is, myGroupType);
635 loadData(is, myPrenml);
636 loadData(is, myUnit);
637 loadData(is, myUnique);
638 loadData(is, myCons);
639 loadData(is, myDist);
640 loadData(is, myAccurate);
641 loadData(is, myInline);
642 loadData(is, myInlinedist);
643 loadData(is, myOrientpolys);
644 loadData(is, myCusp);
645 loadData(is, myAngle);
646 loadData(is, myRemove);
647 loadData(is, myMkplanar);
648 loadData(is, myPostnml);
649 loadData(is, myReversenml);
659 if (!thissop)
return getGroup();
661 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
669 if (!thissop)
return getGroupType();
671 OP_Utils::evalOpParm(result, thissop,
"grouptype", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getPrenml();
681 OP_Utils::evalOpParm(result, thissop,
"prenml", cookparms.
getCookTime(), 0);
689 if (!thissop)
return getUnit();
691 OP_Utils::evalOpParm(result, thissop,
"unit", cookparms.
getCookTime(), 0);
699 if (!thissop)
return getUnique();
701 OP_Utils::evalOpParm(result, thissop,
"unique", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getCons();
711 OP_Utils::evalOpParm(result, thissop,
"cons", cookparms.
getCookTime(), 0);
719 if (!thissop)
return getDist();
721 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
729 if (!thissop)
return getAccurate();
731 OP_Utils::evalOpParm(result, thissop,
"accurate", cookparms.
getCookTime(), 0);
739 if (!thissop)
return getInline();
741 OP_Utils::evalOpParm(result, thissop,
"inline", cookparms.
getCookTime(), 0);
749 if (!thissop)
return getInlinedist();
751 OP_Utils::evalOpParm(result, thissop,
"inlinedist", cookparms.
getCookTime(), 0);
759 if (!thissop)
return getOrientpolys();
761 OP_Utils::evalOpParm(result, thissop,
"orientPolys", cookparms.
getCookTime(), 0);
769 if (!thissop)
return getCusp();
771 OP_Utils::evalOpParm(result, thissop,
"cusp", cookparms.
getCookTime(), 0);
779 if (!thissop)
return getAngle();
781 OP_Utils::evalOpParm(result, thissop,
"angle", cookparms.
getCookTime(), 0);
789 if (!thissop)
return getRemove();
791 OP_Utils::evalOpParm(result, thissop,
"remove", cookparms.
getCookTime(), 0);
799 if (!thissop)
return getMkplanar();
801 OP_Utils::evalOpParm(result, thissop,
"mkplanar", cookparms.
getCookTime(), 0);
809 if (!thissop)
return getPostnml();
811 OP_Utils::evalOpParm(result, thissop,
"postnml", cookparms.
getCookTime(), 0);
819 if (!thissop)
return getReversenml();
821 OP_Utils::evalOpParm(result, thissop,
"reversenml", cookparms.
getCookTime(), 0);
void save(std::ostream &os) const
bool opAccurate(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
GroupType getGroupType() const
SOP_Node * getNode() const
bool opReversenml(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, int64 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
GLsizei const GLfloat * value
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setInlinedist(fpreal64 val)
static void saveData(std::ostream &os, UT_StringHolder s)
void setMkplanar(bool val)
bool opUnique(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
GroupType opGroupType(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, fpreal64 &v)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
**But if you need a result
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool getReversenml() const
void setGroupType(GroupType val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opUnit(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const SOP_FacetParms &src) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setAngle(fpreal64 val)
bool isParmColorRamp(exint idx) const override
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_Matrix4D &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opMkplanar(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const OP_GraphProxy * graph() const
void setOrientpolys(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
fpreal64 opInlinedist(const SOP_NodeVerb::CookParms &cookparms) const
Cons opCons(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool opPostnml(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, fpreal64 v)
fpreal64 opAngle(const SOP_NodeVerb::CookParms &cookparms) const
void setDist(fpreal64 val)
SYS_FORCE_INLINE UT_StringHolder getToken(GroupType enum_value)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setGroup(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, UT_Matrix3D v)
GT_API const UT_StringHolder version
void setPostnml(bool val)
fpreal64 getInlinedist() const
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
bool opInline(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
fpreal64 getAngle() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
DEP_MicroNode * depnode() const
static void saveData(std::ostream &os, UT_Vector4D v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool getOrientpolys() const
constexpr SYS_FORCE_INLINE T & w() noexcept
virtual UT_StringHolder baseGetSignature() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool opOrientpolys(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const char * findChar(int c) const
bool opCusp(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setReversenml(bool val)
bool operator!=(const SOP_FacetParms &src) const
constexpr SYS_FORCE_INLINE T & y() noexcept
ParmType getNestParmType(TempIndex fieldnum) const override
bool opRemove(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setAccurate(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, bool &v)
bool opPrenml(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)