23 namespace SOP_VolumeTrailEnums
34 using namespace UT::Literal;
55 using namespace UT::Literal;
79 myAdvectionChoice = 0;
104 if (myGroup != src.myGroup)
return false;
105 if (myVelField != src.myVelField)
return false;
106 if (myAdvectionChoice != src.myAdvectionChoice)
return false;
107 if (myTrailLen != src.myTrailLen)
return false;
108 if (myUseCFL != src.myUseCFL)
return false;
109 if (myCFL != src.myCFL)
return false;
110 if (myNumSteps != src.myNumSteps)
return false;
111 if (myUseMaxSteps != src.myUseMaxSteps)
return false;
112 if (myMaxSteps != src.myMaxSteps)
return false;
113 if (myKeep != src.myKeep)
return false;
114 if (myVisEnable != src.myVisEnable)
return false;
115 if (myDetectRange != src.myDetectRange)
return false;
116 if (myVisMax != src.myVisMax)
return false;
117 if (myVisRamp != src.myVisRamp)
return false;
118 if (myCdRamp != src.myCdRamp)
119 {
if (!myCdRamp || !src.myCdRamp || !(*myCdRamp == *src.myCdRamp))
return false; }
136 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
137 myVelField =
""_UTsh;
139 graph->
evalOpParm(myVelField, nodeidx,
"velfield", time, 0);
140 myAdvectionChoice = 0;
142 graph->
evalOpParm(myAdvectionChoice, nodeidx,
"advectionchoice", time, 0);
145 graph->
evalOpParm(myTrailLen, nodeidx,
"traillen", time, 0);
148 graph->
evalOpParm(myUseCFL, nodeidx,
"usecfl", time, 0);
150 if (
true && ( (
true&&!(((getUseCFL()==0)))) ) )
151 graph->
evalOpParm(myCFL, nodeidx,
"cfl", time, 0);
153 if (
true && ( (
true&&!(((getUseCFL()==1)))) ) )
154 graph->
evalOpParm(myNumSteps, nodeidx,
"numsteps", time, 0);
155 myUseMaxSteps =
true;
157 graph->
evalOpParm(myUseMaxSteps, nodeidx,
"usemaxsteps", time, 0);
159 if (
true && ( (
true&&!(((getUseMaxSteps()==0)))) ) )
160 graph->
evalOpParm(myMaxSteps, nodeidx,
"maxsteps", time, 0);
163 graph->
evalOpParm(myKeep, nodeidx,
"keep", time, 0);
166 graph->
evalOpParm(myVisEnable, nodeidx,
"visenable", time, 0);
167 myDetectRange =
true;
168 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
169 graph->
evalOpParm(myDetectRange, nodeidx,
"detectrange", time, 0);
171 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
172 graph->
evalOpParm(myVisMax, nodeidx,
"vismax", time, 0);
174 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
175 graph->
evalOpParm(myVisRamp, nodeidx,
"visramp", time, 0);
177 if (
true && ( (
true&&!(((getVisEnable()==0))||((
int64(getVisRamp())!=5)))) ) )
178 graph->
evalOpParm(myCdRamp, nodeidx,
"cdramp", time, 0);
194 template <
typename T>
201 if (idx.
size() != instance.
size()+1)
206 coerceValue(value, myGroup);
209 coerceValue(value, myVelField);
212 coerceValue(value, myAdvectionChoice);
215 coerceValue(value, myTrailLen);
218 coerceValue(value, myUseCFL);
221 coerceValue(value, myCFL);
224 coerceValue(value, myNumSteps);
227 coerceValue(value, myUseMaxSteps);
230 coerceValue(value, myMaxSteps);
233 coerceValue(value, myKeep);
236 coerceValue(value, myVisEnable);
239 coerceValue(value, myDetectRange);
242 coerceValue(value, myVisMax);
245 coerceValue(value, myVisRamp);
248 coerceValue(value, myCdRamp);
265 { doGetParmValue(idx, instance, value); }
267 { doGetParmValue(idx, instance, value); }
269 { doGetParmValue(idx, instance, value); }
271 { doGetParmValue(idx, instance, value); }
273 { doGetParmValue(idx, instance, value); }
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 template <
typename T>
294 if (idx.
size() != instance.
size()+1)
299 coerceValue(myGroup, ( ( value ) ));
302 coerceValue(myVelField, ( ( value ) ));
305 coerceValue(myAdvectionChoice, clampMinValue(0, clampMaxValue(1, value ) ));
308 coerceValue(myTrailLen, ( ( value ) ));
311 coerceValue(myUseCFL, ( ( value ) ));
314 coerceValue(myCFL, ( ( value ) ));
317 coerceValue(myNumSteps, clampMinValue(1, ( value ) ));
320 coerceValue(myUseMaxSteps, ( ( value ) ));
323 coerceValue(myMaxSteps, clampMinValue(1, ( value ) ));
326 coerceValue(myKeep, ( ( value ) ));
329 coerceValue(myVisEnable, ( ( value ) ));
332 coerceValue(myDetectRange, ( ( value ) ));
335 coerceValue(myVisMax, ( ( value ) ));
338 coerceValue(myVisRamp, clampMinValue(0, clampMaxValue(5, value ) ));
341 coerceValue(myCdRamp, clampMinValue(1, ( value ) ));
348 { doSetParmValue(idx, instance, value); }
350 { doSetParmValue(idx, instance, value); }
352 { doSetParmValue(idx, instance, value); }
354 { doSetParmValue(idx, instance, value); }
356 { doSetParmValue(idx, instance, value); }
358 { doSetParmValue(idx, instance, value); }
360 { doSetParmValue(idx, instance, value); }
362 { doSetParmValue(idx, instance, value); }
364 { doSetParmValue(idx, instance, value); }
366 { doSetParmValue(idx, instance, value); }
368 { doSetParmValue(idx, instance, value); }
384 if (fieldnum.
size() < 1)
393 return "advectionchoice";
403 return "usemaxsteps";
411 return "detectrange";
425 if (fieldnum.
size() < 1)
426 return PARM_UNSUPPORTED;
461 return PARM_UNSUPPORTED;
497 loadData(is, rampdata);
515 int typelen = colon - data.
buffer();
529 {
int64 iv =
v; UTwrite(os, &iv); }
531 { UTwrite<fpreal64>(os, &
v); }
533 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
535 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
536 UTwrite<fpreal64>(os, &v.
z()); }
538 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
539 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
551 if (s) s->save(ostr);
553 saveData(os, result);
560 ostr << s->getDataTypeToken();
565 saveData(os, result);
569 void save(std::ostream &os)
const
573 saveData(os, myGroup);
574 saveData(os, myVelField);
575 saveData(os, myAdvectionChoice);
576 saveData(os, myTrailLen);
577 saveData(os, myUseCFL);
579 saveData(os, myNumSteps);
580 saveData(os, myUseMaxSteps);
581 saveData(os, myMaxSteps);
582 saveData(os, myKeep);
583 saveData(os, myVisEnable);
584 saveData(os, myDetectRange);
585 saveData(os, myVisMax);
586 saveData(os, myVisRamp);
587 saveData(os, myCdRamp);
600 loadData(is, myGroup);
601 loadData(is, myVelField);
602 loadData(is, myAdvectionChoice);
603 loadData(is, myTrailLen);
604 loadData(is, myUseCFL);
606 loadData(is, myNumSteps);
607 loadData(is, myUseMaxSteps);
608 loadData(is, myMaxSteps);
609 loadData(is, myKeep);
610 loadData(is, myVisEnable);
611 loadData(is, myDetectRange);
612 loadData(is, myVisMax);
613 loadData(is, myVisRamp);
614 loadData(is, myCdRamp);
624 if (!thissop)
return getGroup();
626 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
634 if (!thissop)
return getVelField();
636 OP_Utils::evalOpParm(result, thissop,
"velfield", cookparms.
getCookTime(), 0);
644 if (!thissop)
return getAdvectionChoice();
646 OP_Utils::evalOpParm(result, thissop,
"advectionchoice", cookparms.
getCookTime(), 0);
654 if (!thissop)
return getTrailLen();
656 OP_Utils::evalOpParm(result, thissop,
"traillen", cookparms.
getCookTime(), 0);
664 if (!thissop)
return getUseCFL();
666 OP_Utils::evalOpParm(result, thissop,
"usecfl", cookparms.
getCookTime(), 0);
674 if (!thissop)
return getCFL();
676 OP_Utils::evalOpParm(result, thissop,
"cfl", cookparms.
getCookTime(), 0);
684 if (!thissop)
return getNumSteps();
686 OP_Utils::evalOpParm(result, thissop,
"numsteps", cookparms.
getCookTime(), 0);
694 if (!thissop)
return getUseMaxSteps();
696 OP_Utils::evalOpParm(result, thissop,
"usemaxsteps", cookparms.
getCookTime(), 0);
704 if (!thissop)
return getMaxSteps();
706 OP_Utils::evalOpParm(result, thissop,
"maxsteps", cookparms.
getCookTime(), 0);
714 if (!thissop)
return getKeep();
716 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
724 if (!thissop)
return getVisEnable();
726 OP_Utils::evalOpParm(result, thissop,
"visenable", cookparms.
getCookTime(), 0);
734 if (!thissop)
return getDetectRange();
736 OP_Utils::evalOpParm(result, thissop,
"detectrange", cookparms.
getCookTime(), 0);
744 if (!thissop)
return getVisMax();
746 OP_Utils::evalOpParm(result, thissop,
"vismax", cookparms.
getCookTime(), 0);
754 if (!thissop)
return getVisRamp();
756 OP_Utils::evalOpParm(result, thissop,
"visramp", cookparms.
getCookTime(), 0);
764 if (!thissop)
return getCdRamp();
766 OP_Utils::evalOpParm(result, thissop,
"cdramp", cookparms.
getCookTime(), 0);
773 int64 myAdvectionChoice;
void loadFromOpSubclass(const LoadParms &loadparms) override
SOP_Node * getNode() const
static void loadData(UT_IStream &is, bool &v)
fpreal64 opCFL(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setCdRamp(UT_SharedPtr< UT_Ramp > val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
void setMaxSteps(int64 val)
static void saveData(std::ostream &os, bool v)
const UT_StringHolder & getVelField() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getUseMaxSteps() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, int64 &v)
bool getVisEnable() const
exint getNestNumParms(TempIndex idx) const override
VisRamp opVisRamp(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setCFL(fpreal64 val)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setDetectRange(bool val)
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNumSteps(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
**But if you need a result
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const char * getNestParmName(TempIndex fieldnum) const 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.
bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
bool opVisEnable(const SOP_NodeVerb::CookParms &cookparms) const
void setAdvectionChoice(AdvectionChoice val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getTrailLen() const
UT_SharedPtr< UT_Ramp > opCdRamp(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
bool opUseCFL(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool opUseMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
int64 getMaxSteps() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
fpreal64 opVisMax(const SOP_NodeVerb::CookParms &cookparms) const
bool opDetectRange(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 opNumSteps(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_StringHolder opVelField(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
AdvectionChoice opAdvectionChoice(const SOP_NodeVerb::CookParms &cookparms) const
int64 getNumSteps() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setUseMaxSteps(bool val)
static void saveData(std::ostream &os, UT_StringHolder s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setGroup(const UT_StringHolder &val)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
VisRamp getVisRamp() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Vector2D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setVisRamp(VisRamp val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool getDetectRange() const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
bool operator!=(const SOP_VolumeTrailParms &src) const
bool isParmColorRamp(exint idx) const override
Utility class for containing a color ramp.
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & w() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
void setVisEnable(bool val)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setTrailLen(fpreal64 val)
UT_SharedPtr< UT_Ramp > getCdRamp() const
fpreal getCookTime() const
void setVelField(const UT_StringHolder &val)
const char * findChar(int c) const
bool operator==(const SOP_VolumeTrailParms &src) const
AdvectionChoice getAdvectionChoice() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setVisMax(fpreal64 val)
fpreal64 opTrailLen(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE UT_StringHolder getToken(AdvectionChoice enum_value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
fpreal64 getVisMax() const
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
int64 opMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const