32 myOcclusionName =
"occlusion"_UTsh;
33 myResolutionRatio = 0.5;
35 myDensityScale = 0.015;
36 myTransmissionCutoff = 0.005;
49 if (myGroup != src.myGroup)
return false;
50 if (myOcclusionName != src.myOcclusionName)
return false;
51 if (myResolutionRatio != src.myResolutionRatio)
return false;
52 if (myExpand != src.myExpand)
return false;
53 if (myDensityScale != src.myDensityScale)
return false;
54 if (myTransmissionCutoff != src.myTransmissionCutoff)
return false;
69 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
70 myOcclusionName =
"occlusion"_UTsh;
72 graph->
evalOpParm(myOcclusionName, nodeidx,
"occlusionname", time, 0);
73 myResolutionRatio = 0.5;
75 graph->
evalOpParm(myResolutionRatio, nodeidx,
"resolutionratio", time, 0);
78 graph->
evalOpParm(myExpand, nodeidx,
"expand", time, 0);
79 myDensityScale = 0.015;
81 graph->
evalOpParm(myDensityScale, nodeidx,
"densityscale", time, 0);
82 myTransmissionCutoff = 0.005;
84 graph->
evalOpParm(myTransmissionCutoff, nodeidx,
"transmissioncutoff", time, 0);
100 template <
typename T>
107 if (idx.
size() != instance.
size()+1)
143 { doGetParmValue(idx, instance, value); }
145 { doGetParmValue(idx, instance, value); }
147 { doGetParmValue(idx, instance, value); }
149 { doGetParmValue(idx, instance, value); }
151 { doGetParmValue(idx, instance, value); }
153 { doGetParmValue(idx, instance, value); }
155 { doGetParmValue(idx, instance, value); }
157 { doGetParmValue(idx, instance, value); }
159 { doGetParmValue(idx, instance, value); }
161 { doGetParmValue(idx, instance, value); }
163 { doGetParmValue(idx, instance, value); }
165 template <
typename T>
172 if (idx.
size() != instance.
size()+1)
199 { doSetParmValue(idx, instance, value); }
201 { doSetParmValue(idx, instance, value); }
203 { doSetParmValue(idx, instance, value); }
205 { doSetParmValue(idx, instance, value); }
207 { doSetParmValue(idx, instance, value); }
209 { doSetParmValue(idx, instance, value); }
211 { doSetParmValue(idx, instance, value); }
213 { doSetParmValue(idx, instance, value); }
215 { doSetParmValue(idx, instance, value); }
217 { doSetParmValue(idx, instance, value); }
219 { doSetParmValue(idx, instance, value); }
235 if (fieldnum.
size() < 1)
242 return "occlusionname";
244 return "resolutionratio";
248 return "densityscale";
250 return "transmissioncutoff";
258 if (fieldnum.
size() < 1)
259 return PARM_UNSUPPORTED;
312 loadData(is, rampdata);
330 int typelen = colon - data.
buffer();
344 {
int64 iv =
v; UTwrite(os, &iv); }
346 { UTwrite<fpreal64>(os, &
v); }
348 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
350 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
351 UTwrite<fpreal64>(os, &v.
z()); }
353 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
354 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
366 if (s) s->save(ostr);
368 saveData(os, result);
375 ostr << s->getDataTypeToken();
380 saveData(os, result);
384 void save(std::ostream &os)
const
388 saveData(os, myGroup);
389 saveData(os, myOcclusionName);
390 saveData(os, myResolutionRatio);
391 saveData(os, myExpand);
392 saveData(os, myDensityScale);
393 saveData(os, myTransmissionCutoff);
406 loadData(is, myGroup);
407 loadData(is, myOcclusionName);
408 loadData(is, myResolutionRatio);
409 loadData(is, myExpand);
410 loadData(is, myDensityScale);
411 loadData(is, myTransmissionCutoff);
421 if (!thissop)
return getGroup();
423 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
431 if (!thissop)
return getOcclusionName();
433 OP_Utils::evalOpParm(result, thissop,
"occlusionname", cookparms.
getCookTime(), 0);
441 if (!thissop)
return getResolutionRatio();
443 OP_Utils::evalOpParm(result, thissop,
"resolutionratio", cookparms.
getCookTime(), 0);
451 if (!thissop)
return getExpand();
453 OP_Utils::evalOpParm(result, thissop,
"expand", cookparms.
getCookTime(), 0);
461 if (!thissop)
return getDensityScale();
463 OP_Utils::evalOpParm(result, thissop,
"densityscale", cookparms.
getCookTime(), 0);
471 if (!thissop)
return getTransmissionCutoff();
473 OP_Utils::evalOpParm(result, thissop,
"transmissioncutoff", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, fpreal64 v)
void save(std::ostream &os) const
fpreal64 getDensityScale() const
SOP_Node * getNode() const
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
T clampMaxValue(fpreal maxvalue, const T &src) const
static void loadData(UT_IStream &is, fpreal64 &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
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, int64 v)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
int64 opExpand(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
const UT_StringHolder & getOcclusionName() const
exint getNestNumParms(TempIndex idx) const override
T clampMinValue(fpreal minvalue, const T &src) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
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, UT_Matrix2D &v)
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setDensityScale(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool operator!=(const SOP_VolumeAmbientOcclusionParms &src) const
void setExpand(int64 val)
static void saveData(std::ostream &os, UT_Matrix3D v)
void setResolutionRatio(fpreal64 val)
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setTransmissionCutoff(fpreal64 val)
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
fpreal64 getTransmissionCutoff() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const OP_GraphProxy * graph() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal64 opResolutionRatio(const SOP_NodeVerb::CookParms &cookparms) const
void setOcclusionName(const UT_StringHolder &val)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void loadFromOpSubclass(const LoadParms &loadparms) override
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.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GT_API const UT_StringHolder version
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal64 getResolutionRatio() const
void coerceValue(T &result, const S &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
fpreal64 opTransmissionCutoff(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector4D &v)
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal getCookTime() const
const char * findChar(int c) const
bool operator==(const SOP_VolumeAmbientOcclusionParms &src) const
bool isParmColorRamp(exint idx) const override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 opDensityScale(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, UT_Vector4D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
SOP_VolumeAmbientOcclusionParms()
SYS_FORCE_INLINE bool isstring() const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool load(UT_IStream &is)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opOcclusionName(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)