23 namespace SOP_PointCloudNormalEnums
34 using namespace UT::Literal;
53 myNormalAttrib =
"N"_UTsh;
56 myUseNeighbors =
true;
75 if (myGroup != src.myGroup)
return false;
76 if (myNormalAttrib != src.myNormalAttrib)
return false;
77 if (myCompute != src.myCompute)
return false;
78 if (myRadius != src.myRadius)
return false;
79 if (myUseNeighbors != src.myUseNeighbors)
return false;
80 if (myNeighbors != src.myNeighbors)
return false;
81 if (myOrigIfZero != src.myOrigIfZero)
return false;
82 if (myMethod != src.myMethod)
return false;
83 if (myLocalNeighbors != src.myLocalNeighbors)
return false;
84 if (myHint != src.myHint)
return false;
85 if (myReverse != src.myReverse)
return false;
101 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
102 myNormalAttrib =
"N"_UTsh;
104 graph->
evalOpParm(myNormalAttrib, nodeidx,
"normalattrib", time, 0);
107 graph->
evalOpParm(myCompute, nodeidx,
"compute", time, 0);
109 if (
true && ( (
true&&!(((getCompute()==0)))) ) )
110 graph->
evalOpParm(myRadius, nodeidx,
"radius", time, 0);
111 myUseNeighbors =
true;
112 if (
true && ( (
true&&!(((getCompute()==0)))) ) )
113 graph->
evalOpParm(myUseNeighbors, nodeidx,
"useneighbors", time, 0);
115 if (
true && ( (
true&&!(((getCompute()==0))||((getUseNeighbors()==0)))) ) )
116 graph->
evalOpParm(myNeighbors, nodeidx,
"neighbors", time, 0);
118 if (
true && ( (
true&&!(((getCompute()==0)))) ) )
119 graph->
evalOpParm(myOrigIfZero, nodeidx,
"origifzero", time, 0);
122 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
123 myLocalNeighbors = 5;
124 if (
true && ( (
true&&!(((
int64(getMethod())!=1))||((
int64(getMethod())!=1)))) ) )
125 graph->
evalOpParm(myLocalNeighbors, nodeidx,
"localneighbors", time, 0);
128 graph->
evalOpParm(myHint, nodeidx,
"hint", time, 0);
131 graph->
evalOpParm(myReverse, nodeidx,
"reverse", time, 0);
147 template <
typename T>
154 if (idx.
size() != instance.
size()+1)
159 coerceValue(value, myGroup);
162 coerceValue(value, myNormalAttrib);
165 coerceValue(value, myCompute);
168 coerceValue(value, myRadius);
171 coerceValue(value, myUseNeighbors);
174 coerceValue(value, myNeighbors);
177 coerceValue(value, myOrigIfZero);
180 coerceValue(value, myMethod);
183 coerceValue(value, myLocalNeighbors);
186 coerceValue(value, myHint);
189 coerceValue(value, myReverse);
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 template <
typename T>
234 if (idx.
size() != instance.
size()+1)
239 coerceValue(myGroup, ( ( value ) ));
242 coerceValue(myNormalAttrib, ( ( value ) ));
245 coerceValue(myCompute, ( ( value ) ));
248 coerceValue(myRadius, ( clampMaxValue(-15, value ) ));
251 coerceValue(myUseNeighbors, ( ( value ) ));
254 coerceValue(myNeighbors, clampMinValue(2, ( value ) ));
257 coerceValue(myOrigIfZero, ( ( value ) ));
260 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
263 coerceValue(myLocalNeighbors, clampMinValue(2, ( value ) ));
266 coerceValue(myHint, ( ( value ) ));
269 coerceValue(myReverse, ( ( value ) ));
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
312 if (fieldnum.
size() < 1)
319 return "normalattrib";
325 return "useneighbors";
333 return "localneighbors";
345 if (fieldnum.
size() < 1)
346 return PARM_UNSUPPORTED;
373 return PARM_UNSUPPORTED;
409 loadData(is, rampdata);
427 int typelen = colon - data.
buffer();
441 {
int64 iv =
v; UTwrite(os, &iv); }
443 { UTwrite<fpreal64>(os, &
v); }
445 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
447 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
448 UTwrite<fpreal64>(os, &v.
z()); }
450 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
451 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
463 if (s) s->save(ostr);
465 saveData(os, result);
472 ostr << s->getDataTypeToken();
477 saveData(os, result);
481 void save(std::ostream &os)
const
485 saveData(os, myGroup);
486 saveData(os, myNormalAttrib);
487 saveData(os, myCompute);
488 saveData(os, myRadius);
489 saveData(os, myUseNeighbors);
490 saveData(os, myNeighbors);
491 saveData(os, myOrigIfZero);
492 saveData(os, myMethod);
493 saveData(os, myLocalNeighbors);
494 saveData(os, myHint);
495 saveData(os, myReverse);
508 loadData(is, myGroup);
509 loadData(is, myNormalAttrib);
510 loadData(is, myCompute);
511 loadData(is, myRadius);
512 loadData(is, myUseNeighbors);
513 loadData(is, myNeighbors);
514 loadData(is, myOrigIfZero);
515 loadData(is, myMethod);
516 loadData(is, myLocalNeighbors);
517 loadData(is, myHint);
518 loadData(is, myReverse);
528 if (!thissop)
return getGroup();
530 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
538 if (!thissop)
return getNormalAttrib();
540 OP_Utils::evalOpParm(result, thissop,
"normalattrib", cookparms.
getCookTime(), 0);
548 if (!thissop)
return getCompute();
550 OP_Utils::evalOpParm(result, thissop,
"compute", cookparms.
getCookTime(), 0);
558 if (!thissop)
return getRadius();
560 OP_Utils::evalOpParm(result, thissop,
"radius", cookparms.
getCookTime(), 0);
568 if (!thissop)
return getUseNeighbors();
570 OP_Utils::evalOpParm(result, thissop,
"useneighbors", cookparms.
getCookTime(), 0);
578 if (!thissop)
return getNeighbors();
580 OP_Utils::evalOpParm(result, thissop,
"neighbors", cookparms.
getCookTime(), 0);
588 if (!thissop)
return getOrigIfZero();
590 OP_Utils::evalOpParm(result, thissop,
"origifzero", cookparms.
getCookTime(), 0);
598 if (!thissop)
return getMethod();
600 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
608 if (!thissop)
return getLocalNeighbors();
610 OP_Utils::evalOpParm(result, thissop,
"localneighbors", cookparms.
getCookTime(), 0);
618 if (!thissop)
return getHint();
620 OP_Utils::evalOpParm(result, thissop,
"hint", cookparms.
getCookTime(), 0);
628 if (!thissop)
return getReverse();
630 OP_Utils::evalOpParm(result, thissop,
"reverse", cookparms.
getCookTime(), 0);
643 int64 myLocalNeighbors;
bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNeighbors(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNormalAttrib(const UT_StringHolder &val)
void setHint(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, int64 v)
const OP_Context & context() const
void setOrigIfZero(bool val)
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, bool &v)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector3I &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void copyFrom(const OP_NodeParms *src) override
void setLocalNeighbors(int64 val)
**But if you need a result
UT_StringHolder opNormalAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &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 loadData(UT_IStream &is, int64 &v)
void save(std::ostream &os) const
bool operator==(const SOP_PointCloudNormalParms &src) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setGroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
UT_Vector3D getHint() const
bool isParmColorRamp(exint idx) const override
bool opOrigIfZero(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
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
bool load(UT_IStream &is)
const OP_GraphProxy * graph() const
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, fpreal64 v)
bool opCompute(const SOP_NodeVerb::CookParms &cookparms) const
SOP_PointCloudNormalParms()
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool operator!=(const SOP_PointCloudNormalParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
UT_Vector3T< fpreal64 > UT_Vector3D
void setUseNeighbors(bool val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setReverse(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 getRadius() const
void setCompute(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, UT_StringHolder &v)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
int64 getNeighbors() const
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Matrix2D v)
int64 opNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getNormalAttrib() const
bool getUseNeighbors() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
DEP_MicroNode * depnode() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
LeafData & operator=(const LeafData &)=delete
const UT_StringHolder & getGroup() const
Utility class for containing a color ramp.
bool opUseNeighbors(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_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
void setMethod(Method val)
static void saveData(std::ostream &os, UT_StringHolder s)
int64 getLocalNeighbors() const
UT_Vector3D opHint(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
fpreal getCookTime() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setRadius(fpreal64 val)
int64 opLocalNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getOrigIfZero() const
const char * getNestParmName(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
fpreal64 opRadius(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept