23 namespace SOP_SphereEnums
39 using namespace UT::Literal;
66 using namespace UT::Literal;
89 using namespace UT::Literal;
121 myTriangularpoles =
true;
136 if (myType != src.myType)
return false;
137 if (mySurftype != src.mySurftype)
return false;
138 if (myRad != src.myRad)
return false;
139 if (myT != src.myT)
return false;
140 if (myR != src.myR)
return false;
141 if (myScale != src.myScale)
return false;
142 if (myOrient != src.myOrient)
return false;
143 if (myFreq != src.myFreq)
return false;
144 if (myOrderu != src.myOrderu)
return false;
145 if (myOrderv != src.myOrderv)
return false;
146 if (myImperfect != src.myImperfect)
return false;
147 if (myUpole != src.myUpole)
return false;
148 if (myAccurate != src.myAccurate)
return false;
149 if (myTriangularpoles != src.myTriangularpoles)
return false;
150 if (myRows != src.myRows)
return false;
151 if (myCols != src.myCols)
return false;
169 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
171 if (
true && ( (
true&&!(((
int64(getType())==0))||((
int64(getType())==1))||((
int64(getType())==6)))) ) )
172 graph->
evalOpParm(mySurftype, nodeidx,
"surftype", time, 0);
174 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)==1)))) ) )
175 graph->
evalOpParm(myRad, nodeidx,
"rad", time, 0);
177 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)==1)))) ) )
178 graph->
evalOpParm(myT, nodeidx,
"t", time, 0);
181 graph->
evalOpParm(myR, nodeidx,
"r", time, 0);
183 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)==1)))) ) )
184 graph->
evalOpParm(myScale, nodeidx,
"scale", time, 0);
187 graph->
evalOpParm(myOrient, nodeidx,
"orient", time, 0);
189 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=6)))) ) )
190 graph->
evalOpParm(myFreq, nodeidx,
"freq", time, 0);
192 if (
true && ( (
true&&!(((
int64(getType())!=5)&&(
int64(getType())!=4)))) ) )
193 graph->
evalOpParm(myOrderu, nodeidx,
"orderu", time, 0);
195 if (
true && ( (
true&&!(((
int64(getType())!=5)&&(
int64(getType())!=4)))) ) )
196 graph->
evalOpParm(myOrderv, nodeidx,
"orderv", time, 0);
198 if (
true && ( (
true&&!(((
int64(getType())!=5)&&(
int64(getType())!=4)))) ) )
199 graph->
evalOpParm(myImperfect, nodeidx,
"imperfect", time, 0);
201 if (
true && ( (
true&&!(((
int64(getType())!=2)&&(
int64(getType())!=3)))) ) )
202 graph->
evalOpParm(myUpole, nodeidx,
"upole", time, 0);
204 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)==0)))) ) )
205 graph->
evalOpParm(myAccurate, nodeidx,
"accurate", time, 0);
206 myTriangularpoles =
true;
207 if (
true && ( (
true&&!(((
int64(getType())!=2))||((
int64(getType())==2)&&(
int64(getSurftype())!=4)&&(
int64(getSurftype())!=0)&&(
int64(getSurftype())!=1)&&(
int64(getSurftype())!=2)))) ) )
208 graph->
evalOpParm(myTriangularpoles, nodeidx,
"triangularpoles", time, 0);
210 if (
true && ( (
true&&!(((
int64(getType())==0))||((
int64(getType())==1))||((
int64(getType())==6))||((
int64(getType())==4)&&(getImperfect()==0))||((
int64(getType())==5)&&(getImperfect()==0)))) ) )
211 graph->
evalOpParm(myRows, nodeidx,
"rows", time, 0);
213 if (
true && ( (
true&&!(((
int64(getType())==0))||((
int64(getType())==1))||((
int64(getType())==6))||((
int64(getType())==4)&&(getImperfect()==0))||((
int64(getType())==5)&&(getImperfect()==0)))) ) )
214 graph->
evalOpParm(myCols, nodeidx,
"cols", time, 0);
230 template <
typename T>
237 if (idx.
size() != instance.
size()+1)
242 coerceValue(value, myType);
245 coerceValue(value, mySurftype);
248 coerceValue(value, myRad);
251 coerceValue(value, myT);
254 coerceValue(value, myR);
257 coerceValue(value, myScale);
260 coerceValue(value, myOrient);
263 coerceValue(value, myFreq);
266 coerceValue(value, myOrderu);
269 coerceValue(value, myOrderv);
272 coerceValue(value, myImperfect);
275 coerceValue(value, myUpole);
278 coerceValue(value, myAccurate);
281 coerceValue(value, myTriangularpoles);
284 coerceValue(value, myRows);
287 coerceValue(value, myCols);
303 { doGetParmValue(idx, instance, value); }
305 { doGetParmValue(idx, instance, value); }
307 { doGetParmValue(idx, instance, value); }
309 { doGetParmValue(idx, instance, value); }
311 { doGetParmValue(idx, instance, value); }
313 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
332 if (idx.
size() != instance.
size()+1)
337 coerceValue(myType, clampMinValue(0, clampMaxValue(6, value ) ));
340 coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
343 coerceValue(myRad, ( ( value ) ));
346 coerceValue(myT, ( ( value ) ));
349 coerceValue(myR, ( ( value ) ));
352 coerceValue(myScale, ( ( value ) ));
355 coerceValue(myOrient, clampMinValue(0, clampMaxValue(2, value ) ));
358 coerceValue(myFreq, clampMinValue(1, ( value ) ));
361 coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
364 coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
367 coerceValue(myImperfect, ( ( value ) ));
370 coerceValue(myUpole, ( ( value ) ));
373 coerceValue(myAccurate, ( ( value ) ));
376 coerceValue(myTriangularpoles, ( ( value ) ));
379 coerceValue(myRows, clampMinValue(3, ( value ) ));
382 coerceValue(myCols, clampMinValue(3, ( value ) ));
389 { doSetParmValue(idx, instance, value); }
391 { doSetParmValue(idx, instance, value); }
393 { doSetParmValue(idx, instance, value); }
395 { doSetParmValue(idx, instance, value); }
397 { doSetParmValue(idx, instance, value); }
399 { doSetParmValue(idx, instance, value); }
401 { doSetParmValue(idx, instance, value); }
403 { doSetParmValue(idx, instance, value); }
405 { doSetParmValue(idx, instance, value); }
407 { doSetParmValue(idx, instance, value); }
409 { doSetParmValue(idx, instance, value); }
425 if (fieldnum.
size() < 1)
456 return "triangularpoles";
468 if (fieldnum.
size() < 1)
469 return PARM_UNSUPPORTED;
506 return PARM_UNSUPPORTED;
542 loadData(is, rampdata);
560 int typelen = colon - data.
buffer();
574 {
int64 iv =
v; UTwrite(os, &iv); }
576 { UTwrite<fpreal64>(os, &
v); }
578 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
580 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
581 UTwrite<fpreal64>(os, &v.
z()); }
583 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
584 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
596 if (s) s->save(ostr);
598 saveData(os, result);
605 ostr << s->getDataTypeToken();
610 saveData(os, result);
614 void save(std::ostream &os)
const
618 saveData(os, myType);
619 saveData(os, mySurftype);
623 saveData(os, myScale);
624 saveData(os, myOrient);
625 saveData(os, myFreq);
626 saveData(os, myOrderu);
627 saveData(os, myOrderv);
628 saveData(os, myImperfect);
629 saveData(os, myUpole);
630 saveData(os, myAccurate);
631 saveData(os, myTriangularpoles);
632 saveData(os, myRows);
633 saveData(os, myCols);
646 loadData(is, myType);
647 loadData(is, mySurftype);
651 loadData(is, myScale);
652 loadData(is, myOrient);
653 loadData(is, myFreq);
654 loadData(is, myOrderu);
655 loadData(is, myOrderv);
656 loadData(is, myImperfect);
657 loadData(is, myUpole);
658 loadData(is, myAccurate);
659 loadData(is, myTriangularpoles);
660 loadData(is, myRows);
661 loadData(is, myCols);
671 if (!thissop)
return getType();
673 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
681 if (!thissop)
return getSurftype();
683 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
691 if (!thissop)
return getRad();
693 OP_Utils::evalOpParm(result, thissop,
"rad", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getT();
703 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getR();
713 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
723 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getOrient();
733 OP_Utils::evalOpParm(result, thissop,
"orient", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getFreq();
743 OP_Utils::evalOpParm(result, thissop,
"freq", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getOrderu();
753 OP_Utils::evalOpParm(result, thissop,
"orderu", cookparms.
getCookTime(), 0);
761 if (!thissop)
return getOrderv();
763 OP_Utils::evalOpParm(result, thissop,
"orderv", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getImperfect();
773 OP_Utils::evalOpParm(result, thissop,
"imperfect", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getUpole();
783 OP_Utils::evalOpParm(result, thissop,
"upole", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getAccurate();
793 OP_Utils::evalOpParm(result, thissop,
"accurate", cookparms.
getCookTime(), 0);
801 if (!thissop)
return getTriangularpoles();
803 OP_Utils::evalOpParm(result, thissop,
"triangularpoles", cookparms.
getCookTime(), 0);
811 if (!thissop)
return getRows();
813 OP_Utils::evalOpParm(result, thissop,
"rows", cookparms.
getCookTime(), 0);
821 if (!thissop)
return getCols();
823 OP_Utils::evalOpParm(result, thissop,
"cols", cookparms.
getCookTime(), 0);
841 bool myTriangularpoles;
const char * getNestParmName(TempIndex fieldnum) const override
bool opAccurate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_SphereParms &src) const
void setRad(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
const OP_Context & context() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_Vector3D opRad(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_StringHolder s)
Surftype getSurftype() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
void setOrderu(int64 val)
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 getImperfect() const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
int64 opFreq(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setSurftype(Surftype val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void copyFrom(const OP_NodeParms *src) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool getTriangularpoles() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setR(UT_Vector3D val)
ParmType getNestParmType(TempIndex fieldnum) const override
UT_Vector3T< fpreal64 > UT_Vector3D
void setOrderv(int64 val)
void setT(UT_Vector3D val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool opTriangularpoles(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool isParmColorRamp(exint idx) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator==(const SOP_SphereParms &src) const
void setScale(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setTriangularpoles(bool val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
DEP_MicroNode * depnode() const
void setOrient(Orient val)
LeafData & operator=(const LeafData &)=delete
bool opUpole(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
Surftype opSurftype(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
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 doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal getCookTime() const
const char * findChar(int c) const
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
void setAccurate(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
void save(std::ostream &os) const
fpreal64 getScale() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getRad() const
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
void setImperfect(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept