23 namespace SOP_PointCloudReduceEnums
35 using namespace UT::Literal;
58 myUsepopulation =
false;
59 myPopulation =
"population"_UTsh;
72 if (myGroup != src.myGroup)
return false;
73 if (myVoxelsize != src.myVoxelsize)
return false;
74 if (mySamplemethod != src.mySamplemethod)
return false;
75 if (mySeed != src.mySeed)
return false;
76 if (myUsepopulation != src.myUsepopulation)
return false;
77 if (myPopulation != src.myPopulation)
return false;
93 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
95 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==1)))) ) )
96 graph->
evalOpParm(myVoxelsize, nodeidx,
"voxelsize", time, 0);
99 graph->
evalOpParm(mySamplemethod, nodeidx,
"samplemethod", time, 0);
101 if (
true && ( (
true&&!(((
int64(getSamplemethod())!=2))||((
int64(getSamplemethod())!=2)))) ) )
102 graph->
evalOpParm(mySeed, nodeidx,
"seed", time, 0);
103 myUsepopulation =
false;
105 graph->
evalOpParm(myUsepopulation, nodeidx,
"usepopulation", time, 0);
106 myPopulation =
"population"_UTsh;
107 if (
true && ( (
true&&!(((getUsepopulation()==0)))) ) )
108 graph->
evalOpParm(myPopulation, nodeidx,
"population", time, 0);
124 template <
typename T>
131 if (idx.
size() != instance.
size()+1)
136 coerceValue(value, myGroup);
139 coerceValue(value, myVoxelsize);
142 coerceValue(value, mySamplemethod);
145 coerceValue(value, mySeed);
148 coerceValue(value, myUsepopulation);
151 coerceValue(value, myPopulation);
167 { doGetParmValue(idx, instance, value); }
169 { doGetParmValue(idx, instance, value); }
171 { doGetParmValue(idx, instance, value); }
173 { doGetParmValue(idx, instance, value); }
175 { doGetParmValue(idx, instance, value); }
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 { doGetParmValue(idx, instance, value); }
183 { doGetParmValue(idx, instance, value); }
185 { doGetParmValue(idx, instance, value); }
187 { doGetParmValue(idx, instance, value); }
189 template <
typename T>
196 if (idx.
size() != instance.
size()+1)
201 coerceValue(myGroup, ( ( value ) ));
204 coerceValue(myVoxelsize, ( clampMaxValue(-05, value ) ));
207 coerceValue(mySamplemethod, clampMinValue(0, clampMaxValue(2, value ) ));
210 coerceValue(mySeed, ( ( value ) ));
213 coerceValue(myUsepopulation, ( ( value ) ));
216 coerceValue(myPopulation, ( ( value ) ));
223 { doSetParmValue(idx, instance, value); }
225 { doSetParmValue(idx, instance, value); }
227 { doSetParmValue(idx, instance, value); }
229 { doSetParmValue(idx, instance, value); }
231 { doSetParmValue(idx, instance, value); }
233 { doSetParmValue(idx, instance, value); }
235 { doSetParmValue(idx, instance, value); }
237 { doSetParmValue(idx, instance, value); }
239 { doSetParmValue(idx, instance, value); }
241 { doSetParmValue(idx, instance, value); }
243 { doSetParmValue(idx, instance, value); }
259 if (fieldnum.
size() < 1)
268 return "samplemethod";
272 return "usepopulation";
282 if (fieldnum.
size() < 1)
283 return PARM_UNSUPPORTED;
300 return PARM_UNSUPPORTED;
336 loadData(is, rampdata);
354 int typelen = colon - data.
buffer();
368 {
int64 iv =
v; UTwrite(os, &iv); }
370 { UTwrite<fpreal64>(os, &
v); }
372 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
374 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
375 UTwrite<fpreal64>(os, &v.
z()); }
377 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
378 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
390 if (s) s->save(ostr);
392 saveData(os, result);
399 ostr << s->getDataTypeToken();
404 saveData(os, result);
408 void save(std::ostream &os)
const
412 saveData(os, myGroup);
413 saveData(os, myVoxelsize);
414 saveData(os, mySamplemethod);
415 saveData(os, mySeed);
416 saveData(os, myUsepopulation);
417 saveData(os, myPopulation);
430 loadData(is, myGroup);
431 loadData(is, myVoxelsize);
432 loadData(is, mySamplemethod);
433 loadData(is, mySeed);
434 loadData(is, myUsepopulation);
435 loadData(is, myPopulation);
445 if (!thissop)
return getGroup();
447 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
455 if (!thissop)
return getVoxelsize();
457 OP_Utils::evalOpParm(result, thissop,
"voxelsize", cookparms.
getCookTime(), 0);
465 if (!thissop)
return getSamplemethod();
467 OP_Utils::evalOpParm(result, thissop,
"samplemethod", cookparms.
getCookTime(), 0);
475 if (!thissop)
return getSeed();
477 OP_Utils::evalOpParm(result, thissop,
"seed", cookparms.
getCookTime(), 0);
485 if (!thissop)
return getUsepopulation();
487 OP_Utils::evalOpParm(result, thissop,
"usepopulation", cookparms.
getCookTime(), 0);
495 if (!thissop)
return getPopulation();
497 OP_Utils::evalOpParm(result, thissop,
"population", cookparms.
getCookTime(), 0);
504 int64 mySamplemethod;
506 bool myUsepopulation;
bool getUsepopulation() const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setSamplemethod(Samplemethod val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool load(UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal64 getVoxelsize() const
Samplemethod getSamplemethod() const
exint bread(int32 *buffer, exint asize=1)
UT_StringHolder opPopulation(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setGroup(const UT_StringHolder &val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setSeed(fpreal64 val)
bool operator==(const SOP_PointCloudReduceParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector3I &v)
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &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, UT_Matrix3D v)
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
Samplemethod opSamplemethod(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, fpreal64 v)
SOP_PointCloudReduceParms()
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) 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 saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 opVoxelsize(const SOP_NodeVerb::CookParms &cookparms) const
void setUsepopulation(bool val)
const OP_GraphProxy * graph() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_StringHolder s)
bool operator!=(const SOP_PointCloudReduceParms &src) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getPopulation() const
const UT_StringHolder & getGroup() const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
fpreal getCookTime() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint getNestNumParms(TempIndex idx) const override
fpreal64 opSeed(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(Samplemethod enum_value)
const char * findChar(int c) const
bool opUsepopulation(const SOP_NodeVerb::CookParms &cookparms) const
void setPopulation(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setVoxelsize(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept