23 namespace SOP_AttribFromVolumeEnums
35 using namespace UT::Literal;
53 using namespace UT::Literal;
75 using namespace UT::Literal;
97 using namespace UT::Literal;
118 using namespace UT::Literal;
119 switch (enum_value) {
143 myCreateVarMap =
false;
149 myMonoEnable =
false;
153 myVectorEnable =
false;
154 myVectorRampMode = 0;
170 if (myGroup != src.myGroup)
return false;
171 if (myField != src.myField)
return false;
172 if (myName != src.myName)
return false;
173 if (myCreateVarMap != src.myCreateVarMap)
return false;
174 if (myVarName != src.myVarName)
return false;
175 if (myType != src.myType)
return false;
176 if (mySize != src.mySize)
return false;
177 if (myDefault != src.myDefault)
return false;
178 if (myRangeIn != src.myRangeIn)
return false;
179 if (myMonoEnable != src.myMonoEnable)
return false;
180 if (myMonoRampMode != src.myMonoRampMode)
return false;
181 if (myMonopreset != src.myMonopreset)
return false;
182 if (myMonoRamp != src.myMonoRamp)
183 {
if (!myMonoRamp || !src.myMonoRamp || !(*myMonoRamp == *src.myMonoRamp))
return false; }
184 if (myVectorEnable != src.myVectorEnable)
return false;
185 if (myVectorRampMode != src.myVectorRampMode)
return false;
186 if (myVectorpreset != src.myVectorpreset)
return false;
187 if (myVectorRamp != src.myVectorRamp)
188 {
if (!myVectorRamp || !src.myVectorRamp || !(*myVectorRamp == *src.myVectorRamp))
return false; }
189 if (myRangeOut != src.myRangeOut)
return false;
209 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
212 graph->
evalOpParm(myField, nodeidx,
"field", time, 0);
215 graph->
evalOpParm(myName, nodeidx,
"name", time, 0);
216 myCreateVarMap =
false;
218 graph->
evalOpParm(myCreateVarMap, nodeidx,
"createvarmap", time, 0);
220 if (
true && ( (
true&&!(((getCreateVarMap()==0)))) ) )
221 graph->
evalOpParm(myVarName, nodeidx,
"varname", time, 0);
224 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
227 graph->
evalOpParm(mySize, nodeidx,
"size", time, 0);
230 graph->
evalOpParm(myDefault, nodeidx,
"default", time, 0);
233 graph->
evalOpParm(myRangeIn, nodeidx,
"rangein", time, 0);
234 myMonoEnable =
false;
236 graph->
evalOpParm(myMonoEnable, nodeidx,
"monoenable", time, 0);
238 if (
true && ( (
true&&!(((getMonoEnable()==0)))) ) )
239 graph->
evalOpParm(myMonoRampMode, nodeidx,
"monorampmode", time, 0);
241 if (
true && ( (
true&&!(((getMonoEnable()==0)))) ) )
242 graph->
evalOpParm(myMonopreset, nodeidx,
"monopreset", time, 0);
244 if (
true && ( (
true&&!(((getMonoEnable()==0)))) ) )
245 graph->
evalOpParm(myMonoRamp, nodeidx,
"monoramp", time, 0);
246 myVectorEnable =
false;
248 graph->
evalOpParm(myVectorEnable, nodeidx,
"vectorenable", time, 0);
249 myVectorRampMode = 0;
250 if (
true && ( (
true&&!(((getVectorEnable()==0)))) ) )
251 graph->
evalOpParm(myVectorRampMode, nodeidx,
"vectorrampmode", time, 0);
253 if (
true && ( (
true&&!(((getVectorEnable()==0)))) ) )
254 graph->
evalOpParm(myVectorpreset, nodeidx,
"vectorpreset", time, 0);
256 if (
true && ( (
true&&!(((getVectorEnable()==0)))) ) )
257 graph->
evalOpParm(myVectorRamp, nodeidx,
"vectorramp", time, 0);
260 graph->
evalOpParm(myRangeOut, nodeidx,
"rangeout", time, 0);
276 template <
typename T>
283 if (idx.
size() != instance.
size()+1)
288 coerceValue(value, myGroup);
291 coerceValue(value, myField);
294 coerceValue(value, myName);
297 coerceValue(value, myCreateVarMap);
300 coerceValue(value, myVarName);
303 coerceValue(value, myType);
306 coerceValue(value, mySize);
309 coerceValue(value, myDefault);
312 coerceValue(value, myRangeIn);
315 coerceValue(value, myMonoEnable);
318 coerceValue(value, myMonoRampMode);
321 coerceValue(value, myMonopreset);
324 coerceValue(value, myMonoRamp);
327 coerceValue(value, myVectorEnable);
330 coerceValue(value, myVectorRampMode);
333 coerceValue(value, myVectorpreset);
336 coerceValue(value, myVectorRamp);
339 coerceValue(value, myRangeOut);
356 { doGetParmValue(idx, instance, value); }
358 { doGetParmValue(idx, instance, value); }
360 { doGetParmValue(idx, instance, value); }
362 { doGetParmValue(idx, instance, value); }
364 { doGetParmValue(idx, instance, value); }
366 { doGetParmValue(idx, instance, value); }
368 { doGetParmValue(idx, instance, value); }
370 { doGetParmValue(idx, instance, value); }
372 { doGetParmValue(idx, instance, value); }
374 { doGetParmValue(idx, instance, value); }
376 { doGetParmValue(idx, instance, value); }
378 template <
typename T>
385 if (idx.
size() != instance.
size()+1)
390 coerceValue(myGroup, ( ( value ) ));
393 coerceValue(myField, ( ( value ) ));
396 coerceValue(myName, ( ( value ) ));
399 coerceValue(myCreateVarMap, ( ( value ) ));
402 coerceValue(myVarName, ( ( value ) ));
405 coerceValue(myType, clampMinValue(0, clampMaxValue(2, value ) ));
408 coerceValue(mySize, clampMinValue(1, ( value ) ));
411 coerceValue(myDefault, ( ( value ) ));
414 coerceValue(myRangeIn, ( ( value ) ));
417 coerceValue(myMonoEnable, ( ( value ) ));
420 coerceValue(myMonoRampMode, clampMinValue(0, clampMaxValue(1, value ) ));
423 coerceValue(myMonopreset, clampMinValue(0, clampMaxValue(6, value ) ));
426 coerceValue(myMonoRamp, clampMinValue(1, ( value ) ));
429 coerceValue(myVectorEnable, ( ( value ) ));
432 coerceValue(myVectorRampMode, clampMinValue(0, clampMaxValue(1, value ) ));
435 coerceValue(myVectorpreset, clampMinValue(0, clampMaxValue(5, value ) ));
438 coerceValue(myVectorRamp, clampMinValue(1, ( value ) ));
441 coerceValue(myRangeOut, ( ( value ) ));
448 { doSetParmValue(idx, instance, value); }
450 { doSetParmValue(idx, instance, value); }
452 { doSetParmValue(idx, instance, value); }
454 { doSetParmValue(idx, instance, value); }
456 { doSetParmValue(idx, instance, value); }
458 { doSetParmValue(idx, instance, value); }
460 { doSetParmValue(idx, instance, value); }
462 { doSetParmValue(idx, instance, value); }
464 { doSetParmValue(idx, instance, value); }
466 { doSetParmValue(idx, instance, value); }
468 { doSetParmValue(idx, instance, value); }
484 if (fieldnum.
size() < 1)
495 return "createvarmap";
509 return "monorampmode";
515 return "vectorenable";
517 return "vectorrampmode";
519 return "vectorpreset";
531 if (fieldnum.
size() < 1)
532 return PARM_UNSUPPORTED;
573 return PARM_UNSUPPORTED;
609 loadData(is, rampdata);
627 int typelen = colon - data.
buffer();
641 {
int64 iv =
v; UTwrite(os, &iv); }
643 { UTwrite<fpreal64>(os, &
v); }
645 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
647 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
648 UTwrite<fpreal64>(os, &v.
z()); }
650 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
651 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
663 if (s) s->save(ostr);
665 saveData(os, result);
672 ostr << s->getDataTypeToken();
677 saveData(os, result);
681 void save(std::ostream &os)
const
685 saveData(os, myGroup);
686 saveData(os, myField);
687 saveData(os, myName);
688 saveData(os, myCreateVarMap);
689 saveData(os, myVarName);
690 saveData(os, myType);
691 saveData(os, mySize);
692 saveData(os, myDefault);
693 saveData(os, myRangeIn);
694 saveData(os, myMonoEnable);
695 saveData(os, myMonoRampMode);
696 saveData(os, myMonopreset);
697 saveData(os, myMonoRamp);
698 saveData(os, myVectorEnable);
699 saveData(os, myVectorRampMode);
700 saveData(os, myVectorpreset);
701 saveData(os, myVectorRamp);
702 saveData(os, myRangeOut);
715 loadData(is, myGroup);
716 loadData(is, myField);
717 loadData(is, myName);
718 loadData(is, myCreateVarMap);
719 loadData(is, myVarName);
720 loadData(is, myType);
721 loadData(is, mySize);
722 loadData(is, myDefault);
723 loadData(is, myRangeIn);
724 loadData(is, myMonoEnable);
725 loadData(is, myMonoRampMode);
726 loadData(is, myMonopreset);
727 loadData(is, myMonoRamp);
728 loadData(is, myVectorEnable);
729 loadData(is, myVectorRampMode);
730 loadData(is, myVectorpreset);
731 loadData(is, myVectorRamp);
732 loadData(is, myRangeOut);
742 if (!thissop)
return getGroup();
744 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
752 if (!thissop)
return getField();
754 OP_Utils::evalOpParm(result, thissop,
"field", cookparms.
getCookTime(), 0);
762 if (!thissop)
return getName();
764 OP_Utils::evalOpParm(result, thissop,
"name", cookparms.
getCookTime(), 0);
772 if (!thissop)
return getCreateVarMap();
774 OP_Utils::evalOpParm(result, thissop,
"createvarmap", cookparms.
getCookTime(), 0);
782 if (!thissop)
return getVarName();
784 OP_Utils::evalOpParm(result, thissop,
"varname", cookparms.
getCookTime(), 0);
792 if (!thissop)
return getType();
794 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
802 if (!thissop)
return getSize();
804 OP_Utils::evalOpParm(result, thissop,
"size", cookparms.
getCookTime(), 0);
814 OP_Utils::evalOpParm(result, thissop,
"default", cookparms.
getCookTime(), 0);
822 if (!thissop)
return getRangeIn();
824 OP_Utils::evalOpParm(result, thissop,
"rangein", cookparms.
getCookTime(), 0);
832 if (!thissop)
return getMonoEnable();
834 OP_Utils::evalOpParm(result, thissop,
"monoenable", cookparms.
getCookTime(), 0);
842 if (!thissop)
return getMonoRampMode();
844 OP_Utils::evalOpParm(result, thissop,
"monorampmode", cookparms.
getCookTime(), 0);
852 if (!thissop)
return getMonopreset();
854 OP_Utils::evalOpParm(result, thissop,
"monopreset", cookparms.
getCookTime(), 0);
862 if (!thissop)
return getMonoRamp();
864 OP_Utils::evalOpParm(result, thissop,
"monoramp", cookparms.
getCookTime(), 0);
872 if (!thissop)
return getVectorEnable();
874 OP_Utils::evalOpParm(result, thissop,
"vectorenable", cookparms.
getCookTime(), 0);
882 if (!thissop)
return getVectorRampMode();
884 OP_Utils::evalOpParm(result, thissop,
"vectorrampmode", cookparms.
getCookTime(), 0);
892 if (!thissop)
return getVectorpreset();
894 OP_Utils::evalOpParm(result, thissop,
"vectorpreset", cookparms.
getCookTime(), 0);
902 if (!thissop)
return getVectorRamp();
904 OP_Utils::evalOpParm(result, thissop,
"vectorramp", cookparms.
getCookTime(), 0);
912 if (!thissop)
return getRangeOut();
914 OP_Utils::evalOpParm(result, thissop,
"rangeout", cookparms.
getCookTime(), 0);
929 int64 myMonoRampMode;
933 int64 myVectorRampMode;
934 int64 myVectorpreset;
UT_SharedPtr< UT_Ramp > opVectorRamp(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector4D getDefault() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setVectorRamp(UT_SharedPtr< UT_Ramp > val)
SOP_Node * getNode() const
void save(std::ostream &os) const
void setMonoRamp(UT_SharedPtr< UT_Ramp > val)
exint getNestNumParms(TempIndex idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_SharedPtr< UT_Ramp > opMonoRamp(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opRangeOut(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool getCreateVarMap() const
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_Vector2T< fpreal64 > UT_Vector2D
static void saveData(std::ostream &os, UT_Matrix4D v)
void setMonoEnable(bool val)
UT_StringHolder opVarName(const SOP_NodeVerb::CookParms &cookparms) const
MonoRampMode opMonoRampMode(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void loadData(UT_IStream &is, int64 &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setMonoRampMode(MonoRampMode val)
SYS_FORCE_INLINE const char * buffer() const
UT_Vector2D getRangeIn() const
UT_SharedPtr< UT_Ramp > getMonoRamp() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setVectorEnable(bool val)
**But if you need a result
UT_Vector4D opDefault(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector4D &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setName(const UT_StringHolder &val)
SOP_AttribFromVolumeParms()
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
Vectorpreset opVectorpreset(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_Vector2D opRangeIn(const SOP_NodeVerb::CookParms &cookparms) const
bool opCreateVarMap(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void setMonopreset(Monopreset val)
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & getName() const
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
void setVectorRampMode(VectorRampMode val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_GraphProxy * graph() const
bool getVectorEnable() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const UT_StringHolder & getGroup() const
void setRangeIn(UT_Vector2D val)
UT_StringHolder opField(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
int64 opSize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setVarName(const UT_StringHolder &val)
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, UT_Vector3D v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, int64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Vectorpreset getVectorpreset() const
static void saveData(std::ostream &os, UT_Matrix3D v)
GT_API const UT_StringHolder version
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool operator==(const SOP_AttribFromVolumeParms &src) const
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
bool opVectorEnable(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getRangeOut() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setField(const UT_StringHolder &val)
UT_StringHolder opName(const SOP_NodeVerb::CookParms &cookparms) const
void setVectorpreset(Vectorpreset val)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, bool v)
VectorRampMode getVectorRampMode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setCreateVarMap(bool val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
bool operator!=(const SOP_AttribFromVolumeParms &src) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
Utility class for containing a color ramp.
const char * getNestParmName(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, fpreal64 v)
fpreal getCookTime() const
MonoRampMode getMonoRampMode() const
Monopreset getMonopreset() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opMonoEnable(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
const char * findChar(int c) const
const UT_StringHolder & getVarName() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
const UT_GeometryPredicates< REAL, false, true > & getDefault()
static void loadData(UT_IStream &is, UT_Vector3I &v)
UT_Vector4T< fpreal64 > UT_Vector4D
constexpr SYS_FORCE_INLINE T & y() noexcept
const UT_StringHolder & getField() const
VectorRampMode opVectorRampMode(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< UT_Ramp > getVectorRamp() const
bool getMonoEnable() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
Monopreset opMonopreset(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setRangeOut(UT_Vector2D val)
static void saveData(std::ostream &os, UT_StringHolder s)
void setDefault(UT_Vector4D val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept