23 namespace SOP_ControlEnums
72 if (snappos != src.
snappos)
return false;
88 for (
int i = 0; i < list.
entries(); i++)
94 buf.
appendSprintf(
"(%f, %f, %f)", list(i).snappos.x(), list(i).snappos.y(), list(i).snappos.z());
115 myShadedMode =
false;
117 mySnapPoints.setSize(0);
130 if (myUseColor != src.myUseColor)
return false;
131 if (myColor != src.myColor)
return false;
132 if (mySize != src.mySize)
return false;
133 if (myCenter != src.myCenter)
return false;
134 if (myRotate != src.myRotate)
return false;
135 if (myUniformScale != src.myUniformScale)
return false;
136 if (myDisplayIcon != src.myDisplayIcon)
return false;
137 if (myControlType != src.myControlType)
return false;
138 if (myOrientation != src.myOrientation)
return false;
139 if (myShadedMode != src.myShadedMode)
return false;
140 if (myPacked != src.myPacked)
return false;
141 if (mySnapPoints != src.mySnapPoints)
return false;
159 graph->
evalOpParm(myUseColor, nodeidx,
"usecolor", time, 0);
162 graph->
evalOpParm(myColor, nodeidx,
"color", time, 0);
165 graph->
evalOpParm(mySize, nodeidx,
"size", time, 0);
168 graph->
evalOpParm(myCenter, nodeidx,
"t", time, 0);
171 graph->
evalOpParm(myRotate, nodeidx,
"r", time, 0);
174 graph->
evalOpParm(myUniformScale, nodeidx,
"scale", time, 0);
177 graph->
evalOpParm(myDisplayIcon, nodeidx,
"displayicon", time, 0);
179 if (
true && ( (
true&&!(((
int64(getDisplayIcon())==1)))) ) )
180 graph->
evalOpParm(myControlType, nodeidx,
"controltype", time, 0);
182 if (
true && ( (
true&&!(((
int64(getDisplayIcon())==1))||((
int64(getDisplayIcon())!=1)&&(
int64(getControlType())!=1)&&(
int64(getControlType())!=3)&&(
int64(getControlType())!=4)&&(
int64(getControlType())!=6)))) ) )
183 graph->
evalOpParm(myOrientation, nodeidx,
"orientation", time, 0);
184 myShadedMode =
false;
186 graph->
evalOpParm(myShadedMode, nodeidx,
"shadedmode", time, 0);
189 graph->
evalOpParm(myPacked, nodeidx,
"packed", time, 0);
193 graph->
evalOpParm(length, nodeidx,
"numsnappoints", time, 0);
194 if (length < 0) length = 0;
195 mySnapPoints.setSize(length);
202 auto && _curentry = mySnapPoints(i);
206 graph->
evalOpParmInst(_curentry.snappos, nodeidx,
"snappos#", parmidx, offsets, time, 0, 2-1);
211 mySnapPoints.clear();
227 template <
typename T>
234 if (idx.
size() != instance.
size()+1)
274 else if (instance[0] < mySnapPoints.entries())
276 auto && _data = mySnapPoints(instance[0]);
300 { doGetParmValue(idx, instance, value); }
302 { doGetParmValue(idx, instance, value); }
304 { doGetParmValue(idx, instance, value); }
306 { doGetParmValue(idx, instance, value); }
308 { doGetParmValue(idx, instance, value); }
310 { doGetParmValue(idx, instance, value); }
312 { doGetParmValue(idx, instance, value); }
314 { doGetParmValue(idx, instance, value); }
316 { doGetParmValue(idx, instance, value); }
318 { doGetParmValue(idx, instance, value); }
320 { doGetParmValue(idx, instance, value); }
322 template <
typename T>
329 if (idx.
size() != instance.
size()+1)
371 if (newsize < 0) newsize = 0;
372 mySnapPoints.setSize(newsize);
378 mySnapPoints.setSizeIfNeeded(instance[0]+1);
379 auto && _data = mySnapPoints(instance[0]);
394 { doSetParmValue(idx, instance, value); }
396 { doSetParmValue(idx, instance, value); }
398 { doSetParmValue(idx, instance, value); }
400 { doSetParmValue(idx, instance, value); }
402 { doSetParmValue(idx, instance, value); }
404 { doSetParmValue(idx, instance, value); }
406 { doSetParmValue(idx, instance, value); }
408 { doSetParmValue(idx, instance, value); }
410 { doSetParmValue(idx, instance, value); }
412 { doSetParmValue(idx, instance, value); }
414 { doSetParmValue(idx, instance, value); }
432 if (fieldnum.
size() < 1)
449 return "displayicon";
451 return "controltype";
453 return "orientation";
459 if (fieldnum.
size() == 1)
460 return "numsnappoints";
475 if (fieldnum.
size() < 1)
476 return PARM_UNSUPPORTED;
502 if (fieldnum.
size() == 1)
503 return PARM_MULTIPARM;
532 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
534 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
536 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
549 loadData(is, rampdata);
567 int typelen = colon - data.
buffer();
581 {
int64 iv =
v; UTwrite(os, &iv); }
583 { UTwrite<fpreal64>(os, &
v); }
585 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
587 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
588 UTwrite<fpreal64>(os, &v.
z()); }
590 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
591 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
603 if (s) s->save(ostr);
605 saveData(os, result);
612 ostr << s->getDataTypeToken();
617 saveData(os, result);
621 void save(std::ostream &os)
const
625 saveData(os, myUseColor);
626 saveData(os, myColor);
627 saveData(os, mySize);
628 saveData(os, myCenter);
629 saveData(os, myRotate);
630 saveData(os, myUniformScale);
631 saveData(os, myDisplayIcon);
632 saveData(os, myControlType);
633 saveData(os, myOrientation);
634 saveData(os, myShadedMode);
635 saveData(os, myPacked);
638 UTwrite(os, &length);
641 auto && _curentry = mySnapPoints(i);
643 saveData(os, _curentry.snappos);
659 loadData(is, myUseColor);
660 loadData(is, myColor);
661 loadData(is, mySize);
662 loadData(is, myCenter);
663 loadData(is, myRotate);
664 loadData(is, myUniformScale);
665 loadData(is, myDisplayIcon);
666 loadData(is, myControlType);
667 loadData(is, myOrientation);
668 loadData(is, myShadedMode);
669 loadData(is, myPacked);
673 mySnapPoints.setSize(length);
676 auto && _curentry = mySnapPoints(i);
678 loadData(is, _curentry.snappos);
691 if (!thissop)
return getUseColor();
693 OP_Utils::evalOpParm(result, thissop,
"usecolor", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getColor();
703 OP_Utils::evalOpParm(result, thissop,
"color", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getSize();
713 OP_Utils::evalOpParm(result, thissop,
"size", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getCenter();
723 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getRotate();
733 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getUniformScale();
743 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getDisplayIcon();
753 OP_Utils::evalOpParm(result, thissop,
"displayicon", cookparms.
getCookTime(), 0);
761 if (!thissop)
return getControlType();
763 OP_Utils::evalOpParm(result, thissop,
"controltype", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getOrientation();
773 OP_Utils::evalOpParm(result, thissop,
"orientation", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getShadedMode();
783 OP_Utils::evalOpParm(result, thissop,
"shadedmode", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getPacked();
793 OP_Utils::evalOpParm(result, thissop,
"packed", cookparms.
getCookTime(), 0);
801 if (!thissop)
return getSnapPoints().entries();
803 OP_Utils::evalOpParm(result, thissop,
"numsnappoints", cookparms.
getCookTime(), 0);
807 {
return opinstSnapPoints_snappos(cookparms, &_idx); }
811 if (!thissop)
return (mySnapPoints(_idx[0]).snappos);
813 _parmidx[1-1] = _idx[1-1] + 1;
816 OP_Utils::evalOpParmInst(result, thissop,
"snappos#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
static void loadData(UT_IStream &is, UT_Vector4D &v)
DisplayIcon opDisplayIcon(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLenum GLuint GLenum GLsizei const GLchar * buf
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_StringHolder s)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool operator!=(const SOP_ControlParms &src) const
UT_Vector3D getRotate() const
void copyFrom(const OP_NodeParms *src) override
T clampMaxValue(fpreal maxvalue, const T &src) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setCenter(UT_Vector3D val)
void setSnapPoints(const UT_Array< SnapPoints > &val)
void setUseColor(bool val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
UT_Vector3D getSize() const
bool isParmColorRamp(exint idx) const override
GLuint GLsizei GLsizei * length
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
An output stream object that owns its own string buffer storage.
**But if you need a result
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
Orientation getOrientation() const
T clampMinValue(fpreal minvalue, const T &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
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, UT_Vector4D v)
UT_StringHolder createString(const UT_Array< SnapPoints > &list) const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, int64 &v)
bool opShadedMode(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_Vector3D opRotate(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opColor(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SnapPoints &src) const
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool load(UT_IStream &is)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
bool operator==(const SnapPoints &src) const
const UT_Array< SnapPoints > & getSnapPoints() const
exint read(bool *array, exint sz=1)
static void saveData(std::ostream &os, UT_Matrix3D v)
const OP_GraphProxy * graph() const
fpreal64 opUniformScale(const SOP_NodeVerb::CookParms &cookparms) const
ControlType getControlType() const
void save(std::ostream &os) const
exint opSnapPoints(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setUniformScale(fpreal64 val)
exint getNestNumParms(TempIndex idx) const override
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_Vector3D opinstSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, bool v)
UT_Vector3T< fpreal64 > UT_Vector3D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_Vector3D opCenter(const SOP_NodeVerb::CookParms &cookparms) const
Orientation opOrientation(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getColor() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
SYS_FORCE_INLINE void strcat(const char *src)
bool opUseColor(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
void setSize(UT_Vector3D val)
bool opPacked(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setOrientation(Orientation val)
UT_Vector3D opSize(const SOP_NodeVerb::CookParms &cookparms) const
void coerceValue(T &result, const S &src) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
DEP_MicroNode * depnode() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
Utility class for containing a color ramp.
void setControlType(ControlType val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void setRotate(UT_Vector3D val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator==(const SOP_ControlParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
fpreal getCookTime() const
ParmType getNestParmType(TempIndex fieldnum) const override
const char * findChar(int c) const
void setShadedMode(bool val)
fpreal64 getUniformScale() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Vector2D v)
void setColor(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setDisplayIcon(DisplayIcon val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
bool getShadedMode() const
DisplayIcon getDisplayIcon() const
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_Vector3D opSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_Vector3D getCenter() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
ControlType opControlType(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept