23 namespace SOP_VolumeRasterizeParticlesEnums
36 using namespace UT::Literal;
69 if (rule != src.
rule)
return false;
85 for (
int i = 0; i < list.
entries(); i++)
107 myFilter =
"gauss"_UTsh;
108 myDensityattrib =
"density"_UTsh;
112 myVelocityblur =
false;
117 myAttribrules.setSize(0);
130 if (myGroup != src.myGroup)
return false;
131 if (myPoints != src.myPoints)
return false;
132 if (myFilter != src.myFilter)
return false;
133 if (myDensityattrib != src.myDensityattrib)
return false;
134 if (myDensityscale != src.myDensityscale)
return false;
135 if (myParticlescale != src.myParticlescale)
return false;
136 if (myMinfilter != src.myMinfilter)
return false;
137 if (myVelocityblur != src.myVelocityblur)
return false;
138 if (myShutter != src.myShutter)
return false;
139 if (myShutteroffset != src.myShutteroffset)
return false;
140 if (myBlursamples != src.myBlursamples)
return false;
141 if (myNormalize != src.myNormalize)
return false;
142 if (myAttribrules != src.myAttribrules)
return false;
161 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
164 graph->
evalOpParm(myPoints, nodeidx,
"points", time, graph->
isDirect()?
nullptr:depnode);
165 myFilter =
"gauss"_UTsh;
167 graph->
evalOpParm(myFilter, nodeidx,
"filter", time, graph->
isDirect()?
nullptr:depnode);
168 myDensityattrib =
"density"_UTsh;
170 graph->
evalOpParm(myDensityattrib, nodeidx,
"densityattrib", time, graph->
isDirect()?
nullptr:depnode);
173 graph->
evalOpParm(myDensityscale, nodeidx,
"densityscale", time, graph->
isDirect()?
nullptr:depnode);
176 graph->
evalOpParm(myParticlescale, nodeidx,
"particlescale", time, graph->
isDirect()?
nullptr:depnode);
179 graph->
evalOpParm(myMinfilter, nodeidx,
"minfilter", time, graph->
isDirect()?
nullptr:depnode);
180 myVelocityblur =
false;
182 graph->
evalOpParm(myVelocityblur, nodeidx,
"velocityblur", time, graph->
isDirect()?
nullptr:depnode);
184 if (
true && ( (
true&&!(((getVelocityblur()==0)))) ) )
185 graph->
evalOpParm(myShutter, nodeidx,
"shutter", time, graph->
isDirect()?
nullptr:depnode);
187 if (
true && ( (
true&&!(((getVelocityblur()==0)))) ) )
188 graph->
evalOpParm(myShutteroffset, nodeidx,
"shutteroffset", time, graph->
isDirect()?
nullptr:depnode);
190 if (
true && ( (
true&&!(((getVelocityblur()==0)))) ) )
191 graph->
evalOpParm(myBlursamples, nodeidx,
"blursamples", time, graph->
isDirect()?
nullptr:depnode);
194 graph->
evalOpParm(myNormalize, nodeidx,
"normalize", time, graph->
isDirect()?
nullptr:depnode);
198 graph->
evalOpParm(length, nodeidx,
"attribrules", time, graph->
isDirect()?
nullptr:depnode);
199 if (length < 0) length = 0;
200 myAttribrules.setSize(length);
207 auto && _curentry = myAttribrules(i);
209 _curentry.attribute =
""_UTsh;
211 graph->
evalOpParmInst(_curentry.attribute, nodeidx,
"attribute#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
214 graph->
evalOpParmInst(_curentry.rule, nodeidx,
"rule#", parmidx, offsets, time, graph->
isDirect()?
nullptr:depnode, 2-1);
219 myAttribrules.clear();
235 template <
typename T>
242 if (idx.
size() != instance.
size()+1)
247 coerceValue(value, myGroup);
250 coerceValue(value, myPoints);
253 coerceValue(value, myFilter);
256 coerceValue(value, myDensityattrib);
259 coerceValue(value, myDensityscale);
262 coerceValue(value, myParticlescale);
265 coerceValue(value, myMinfilter);
268 coerceValue(value, myVelocityblur);
271 coerceValue(value, myShutter);
274 coerceValue(value, myShutteroffset);
277 coerceValue(value, myBlursamples);
280 coerceValue(value, myNormalize);
284 coerceValue(value, myAttribrules.entries());
285 else if (instance[0] < myAttribrules.entries())
287 auto && _data = myAttribrules(instance[0]);
291 coerceValue(value, _data.attribute);
294 coerceValue(value, _data.rule);
314 { doGetParmValue(idx, instance, value); }
316 { doGetParmValue(idx, instance, value); }
318 { doGetParmValue(idx, instance, value); }
320 { doGetParmValue(idx, instance, value); }
322 { doGetParmValue(idx, instance, value); }
324 { doGetParmValue(idx, instance, value); }
326 { doGetParmValue(idx, instance, value); }
328 { doGetParmValue(idx, instance, value); }
330 { doGetParmValue(idx, instance, value); }
332 { doGetParmValue(idx, instance, value); }
334 { doGetParmValue(idx, instance, value); }
336 template <
typename T>
343 if (idx.
size() != instance.
size()+1)
348 coerceValue(myGroup, ( ( value ) ));
351 coerceValue(myPoints, ( ( value ) ));
354 coerceValue(myFilter, ( ( value ) ));
357 coerceValue(myDensityattrib, ( ( value ) ));
360 coerceValue(myDensityscale, clampMinValue(0, ( value ) ));
363 coerceValue(myParticlescale, clampMinValue(0, ( value ) ));
366 coerceValue(myMinfilter, ( ( value ) ));
369 coerceValue(myVelocityblur, ( ( value ) ));
372 coerceValue(myShutter, clampMinValue(0, ( value ) ));
375 coerceValue(myShutteroffset, ( ( value ) ));
378 coerceValue(myBlursamples, clampMinValue(1, ( value ) ));
381 coerceValue(myNormalize, ( ( value ) ));
387 coerceValue(newsize, value);
388 if (newsize < 0) newsize = 0;
389 myAttribrules.setSize(newsize);
395 myAttribrules.setSizeIfNeeded(instance[0]+1);
396 auto && _data = myAttribrules(instance[0]);
400 coerceValue(_data.attribute, value);
403 coerceValue(_data.rule, value);
414 { doSetParmValue(idx, instance, value); }
416 { doSetParmValue(idx, instance, value); }
418 { doSetParmValue(idx, instance, value); }
420 { doSetParmValue(idx, instance, value); }
422 { doSetParmValue(idx, instance, value); }
424 { doSetParmValue(idx, instance, value); }
426 { doSetParmValue(idx, instance, value); }
428 { doSetParmValue(idx, instance, value); }
430 { doSetParmValue(idx, instance, value); }
432 { doSetParmValue(idx, instance, value); }
434 { doSetParmValue(idx, instance, value); }
452 if (fieldnum.
size() < 1)
463 return "densityattrib";
465 return "densityscale";
467 return "particlescale";
471 return "velocityblur";
475 return "shutteroffset";
477 return "blursamples";
481 if (fieldnum.
size() == 1)
482 return "attribrules";
499 if (fieldnum.
size() < 1)
500 return PARM_UNSUPPORTED;
528 if (fieldnum.
size() == 1)
529 return PARM_MULTIPARM;
538 return PARM_UNSUPPORTED;
541 return PARM_UNSUPPORTED;
577 loadData(is, rampdata);
595 int typelen = colon - data.
buffer();
609 {
int64 iv =
v; UTwrite(os, &iv); }
611 { UTwrite<fpreal64>(os, &
v); }
613 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
615 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
616 UTwrite<fpreal64>(os, &v.
z()); }
618 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
619 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
631 if (s) s->save(ostr);
633 saveData(os, result);
640 ostr << s->getDataTypeToken();
645 saveData(os, result);
649 void save(std::ostream &os)
const
653 saveData(os, myGroup);
654 saveData(os, myPoints);
655 saveData(os, myFilter);
656 saveData(os, myDensityattrib);
657 saveData(os, myDensityscale);
658 saveData(os, myParticlescale);
659 saveData(os, myMinfilter);
660 saveData(os, myVelocityblur);
661 saveData(os, myShutter);
662 saveData(os, myShutteroffset);
663 saveData(os, myBlursamples);
664 saveData(os, myNormalize);
667 UTwrite(os, &length);
670 auto && _curentry = myAttribrules(i);
672 saveData(os, _curentry.attribute);
673 saveData(os, _curentry.rule);
689 loadData(is, myGroup);
690 loadData(is, myPoints);
691 loadData(is, myFilter);
692 loadData(is, myDensityattrib);
693 loadData(is, myDensityscale);
694 loadData(is, myParticlescale);
695 loadData(is, myMinfilter);
696 loadData(is, myVelocityblur);
697 loadData(is, myShutter);
698 loadData(is, myShutteroffset);
699 loadData(is, myBlursamples);
700 loadData(is, myNormalize);
704 myAttribrules.setSize(length);
707 auto && _curentry = myAttribrules(i);
709 loadData(is, _curentry.attribute);
710 loadData(is, _curentry.rule);
723 if (!thissop)
return getGroup();
725 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
733 if (!thissop)
return getPoints();
735 OP_Utils::evalOpParm(result, thissop,
"points", cookparms.
getCookTime(), 0);
743 if (!thissop)
return getFilter();
745 OP_Utils::evalOpParm(result, thissop,
"filter", cookparms.
getCookTime(), 0);
753 if (!thissop)
return getDensityattrib();
755 OP_Utils::evalOpParm(result, thissop,
"densityattrib", cookparms.
getCookTime(), 0);
763 if (!thissop)
return getDensityscale();
765 OP_Utils::evalOpParm(result, thissop,
"densityscale", cookparms.
getCookTime(), 0);
773 if (!thissop)
return getParticlescale();
775 OP_Utils::evalOpParm(result, thissop,
"particlescale", cookparms.
getCookTime(), 0);
783 if (!thissop)
return getMinfilter();
785 OP_Utils::evalOpParm(result, thissop,
"minfilter", cookparms.
getCookTime(), 0);
793 if (!thissop)
return getVelocityblur();
795 OP_Utils::evalOpParm(result, thissop,
"velocityblur", cookparms.
getCookTime(), 0);
803 if (!thissop)
return getShutter();
805 OP_Utils::evalOpParm(result, thissop,
"shutter", cookparms.
getCookTime(), 0);
813 if (!thissop)
return getShutteroffset();
815 OP_Utils::evalOpParm(result, thissop,
"shutteroffset", cookparms.
getCookTime(), 0);
823 if (!thissop)
return getBlursamples();
825 OP_Utils::evalOpParm(result, thissop,
"blursamples", cookparms.
getCookTime(), 0);
833 if (!thissop)
return getNormalize();
835 OP_Utils::evalOpParm(result, thissop,
"normalize", cookparms.
getCookTime(), 0);
843 if (!thissop)
return getAttribrules().entries();
845 OP_Utils::evalOpParm(result, thissop,
"attribrules", cookparms.
getCookTime(), 0);
849 {
return opinstAttribrules_attribute(cookparms, &_idx); }
853 if (!thissop)
return (myAttribrules(_idx[0]).
attribute);
855 _parmidx[1-1] = _idx[1-1] + 1;
858 OP_Utils::evalOpParmInst(result, thissop,
"attribute#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
862 {
return opinstAttribrules_rule(cookparms, &_idx); }
866 if (!thissop)
return (myAttribrules(_idx[0]).rule);
868 _parmidx[1-1] = _idx[1-1] + 1;
871 OP_Utils::evalOpParmInst(result, thissop,
"rule#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void save(std::ostream &os) const
static void saveData(std::ostream &os, bool v)
void setFilter(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_StringHolder opDensityattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
const UT_Array< Attribrules > & getAttribrules() const
GLenum GLuint GLenum GLsizei const GLchar * buf
const UT_StringHolder & getPoints() const
static void loadData(UT_IStream &is, bool &v)
SOP_VolumeRasterizeParticlesParms()
SOP_Node * getNode() const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
void setParticlescale(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector4D v)
exint bread(int32 *buffer, exint asize=1)
const UT_StringHolder & getDensityattrib() const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool isParmColorRamp(exint idx) const override
GLsizei const GLfloat * value
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_Matrix4D v)
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
int64 getBlursamples() const
**But if you need a result
UT_StringHolder attribute
fpreal64 opDensityscale(const SOP_NodeVerb::CookParms &cookparms) const
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 load(UT_IStream &is)
bool getVelocityblur() const
constexpr SYS_FORCE_INLINE T & x() noexcept
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setDensityattrib(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opinstAttribrules_attribute(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setDensityscale(fpreal64 val)
GLuint GLsizei const GLuint const GLintptr * offsets
UT_StringHolder opAttribrules_attribute(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint getNestNumParms(TempIndex idx) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
fpreal64 opShutteroffset(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const SOP_VolumeRasterizeParticlesParms &src) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
int64 opBlursamples(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
fpreal64 getShutteroffset() const
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, int64 v)
bool operator==(const Attribrules &src) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getParticlescale() const
static void saveData(std::ostream &os, UT_Matrix3D v)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal64 getDensityscale() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
fpreal64 opShutter(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 opMinfilter(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
fpreal64 getShutter() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setVelocityblur(bool val)
bool operator!=(const SOP_VolumeRasterizeParticlesParms &src) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
fpreal64 opParticlescale(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNormalize(bool val)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setShutter(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector2D v)
bool opVelocityblur(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const UT_StringHolder & getFilter() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
fpreal64 getMinfilter() const
virtual UT_StringHolder baseGetSignature() const
UT_StringHolder createString(const UT_Array< Attribrules > &list) const
void setPoints(const UT_StringHolder &val)
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
fpreal getCookTime() const
UT_StringHolder opFilter(const SOP_NodeVerb::CookParms &cookparms) const
void setAttribrules(const UT_Array< Attribrules > &val)
int64 opAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const char * findChar(int c) const
UT_StringHolder opPoints(const SOP_NodeVerb::CookParms &cookparms) const
bool getNormalize() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opinstAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator!=(const Attribrules &src) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
exint opAttribrules(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(Rule enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setBlursamples(int64 val)
SYS_FORCE_INLINE bool isstring() const
void setMinfilter(fpreal64 val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setShutteroffset(fpreal64 val)