23 namespace SOP_TorusEnums
37 using namespace UT::Literal;
62 using namespace UT::Literal;
85 using namespace UT::Literal;
134 if (myType != src.myType)
return false;
135 if (mySurftype != src.mySurftype)
return false;
136 if (myOrient != src.myOrient)
return false;
137 if (myRad != src.myRad)
return false;
138 if (myT != src.myT)
return false;
139 if (myR != src.myR)
return false;
140 if (myScale != src.myScale)
return false;
141 if (myImperfect != src.myImperfect)
return false;
142 if (myOrderu != src.myOrderu)
return false;
143 if (myOrderv != src.myOrderv)
return false;
144 if (myCloseu != src.myCloseu)
return false;
145 if (myClosev != src.myClosev)
return false;
146 if (myCapu != src.myCapu)
return false;
147 if (myCapv != src.myCapv)
return false;
148 if (myRows != src.myRows)
return false;
149 if (myCols != src.myCols)
return false;
150 if (myAngleu != src.myAngleu)
return false;
151 if (myAnglev != src.myAnglev)
return false;
169 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
172 graph->
evalOpParm(mySurftype, nodeidx,
"surftype", time, 0);
175 graph->
evalOpParm(myOrient, nodeidx,
"orient", time, 0);
178 graph->
evalOpParm(myRad, nodeidx,
"rad", time, 0);
181 graph->
evalOpParm(myT, nodeidx,
"t", time, 0);
184 graph->
evalOpParm(myR, nodeidx,
"r", time, 0);
187 graph->
evalOpParm(myScale, nodeidx,
"scale", time, 0);
189 if (
true && ( (
true&&!(((
int64(getType())!=3)&&(
int64(getType())!=2)))) ) )
190 graph->
evalOpParm(myImperfect, nodeidx,
"imperfect", time, 0);
192 if (
true && ( (
true&&!(((
int64(getType())!=3)&&(
int64(getType())!=2)))) ) )
193 graph->
evalOpParm(myOrderu, nodeidx,
"orderu", time, 0);
195 if (
true && ( (
true&&!(((
int64(getType())!=3)&&(
int64(getType())!=2)))) ) )
196 graph->
evalOpParm(myOrderv, nodeidx,
"orderv", time, 0);
198 if (
true && ( (
true&&!(((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
199 graph->
evalOpParm(myCloseu, nodeidx,
"closeu", time, 0);
201 if (
true && ( (
true&&!(((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
202 graph->
evalOpParm(myClosev, nodeidx,
"closev", time, 0);
204 if (
true && ( (
true&&!(((getCloseu()==1))||((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
205 graph->
evalOpParm(myCapu, nodeidx,
"capu", time, 0);
207 if (
true && ( (
true&&!(((getClosev()==1))||((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
208 graph->
evalOpParm(myCapv, nodeidx,
"capv", time, 0);
210 if (
true && ( (
true&&!(((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
211 graph->
evalOpParm(myRows, nodeidx,
"rows", time, 0);
213 if (
true && ( (
true&&!(((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
214 graph->
evalOpParm(myCols, nodeidx,
"cols", time, 0);
216 if (
true && ( (
true&&!(((getCloseu()==1))||((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
217 graph->
evalOpParm(myAngleu, nodeidx,
"angleu", time, 0);
219 if (
true && ( (
true&&!(((getClosev()==1))||((
int64(getType())==2)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
220 graph->
evalOpParm(myAnglev, nodeidx,
"anglev", time, 0);
236 template <
typename T>
243 if (idx.
size() != instance.
size()+1)
248 coerceValue(value, myType);
251 coerceValue(value, mySurftype);
254 coerceValue(value, myOrient);
257 coerceValue(value, myRad);
260 coerceValue(value, myT);
263 coerceValue(value, myR);
266 coerceValue(value, myScale);
269 coerceValue(value, myImperfect);
272 coerceValue(value, myOrderu);
275 coerceValue(value, myOrderv);
278 coerceValue(value, myCloseu);
281 coerceValue(value, myClosev);
284 coerceValue(value, myCapu);
287 coerceValue(value, myCapv);
290 coerceValue(value, myRows);
293 coerceValue(value, myCols);
296 coerceValue(value, myAngleu);
299 coerceValue(value, myAnglev);
315 { doGetParmValue(idx, instance, value); }
317 { doGetParmValue(idx, instance, value); }
319 { doGetParmValue(idx, instance, value); }
321 { doGetParmValue(idx, instance, value); }
323 { doGetParmValue(idx, instance, value); }
325 { doGetParmValue(idx, instance, value); }
327 { doGetParmValue(idx, instance, value); }
329 { doGetParmValue(idx, instance, value); }
331 { doGetParmValue(idx, instance, value); }
333 { doGetParmValue(idx, instance, value); }
335 { doGetParmValue(idx, instance, value); }
337 template <
typename T>
344 if (idx.
size() != instance.
size()+1)
349 coerceValue(myType, clampMinValue(0, clampMaxValue(4, value ) ));
352 coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
355 coerceValue(myOrient, clampMinValue(0, clampMaxValue(2, value ) ));
358 coerceValue(myRad, ( ( value ) ));
361 coerceValue(myT, ( ( value ) ));
364 coerceValue(myR, ( ( value ) ));
367 coerceValue(myScale, ( ( value ) ));
370 coerceValue(myImperfect, ( ( value ) ));
373 coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
376 coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
379 coerceValue(myCloseu, ( ( value ) ));
382 coerceValue(myClosev, ( ( value ) ));
385 coerceValue(myCapu, ( ( value ) ));
388 coerceValue(myCapv, ( ( value ) ));
391 coerceValue(myRows, clampMinValue(3, ( value ) ));
394 coerceValue(myCols, clampMinValue(3, ( value ) ));
397 coerceValue(myAngleu, ( ( value ) ));
400 coerceValue(myAnglev, ( ( value ) ));
407 { doSetParmValue(idx, instance, value); }
409 { doSetParmValue(idx, instance, value); }
411 { doSetParmValue(idx, instance, value); }
413 { doSetParmValue(idx, instance, value); }
415 { doSetParmValue(idx, instance, value); }
417 { doSetParmValue(idx, instance, value); }
419 { doSetParmValue(idx, instance, value); }
421 { doSetParmValue(idx, instance, value); }
423 { doSetParmValue(idx, instance, value); }
425 { doSetParmValue(idx, instance, value); }
427 { doSetParmValue(idx, instance, value); }
443 if (fieldnum.
size() < 1)
490 if (fieldnum.
size() < 1)
491 return PARM_UNSUPPORTED;
532 return PARM_UNSUPPORTED;
568 loadData(is, rampdata);
586 int typelen = colon - data.
buffer();
600 {
int64 iv =
v; UTwrite(os, &iv); }
602 { UTwrite<fpreal64>(os, &
v); }
604 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
606 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
607 UTwrite<fpreal64>(os, &v.
z()); }
609 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
610 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
622 if (s) s->save(ostr);
624 saveData(os, result);
631 ostr << s->getDataTypeToken();
636 saveData(os, result);
640 void save(std::ostream &os)
const
644 saveData(os, myType);
645 saveData(os, mySurftype);
646 saveData(os, myOrient);
650 saveData(os, myScale);
651 saveData(os, myImperfect);
652 saveData(os, myOrderu);
653 saveData(os, myOrderv);
654 saveData(os, myCloseu);
655 saveData(os, myClosev);
656 saveData(os, myCapu);
657 saveData(os, myCapv);
658 saveData(os, myRows);
659 saveData(os, myCols);
660 saveData(os, myAngleu);
661 saveData(os, myAnglev);
674 loadData(is, myType);
675 loadData(is, mySurftype);
676 loadData(is, myOrient);
680 loadData(is, myScale);
681 loadData(is, myImperfect);
682 loadData(is, myOrderu);
683 loadData(is, myOrderv);
684 loadData(is, myCloseu);
685 loadData(is, myClosev);
686 loadData(is, myCapu);
687 loadData(is, myCapv);
688 loadData(is, myRows);
689 loadData(is, myCols);
690 loadData(is, myAngleu);
691 loadData(is, myAnglev);
701 if (!thissop)
return getType();
703 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getSurftype();
713 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getOrient();
723 OP_Utils::evalOpParm(result, thissop,
"orient", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getRad();
733 OP_Utils::evalOpParm(result, thissop,
"rad", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getT();
743 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getR();
753 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
763 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getImperfect();
773 OP_Utils::evalOpParm(result, thissop,
"imperfect", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getOrderu();
783 OP_Utils::evalOpParm(result, thissop,
"orderu", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getOrderv();
793 OP_Utils::evalOpParm(result, thissop,
"orderv", cookparms.
getCookTime(), 0);
801 if (!thissop)
return getCloseu();
803 OP_Utils::evalOpParm(result, thissop,
"closeu", cookparms.
getCookTime(), 0);
811 if (!thissop)
return getClosev();
813 OP_Utils::evalOpParm(result, thissop,
"closev", cookparms.
getCookTime(), 0);
821 if (!thissop)
return getCapu();
823 OP_Utils::evalOpParm(result, thissop,
"capu", cookparms.
getCookTime(), 0);
831 if (!thissop)
return getCapv();
833 OP_Utils::evalOpParm(result, thissop,
"capv", cookparms.
getCookTime(), 0);
841 if (!thissop)
return getRows();
843 OP_Utils::evalOpParm(result, thissop,
"rows", cookparms.
getCookTime(), 0);
851 if (!thissop)
return getCols();
853 OP_Utils::evalOpParm(result, thissop,
"cols", cookparms.
getCookTime(), 0);
861 if (!thissop)
return getAngleu();
863 OP_Utils::evalOpParm(result, thissop,
"angleu", cookparms.
getCookTime(), 0);
871 if (!thissop)
return getAnglev();
873 OP_Utils::evalOpParm(result, thissop,
"anglev", cookparms.
getCookTime(), 0);
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const SOP_TorusParms &src) const
void setT(UT_Vector3D val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_Vector2D opAnglev(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
void setSurftype(Surftype val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
exint bread(int32 *buffer, exint asize=1)
void loadFromOpSubclass(const LoadParms &loadparms) override
GT_API const UT_StringHolder time
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2T< fpreal64 > UT_Vector2D
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const OP_Context & context() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE const char * buffer() const
void setAngleu(UT_Vector2D val)
An output stream object that owns its own string buffer storage.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
**But if you need a result
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
static void saveData(std::ostream &os, bool 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.
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator!=(const SOP_TorusParms &src) const
bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
bool opClosev(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_Vector2D getAnglev() const
static void saveData(std::ostream &os, UT_Matrix2D v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setOrderv(int64 val)
UT_Vector2D getRad() const
const char * getNestParmName(TempIndex fieldnum) const override
void setScale(fpreal64 val)
int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool load(UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
UT_Vector2D opRad(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_Vector2D opAngleu(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
bool getImperfect() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool isParmColorRamp(exint idx) const override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setAnglev(UT_Vector2D val)
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
UT_Vector3T< fpreal64 > UT_Vector3D
void setOrient(Orient val)
void setR(UT_Vector3D val)
fpreal64 getScale() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setImperfect(bool val)
UT_Vector2D getAngleu() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
Surftype opSurftype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, int64 &v)
bool opCapv(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal getCookTime() const
bool opCloseu(const SOP_NodeVerb::CookParms &cookparms) const
Surftype getSurftype() const
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setOrderu(int64 val)
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_StringHolder s)
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool opCapu(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void save(std::ostream &os) const
void setRad(UT_Vector2D val)
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override