20 using namespace UT::Literal;
23 namespace SOP_VolumeRasterizeParticlesEnums
55 if (rule != src.
rule)
return false;
71 for (
int i = 0; i < list.
entries(); i++)
93 myFilter =
"gauss"_sh;
94 myDensityattrib =
"density"_sh;
98 myVelocityblur =
false;
112 if (myGroup != src.myGroup)
return false;
113 if (myPoints != src.myPoints)
return false;
114 if (myFilter != src.myFilter)
return false;
115 if (myDensityattrib != src.myDensityattrib)
return false;
116 if (myDensityscale != src.myDensityscale)
return false;
117 if (myParticlescale != src.myParticlescale)
return false;
118 if (myMinfilter != src.myMinfilter)
return false;
119 if (myVelocityblur != src.myVelocityblur)
return false;
120 if (myShutter != src.myShutter)
return false;
121 if (myShutteroffset != src.myShutteroffset)
return false;
122 if (myBlursamples != src.myBlursamples)
return false;
123 if (myNormalize != src.myNormalize)
return false;
124 if (myAttribrules != src.myAttribrules)
return false;
140 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
143 graph->
evalOpParm(myPoints, nodeidx,
"points", time, 0);
144 myFilter =
"gauss"_sh;
146 graph->
evalOpParm(myFilter, nodeidx,
"filter", time, 0);
147 myDensityattrib =
"density"_sh;
149 graph->
evalOpParm(myDensityattrib, nodeidx,
"densityattrib", time, 0);
152 graph->
evalOpParm(myDensityscale, nodeidx,
"densityscale", time, 0);
155 graph->
evalOpParm(myParticlescale, nodeidx,
"particlescale", time, 0);
158 graph->
evalOpParm(myMinfilter, nodeidx,
"minfilter", time, 0);
159 myVelocityblur =
false;
161 graph->
evalOpParm(myVelocityblur, nodeidx,
"velocityblur", time, 0);
163 if (
true && ( (!(((getVelocityblur()==0)))) ) )
164 graph->
evalOpParm(myShutter, nodeidx,
"shutter", time, 0);
166 if (
true && ( (!(((getVelocityblur()==0)))) ) )
167 graph->
evalOpParm(myShutteroffset, nodeidx,
"shutteroffset", time, 0);
169 if (
true && ( (!(((getVelocityblur()==0)))) ) )
170 graph->
evalOpParm(myBlursamples, nodeidx,
"blursamples", time, 0);
173 graph->
evalOpParm(myNormalize, nodeidx,
"normalize", time, 0);
177 graph->
evalOpParm(length, nodeidx,
"attribrules", time, 0);
178 myAttribrules.entries(length);
182 auto && _curentry = myAttribrules(i);
184 myAttribrules(i).attribute =
""_sh;
187 myAttribrules(i).rule = 0;
189 graph->
evalOpParmInst(myAttribrules(i).rule, nodeidx,
"rule#", &parmidx, time, 0);
194 myAttribrules.clear();
210 template <
typename T>
217 if (idx.
size() != instance.
size()+1)
222 coerceValue(value, myGroup);
225 coerceValue(value, myPoints);
228 coerceValue(value, myFilter);
231 coerceValue(value, myDensityattrib);
234 coerceValue(value, myDensityscale);
237 coerceValue(value, myParticlescale);
240 coerceValue(value, myMinfilter);
243 coerceValue(value, myVelocityblur);
246 coerceValue(value, myShutter);
249 coerceValue(value, myShutteroffset);
252 coerceValue(value, myBlursamples);
255 coerceValue(value, myNormalize);
259 coerceValue(value, myAttribrules.entries());
260 else if (instance[0] < myAttribrules.entries())
262 auto && _data = myAttribrules(instance[0]);
266 coerceValue(value, _data.attribute);
269 coerceValue(value, _data.rule);
280 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
309 if (idx.
size() != instance.
size()+1)
314 coerceValue(myGroup, value);
317 coerceValue(myPoints, value);
320 coerceValue(myFilter, value);
323 coerceValue(myDensityattrib, value);
326 coerceValue(myDensityscale, value);
329 coerceValue(myParticlescale, value);
332 coerceValue(myMinfilter, value);
335 coerceValue(myVelocityblur, value);
338 coerceValue(myShutter, value);
341 coerceValue(myShutteroffset, value);
344 coerceValue(myBlursamples, value);
347 coerceValue(myNormalize, value);
353 coerceValue(newsize, value);
354 myAttribrules.setSize(newsize);
358 myAttribrules.setSizeIfNeeded(instance[0]+1);
359 auto && _data = myAttribrules(instance[0]);
363 coerceValue(_data.attribute, value);
366 coerceValue(_data.rule, 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); }
393 { doSetParmValue(idx, instance, value); }
395 { doSetParmValue(idx, instance, value); }
397 { doSetParmValue(idx, instance, value); }
415 if (fieldnum.
size() < 1)
426 return "densityattrib";
428 return "densityscale";
430 return "particlescale";
434 return "velocityblur";
438 return "shutteroffset";
440 return "blursamples";
444 if (fieldnum.
size() == 1)
445 return "attribrules";
462 if (fieldnum.
size() < 1)
463 return PARM_UNSUPPORTED;
491 if (fieldnum.
size() == 1)
492 return PARM_MULTIPARM;
501 return PARM_UNSUPPORTED;
504 return PARM_UNSUPPORTED;
540 loadData(is, rampdata);
558 int typelen = colon - data.
buffer();
572 {
int64 iv =
v; UTwrite(os, &iv); }
574 { UTwrite<fpreal64>(os, &
v); }
576 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
578 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
579 UTwrite<fpreal64>(os, &v.
z()); }
581 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
582 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
594 if (s) s->save(ostr);
596 saveData(os, result);
603 ostr << s->getDataTypeToken();
608 saveData(os, result);
612 void save(std::ostream &os)
const
616 saveData(os, myGroup);
617 saveData(os, myPoints);
618 saveData(os, myFilter);
619 saveData(os, myDensityattrib);
620 saveData(os, myDensityscale);
621 saveData(os, myParticlescale);
622 saveData(os, myMinfilter);
623 saveData(os, myVelocityblur);
624 saveData(os, myShutter);
625 saveData(os, myShutteroffset);
626 saveData(os, myBlursamples);
627 saveData(os, myNormalize);
630 UTwrite(os, &length);
633 saveData(os, myAttribrules(i).
attribute);
634 saveData(os, myAttribrules(i).rule);
650 loadData(is, myGroup);
651 loadData(is, myPoints);
652 loadData(is, myFilter);
653 loadData(is, myDensityattrib);
654 loadData(is, myDensityscale);
655 loadData(is, myParticlescale);
656 loadData(is, myMinfilter);
657 loadData(is, myVelocityblur);
658 loadData(is, myShutter);
659 loadData(is, myShutteroffset);
660 loadData(is, myBlursamples);
661 loadData(is, myNormalize);
665 myAttribrules.entries(length);
668 loadData(is, myAttribrules(i).
attribute);
669 loadData(is, myAttribrules(i).rule);
682 if (!thissop)
return getGroup();
684 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
692 if (!thissop)
return getPoints();
694 OP_Utils::evalOpParm(result, thissop,
"points", cookparms.
getCookTime(), 0);
702 if (!thissop)
return getFilter();
704 OP_Utils::evalOpParm(result, thissop,
"filter", cookparms.
getCookTime(), 0);
712 if (!thissop)
return getDensityattrib();
714 OP_Utils::evalOpParm(result, thissop,
"densityattrib", cookparms.
getCookTime(), 0);
722 if (!thissop)
return getDensityscale();
724 OP_Utils::evalOpParm(result, thissop,
"densityscale", cookparms.
getCookTime(), 0);
732 if (!thissop)
return getParticlescale();
734 OP_Utils::evalOpParm(result, thissop,
"particlescale", cookparms.
getCookTime(), 0);
742 if (!thissop)
return getMinfilter();
744 OP_Utils::evalOpParm(result, thissop,
"minfilter", cookparms.
getCookTime(), 0);
752 if (!thissop)
return getVelocityblur();
754 OP_Utils::evalOpParm(result, thissop,
"velocityblur", cookparms.
getCookTime(), 0);
762 if (!thissop)
return getShutter();
764 OP_Utils::evalOpParm(result, thissop,
"shutter", cookparms.
getCookTime(), 0);
772 if (!thissop)
return getShutteroffset();
774 OP_Utils::evalOpParm(result, thissop,
"shutteroffset", cookparms.
getCookTime(), 0);
782 if (!thissop)
return getBlursamples();
784 OP_Utils::evalOpParm(result, thissop,
"blursamples", cookparms.
getCookTime(), 0);
792 if (!thissop)
return getNormalize();
794 OP_Utils::evalOpParm(result, thissop,
"normalize", cookparms.
getCookTime(), 0);
802 if (!thissop)
return getAttribrules().entries();
804 OP_Utils::evalOpParm(result, thissop,
"attribrules", cookparms.
getCookTime(), 0);
810 if (!thissop)
return (myAttribrules(_idx).
attribute);
811 int _parmidx = _idx + 1;
813 OP_Utils::evalOpParmInst(result, thissop,
"attribute#", &_parmidx, cookparms.
getCookTime(), 0);
819 if (!thissop)
return (myAttribrules(_idx).rule);
820 int _parmidx = _idx + 1;
822 OP_Utils::evalOpParmInst(result, thissop,
"rule#", &_parmidx, cookparms.
getCookTime(), 0);
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)
int64 opAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
UT_StringHolder opDensityattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
const UT_Array< Attribrules > & getAttribrules() const
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)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, int *inst, fpreal time, DEP_MicroNode *depnode) const =0
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
GLuint const GLfloat * val
static void loadData(UT_IStream &is, UT_Vector4I &v)
void copyFrom(const SOP_NodeParms *src) override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
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)
const SOP_GraphProxy * graph() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Matrix3D &v)
int64 getBlursamples() const
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
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
void setDensityscale(fpreal64 val)
exint getNestNumParms(TempIndex idx) const override
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)
GLint GLenum GLsizei GLint GLsizei const void * data
fpreal64 getShutteroffset() const
exint read(bool *array, exint sz=1)
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)
GLuint GLsizei GLsizei * length
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getParticlescale() const
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, fpreal64 &v)
~SOP_VolumeRasterizeParticlesParms() override
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
fpreal64 getShutter() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_StringHolder opAttribrules_attribute(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
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
DEP_MicroNode * depnode() const
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
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)
SYS_FORCE_INLINE void append(char character)
GLdouble GLdouble GLdouble r
fpreal64 getMinfilter() 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)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
fpreal getCookTime() const
UT_StringHolder opFilter(const SOP_NodeVerb::CookParms &cookparms) const
void setAttribrules(const UT_Array< Attribrules > &val)
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 buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator!=(const Attribrules &src) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
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)
GLenum GLuint GLsizei const GLchar * buf
exint opAttribrules(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_StringHolder &v)
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
void setShutteroffset(fpreal64 val)