23 namespace SOP_VisibilityEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
69 using namespace UT::Literal;
105 if (myGroup != src.myGroup)
return false;
106 if (myAction != src.myAction)
return false;
107 if (myApplyTo != src.myApplyTo)
return false;
108 if (myViewport != src.myViewport)
return false;
109 if (myCumulative != src.myCumulative)
return false;
127 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
130 graph->
evalOpParm(myAction, nodeidx,
"action", time, 0);
133 graph->
evalOpParm(myApplyTo, nodeidx,
"applyto", time, 0);
136 graph->
evalOpParm(myViewport, nodeidx,
"viewport", time, 0);
139 graph->
evalOpParm(myCumulative, nodeidx,
"cumulative", time, 0);
155 template <
typename T>
162 if (idx.
size() != instance.
size()+1)
167 coerceValue(value, myGroup);
170 coerceValue(value, myAction);
173 coerceValue(value, myApplyTo);
176 coerceValue(value, myViewport);
179 coerceValue(value, myCumulative);
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
224 if (idx.
size() != instance.
size()+1)
229 coerceValue(myGroup, ( ( value ) ));
232 coerceValue(myAction, clampMinValue(0, clampMaxValue(1, value ) ));
235 coerceValue(myApplyTo, clampMinValue(0, clampMaxValue(1, value ) ));
238 coerceValue(myViewport, clampMinValue(0, clampMaxValue(2, value ) ));
241 coerceValue(myCumulative, ( ( value ) ));
248 { doSetParmValue(idx, instance, value); }
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, value); }
254 { doSetParmValue(idx, instance, value); }
256 { doSetParmValue(idx, instance, value); }
258 { doSetParmValue(idx, instance, value); }
260 { doSetParmValue(idx, instance, value); }
262 { doSetParmValue(idx, instance, value); }
264 { doSetParmValue(idx, instance, value); }
266 { doSetParmValue(idx, instance, value); }
268 { doSetParmValue(idx, instance, value); }
284 if (fieldnum.
size() < 1)
305 if (fieldnum.
size() < 1)
306 return PARM_UNSUPPORTED;
321 return PARM_UNSUPPORTED;
357 loadData(is, rampdata);
375 int typelen = colon - data.
buffer();
389 {
int64 iv =
v; UTwrite(os, &iv); }
391 { UTwrite<fpreal64>(os, &
v); }
393 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
395 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
396 UTwrite<fpreal64>(os, &v.
z()); }
398 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
399 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
411 if (s) s->save(ostr);
413 saveData(os, result);
420 ostr << s->getDataTypeToken();
425 saveData(os, result);
429 void save(std::ostream &os)
const
433 saveData(os, myGroup);
434 saveData(os, myAction);
435 saveData(os, myApplyTo);
436 saveData(os, myViewport);
437 saveData(os, myCumulative);
450 loadData(is, myGroup);
451 loadData(is, myAction);
452 loadData(is, myApplyTo);
453 loadData(is, myViewport);
454 loadData(is, myCumulative);
464 if (!thissop)
return getGroup();
466 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
474 if (!thissop)
return getAction();
476 OP_Utils::evalOpParm(result, thissop,
"action", cookparms.
getCookTime(), 0);
484 if (!thissop)
return getApplyTo();
486 OP_Utils::evalOpParm(result, thissop,
"applyto", cookparms.
getCookTime(), 0);
494 if (!thissop)
return getViewport();
496 OP_Utils::evalOpParm(result, thissop,
"viewport", cookparms.
getCookTime(), 0);
504 if (!thissop)
return getCumulative();
506 OP_Utils::evalOpParm(result, thissop,
"cumulative", cookparms.
getCookTime(), 0);
bool opCumulative(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Matrix4D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
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_Vector3D &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const OP_Context & context() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
Viewport opViewport(const SOP_NodeVerb::CookParms &cookparms) const
void setApplyTo(ApplyTo val)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
**But if you need a result
ApplyTo getApplyTo() const
bool operator==(const SOP_VisibilityParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &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 saveData(std::ostream &os, PRM_DataItemHandle s)
void setViewport(Viewport val)
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool getCumulative() const
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
Action opAction(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void saveData(std::ostream &os, int64 v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const OP_GraphProxy * graph() const
bool load(UT_IStream &is)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, fpreal64 &v)
ApplyTo opApplyTo(const SOP_NodeVerb::CookParms &cookparms) const
Viewport getViewport() const
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setAction(Action val)
void setCumulative(bool val)
static void saveData(std::ostream &os, UT_Vector3D v)
bool operator!=(const SOP_VisibilityParms &src) const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
SYS_FORCE_INLINE UT_StringHolder getToken(Action enum_value)
static void loadData(UT_IStream &is, bool &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
fpreal getCookTime() const
static void saveData(std::ostream &os, bool v)
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_Vector4D v)
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void save(std::ostream &os) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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