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; }
139 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
140 myVelField =
""_UTsh;
142 graph->
evalOpParm(myVelField, nodeidx,
"velfield", time, graph->
isDirect()?
nullptr:depnode);
143 myAdvectionChoice = 0;
145 graph->
evalOpParm(myAdvectionChoice, nodeidx,
"advectionchoice", time, graph->
isDirect()?
nullptr:depnode);
148 graph->
evalOpParm(myTrailLen, nodeidx,
"traillen", time, graph->
isDirect()?
nullptr:depnode);
151 graph->
evalOpParm(myUseCFL, nodeidx,
"usecfl", time, graph->
isDirect()?
nullptr:depnode);
153 if (
true && ( (
true&&!(((getUseCFL()==0)))) ) )
156 if (
true && ( (
true&&!(((getUseCFL()==1)))) ) )
157 graph->
evalOpParm(myNumSteps, nodeidx,
"numsteps", time, graph->
isDirect()?
nullptr:depnode);
158 myUseMaxSteps =
true;
160 graph->
evalOpParm(myUseMaxSteps, nodeidx,
"usemaxsteps", time, graph->
isDirect()?
nullptr:depnode);
162 if (
true && ( (
true&&!(((getUseMaxSteps()==0)))) ) )
163 graph->
evalOpParm(myMaxSteps, nodeidx,
"maxsteps", time, graph->
isDirect()?
nullptr:depnode);
169 graph->
evalOpParm(myVisEnable, nodeidx,
"visenable", time, graph->
isDirect()?
nullptr:depnode);
170 myDetectRange =
true;
171 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
172 graph->
evalOpParm(myDetectRange, nodeidx,
"detectrange", time, graph->
isDirect()?
nullptr:depnode);
174 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
175 graph->
evalOpParm(myVisMax, nodeidx,
"vismax", time, graph->
isDirect()?
nullptr:depnode);
177 if (
true && ( (
true&&!(((getVisEnable()==0)))) ) )
178 graph->
evalOpParm(myVisRamp, nodeidx,
"visramp", time, graph->
isDirect()?
nullptr:depnode);
180 if (
true && ( (
true&&!(((getVisEnable()==0))||((
int64(getVisRamp())!=5)))) ) )
181 graph->
evalOpParm(myCdRamp, nodeidx,
"cdramp", time, graph->
isDirect()?
nullptr:depnode);
197 template <
typename T>
204 if (idx.
size() != instance.
size()+1)
209 coerceValue(value, myGroup);
212 coerceValue(value, myVelField);
215 coerceValue(value, myAdvectionChoice);
218 coerceValue(value, myTrailLen);
221 coerceValue(value, myUseCFL);
224 coerceValue(value, myCFL);
227 coerceValue(value, myNumSteps);
230 coerceValue(value, myUseMaxSteps);
233 coerceValue(value, myMaxSteps);
236 coerceValue(value, myKeep);
239 coerceValue(value, myVisEnable);
242 coerceValue(value, myDetectRange);
245 coerceValue(value, myVisMax);
248 coerceValue(value, myVisRamp);
251 coerceValue(value, myCdRamp);
268 { doGetParmValue(idx, instance, value); }
270 { doGetParmValue(idx, instance, value); }
272 { doGetParmValue(idx, instance, value); }
274 { doGetParmValue(idx, instance, value); }
276 { doGetParmValue(idx, instance, value); }
278 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
297 if (idx.
size() != instance.
size()+1)
302 coerceValue(myGroup, ( ( value ) ));
305 coerceValue(myVelField, ( ( value ) ));
308 coerceValue(myAdvectionChoice, clampMinValue(0, clampMaxValue(1, value ) ));
311 coerceValue(myTrailLen, ( ( value ) ));
314 coerceValue(myUseCFL, ( ( value ) ));
317 coerceValue(myCFL, ( ( value ) ));
320 coerceValue(myNumSteps, clampMinValue(1, ( value ) ));
323 coerceValue(myUseMaxSteps, ( ( value ) ));
326 coerceValue(myMaxSteps, clampMinValue(1, ( value ) ));
329 coerceValue(myKeep, ( ( value ) ));
332 coerceValue(myVisEnable, ( ( value ) ));
335 coerceValue(myDetectRange, ( ( value ) ));
338 coerceValue(myVisMax, ( ( value ) ));
341 coerceValue(myVisRamp, clampMinValue(0, clampMaxValue(5, value ) ));
344 coerceValue(myCdRamp, clampMinValue(1, ( value ) ));
351 { doSetParmValue(idx, instance, value); }
353 { doSetParmValue(idx, instance, value); }
355 { doSetParmValue(idx, instance, value); }
357 { doSetParmValue(idx, instance, value); }
359 { doSetParmValue(idx, instance, value); }
361 { doSetParmValue(idx, instance, value); }
363 { doSetParmValue(idx, instance, value); }
365 { doSetParmValue(idx, instance, value); }
367 { doSetParmValue(idx, instance, value); }
369 { doSetParmValue(idx, instance, value); }
371 { doSetParmValue(idx, instance, value); }
387 if (fieldnum.
size() < 1)
396 return "advectionchoice";
406 return "usemaxsteps";
414 return "detectrange";
428 if (fieldnum.
size() < 1)
429 return PARM_UNSUPPORTED;
464 return PARM_UNSUPPORTED;
500 loadData(is, rampdata);
518 int typelen = colon - data.
buffer();
532 {
int64 iv =
v; UTwrite(os, &iv); }
534 { UTwrite<fpreal64>(os, &
v); }
536 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
538 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
539 UTwrite<fpreal64>(os, &v.
z()); }
541 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
542 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
554 if (s) s->save(ostr);
556 saveData(os, result);
563 ostr << s->getDataTypeToken();
568 saveData(os, result);
572 void save(std::ostream &os)
const
576 saveData(os, myGroup);
577 saveData(os, myVelField);
578 saveData(os, myAdvectionChoice);
579 saveData(os, myTrailLen);
580 saveData(os, myUseCFL);
582 saveData(os, myNumSteps);
583 saveData(os, myUseMaxSteps);
584 saveData(os, myMaxSteps);
585 saveData(os, myKeep);
586 saveData(os, myVisEnable);
587 saveData(os, myDetectRange);
588 saveData(os, myVisMax);
589 saveData(os, myVisRamp);
590 saveData(os, myCdRamp);
603 loadData(is, myGroup);
604 loadData(is, myVelField);
605 loadData(is, myAdvectionChoice);
606 loadData(is, myTrailLen);
607 loadData(is, myUseCFL);
609 loadData(is, myNumSteps);
610 loadData(is, myUseMaxSteps);
611 loadData(is, myMaxSteps);
612 loadData(is, myKeep);
613 loadData(is, myVisEnable);
614 loadData(is, myDetectRange);
615 loadData(is, myVisMax);
616 loadData(is, myVisRamp);
617 loadData(is, myCdRamp);
627 if (!thissop)
return getGroup();
629 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getVelField();
639 OP_Utils::evalOpParm(result, thissop,
"velfield", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getAdvectionChoice();
649 OP_Utils::evalOpParm(result, thissop,
"advectionchoice", cookparms.
getCookTime(), 0);
657 if (!thissop)
return getTrailLen();
659 OP_Utils::evalOpParm(result, thissop,
"traillen", cookparms.
getCookTime(), 0);
667 if (!thissop)
return getUseCFL();
669 OP_Utils::evalOpParm(result, thissop,
"usecfl", cookparms.
getCookTime(), 0);
677 if (!thissop)
return getCFL();
679 OP_Utils::evalOpParm(result, thissop,
"cfl", cookparms.
getCookTime(), 0);
687 if (!thissop)
return getNumSteps();
689 OP_Utils::evalOpParm(result, thissop,
"numsteps", cookparms.
getCookTime(), 0);
697 if (!thissop)
return getUseMaxSteps();
699 OP_Utils::evalOpParm(result, thissop,
"usemaxsteps", cookparms.
getCookTime(), 0);
707 if (!thissop)
return getMaxSteps();
709 OP_Utils::evalOpParm(result, thissop,
"maxsteps", cookparms.
getCookTime(), 0);
717 if (!thissop)
return getKeep();
719 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
727 if (!thissop)
return getVisEnable();
729 OP_Utils::evalOpParm(result, thissop,
"visenable", cookparms.
getCookTime(), 0);
737 if (!thissop)
return getDetectRange();
739 OP_Utils::evalOpParm(result, thissop,
"detectrange", cookparms.
getCookTime(), 0);
747 if (!thissop)
return getVisMax();
749 OP_Utils::evalOpParm(result, thissop,
"vismax", cookparms.
getCookTime(), 0);
757 if (!thissop)
return getVisRamp();
759 OP_Utils::evalOpParm(result, thissop,
"visramp", cookparms.
getCookTime(), 0);
767 if (!thissop)
return getCdRamp();
769 OP_Utils::evalOpParm(result, thissop,
"cdramp", cookparms.
getCookTime(), 0);
776 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)
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
virtual UT_StringHolder baseGetSignature() const
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)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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