23 namespace SOP_VolumeTrailEnums
51 myAdvectionChoice = 0;
76 if (myGroup != src.myGroup)
return false;
77 if (myVelField != src.myVelField)
return false;
78 if (myAdvectionChoice != src.myAdvectionChoice)
return false;
79 if (myTrailLen != src.myTrailLen)
return false;
80 if (myUseCFL != src.myUseCFL)
return false;
81 if (myCFL != src.myCFL)
return false;
82 if (myNumSteps != src.myNumSteps)
return false;
83 if (myUseMaxSteps != src.myUseMaxSteps)
return false;
84 if (myMaxSteps != src.myMaxSteps)
return false;
85 if (myKeep != src.myKeep)
return false;
86 if (myVisEnable != src.myVisEnable)
return false;
87 if (myDetectRange != src.myDetectRange)
return false;
88 if (myVisMax != src.myVisMax)
return false;
89 if (myVisRamp != src.myVisRamp)
return false;
90 if (myCdRamp != src.myCdRamp)
91 {
if (!myCdRamp || !src.myCdRamp || !(*myCdRamp == *src.myCdRamp))
return false; }
108 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
109 myVelField =
""_UTsh;
111 graph->
evalOpParm(myVelField, nodeidx,
"velfield", time, 0);
112 myAdvectionChoice = 0;
114 graph->
evalOpParm(myAdvectionChoice, nodeidx,
"advectionchoice", time, 0);
117 graph->
evalOpParm(myTrailLen, nodeidx,
"traillen", time, 0);
120 graph->
evalOpParm(myUseCFL, nodeidx,
"usecfl", time, 0);
122 if (
true && ( (
true&&!(((getUseCFL()==0)))) ) )
123 graph->
evalOpParm(myCFL, nodeidx,
"cfl", time, 0);
125 if (
true && ( (
true&&!(((getUseCFL()==1)))) ) )
126 graph->
evalOpParm(myNumSteps, nodeidx,
"numsteps", time, 0);
127 myUseMaxSteps =
true;
129 graph->
evalOpParm(myUseMaxSteps, nodeidx,
"usemaxsteps", time, 0);
131 if (
true && ( (
true&&!(((getUseMaxSteps()==0)))) ) )
132 graph->
evalOpParm(myMaxSteps, nodeidx,
"maxsteps", time, 0);
135 graph->
evalOpParm(myKeep, nodeidx,
"keep", time, 0);
138 graph->
evalOpParm(myVisEnable, nodeidx,
"visenable", time, 0);
139 myDetectRange =
true;
140 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
141 graph->
evalOpParm(myDetectRange, nodeidx,
"detectrange", time, 0);
143 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
144 graph->
evalOpParm(myVisMax, nodeidx,
"vismax", time, 0);
146 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
147 graph->
evalOpParm(myVisRamp, nodeidx,
"visramp", time, 0);
149 if (
true && ( (
true&&!(((getVisEnable()==0))||((
int64(getVisRamp())!=5)))) ) )
150 graph->
evalOpParm(myCdRamp, nodeidx,
"cdramp", time, 0);
166 template <
typename T>
173 if (idx.
size() != instance.
size()+1)
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 { doGetParmValue(idx, instance, value); }
259 template <
typename T>
266 if (idx.
size() != instance.
size()+1)
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
334 { doSetParmValue(idx, instance, value); }
336 { doSetParmValue(idx, instance, value); }
338 { doSetParmValue(idx, instance, value); }
340 { doSetParmValue(idx, instance, value); }
356 if (fieldnum.
size() < 1)
365 return "advectionchoice";
375 return "usemaxsteps";
383 return "detectrange";
397 if (fieldnum.
size() < 1)
398 return PARM_UNSUPPORTED;
452 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
454 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
456 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
469 loadData(is, rampdata);
487 int typelen = colon - data.
buffer();
501 {
int64 iv =
v; UTwrite(os, &iv); }
503 { UTwrite<fpreal64>(os, &
v); }
505 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
507 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
508 UTwrite<fpreal64>(os, &v.
z()); }
510 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
511 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
523 if (s) s->save(ostr);
525 saveData(os, result);
532 ostr << s->getDataTypeToken();
537 saveData(os, result);
541 void save(std::ostream &os)
const
545 saveData(os, myGroup);
546 saveData(os, myVelField);
547 saveData(os, myAdvectionChoice);
548 saveData(os, myTrailLen);
549 saveData(os, myUseCFL);
551 saveData(os, myNumSteps);
552 saveData(os, myUseMaxSteps);
553 saveData(os, myMaxSteps);
554 saveData(os, myKeep);
555 saveData(os, myVisEnable);
556 saveData(os, myDetectRange);
557 saveData(os, myVisMax);
558 saveData(os, myVisRamp);
559 saveData(os, myCdRamp);
572 loadData(is, myGroup);
573 loadData(is, myVelField);
574 loadData(is, myAdvectionChoice);
575 loadData(is, myTrailLen);
576 loadData(is, myUseCFL);
578 loadData(is, myNumSteps);
579 loadData(is, myUseMaxSteps);
580 loadData(is, myMaxSteps);
581 loadData(is, myKeep);
582 loadData(is, myVisEnable);
583 loadData(is, myDetectRange);
584 loadData(is, myVisMax);
585 loadData(is, myVisRamp);
586 loadData(is, myCdRamp);
596 if (!thissop)
return getGroup();
598 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
606 if (!thissop)
return getVelField();
608 OP_Utils::evalOpParm(result, thissop,
"velfield", cookparms.
getCookTime(), 0);
616 if (!thissop)
return getAdvectionChoice();
618 OP_Utils::evalOpParm(result, thissop,
"advectionchoice", cookparms.
getCookTime(), 0);
626 if (!thissop)
return getTrailLen();
628 OP_Utils::evalOpParm(result, thissop,
"traillen", cookparms.
getCookTime(), 0);
636 if (!thissop)
return getUseCFL();
638 OP_Utils::evalOpParm(result, thissop,
"usecfl", cookparms.
getCookTime(), 0);
646 if (!thissop)
return getCFL();
648 OP_Utils::evalOpParm(result, thissop,
"cfl", cookparms.
getCookTime(), 0);
656 if (!thissop)
return getNumSteps();
658 OP_Utils::evalOpParm(result, thissop,
"numsteps", cookparms.
getCookTime(), 0);
666 if (!thissop)
return getUseMaxSteps();
668 OP_Utils::evalOpParm(result, thissop,
"usemaxsteps", cookparms.
getCookTime(), 0);
676 if (!thissop)
return getMaxSteps();
678 OP_Utils::evalOpParm(result, thissop,
"maxsteps", cookparms.
getCookTime(), 0);
686 if (!thissop)
return getKeep();
688 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
696 if (!thissop)
return getVisEnable();
698 OP_Utils::evalOpParm(result, thissop,
"visenable", cookparms.
getCookTime(), 0);
706 if (!thissop)
return getDetectRange();
708 OP_Utils::evalOpParm(result, thissop,
"detectrange", cookparms.
getCookTime(), 0);
716 if (!thissop)
return getVisMax();
718 OP_Utils::evalOpParm(result, thissop,
"vismax", cookparms.
getCookTime(), 0);
726 if (!thissop)
return getVisRamp();
728 OP_Utils::evalOpParm(result, thissop,
"visramp", cookparms.
getCookTime(), 0);
736 if (!thissop)
return getCdRamp();
738 OP_Utils::evalOpParm(result, thissop,
"cdramp", cookparms.
getCookTime(), 0);
745 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
T clampMaxValue(fpreal maxvalue, const T &src) const
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
T clampMinValue(fpreal minvalue, const T &src) const
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
void coerceValue(T &result, const S &src) const
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
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
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)
OP_NodeParms & operator=(const OP_NodeParms &)=default
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