23 namespace SOP_TubeEnums
38 using namespace UT::Literal;
64 using namespace UT::Literal;
87 using namespace UT::Literal;
110 myConsolidatepts =
true;
111 myVertexnormals =
false;
134 if (myType != src.myType)
return false;
135 if (mySurftype != src.mySurftype)
return false;
136 if (myOrient != src.myOrient)
return false;
137 if (myCap != src.myCap)
return false;
138 if (myConsolidatepts != src.myConsolidatepts)
return false;
139 if (myVertexnormals != src.myVertexnormals)
return false;
140 if (myT != src.myT)
return false;
141 if (myR != src.myR)
return false;
142 if (myRad != src.myRad)
return false;
143 if (myRadscale != src.myRadscale)
return false;
144 if (myHeight != src.myHeight)
return false;
145 if (myRows != src.myRows)
return false;
146 if (myOrderu != src.myOrderu)
return false;
147 if (myOrderv != src.myOrderv)
return false;
148 if (myImperfect != src.myImperfect)
return false;
149 if (myCols != src.myCols)
return false;
167 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
169 if (
true && ( (
true&&!(((
int64(getType())==0)))) ) )
170 graph->
evalOpParm(mySurftype, nodeidx,
"surftype", time, 0);
173 graph->
evalOpParm(myOrient, nodeidx,
"orient", time, 0);
176 graph->
evalOpParm(myCap, nodeidx,
"cap", time, 0);
177 myConsolidatepts =
true;
178 if (
true && ( (
true&&!(((getCap()==0))||((
int64(getType())!=1)&&(
int64(getType())!=5)))) ) )
179 graph->
evalOpParm(myConsolidatepts, nodeidx,
"consolidatepts", time, 0);
180 myVertexnormals =
false;
182 graph->
evalOpParm(myVertexnormals, nodeidx,
"vertexnormals", time, 0);
184 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)!=0)))) ) )
185 graph->
evalOpParm(myT, nodeidx,
"t", time, 0);
187 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)!=0)))) ) )
188 graph->
evalOpParm(myR, nodeidx,
"r", time, 0);
190 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)!=0)))) ) )
191 graph->
evalOpParm(myRad, nodeidx,
"rad", time, 0);
193 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)!=0)))) ) )
194 graph->
evalOpParm(myRadscale, nodeidx,
"radscale", time, 0);
196 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,0)>=0)!=0)))) ) )
197 graph->
evalOpParm(myHeight, nodeidx,
"height", time, 0);
199 if (
true && ( (
true&&!(((
int64(getType())==0)))) ) )
200 graph->
evalOpParm(myRows, nodeidx,
"rows", time, 0);
202 if (
true && ( (
true&&!(((
int64(getType())!=3)&&(
int64(getType())!=4)))) ) )
203 graph->
evalOpParm(myOrderu, nodeidx,
"orderu", time, 0);
205 if (
true && ( (
true&&!(((
int64(getType())!=3)&&(
int64(getType())!=4)))) ) )
206 graph->
evalOpParm(myOrderv, nodeidx,
"orderv", time, 0);
208 if (
true && ( (
true&&!(((
int64(getType())!=3)&&(
int64(getType())!=4)))) ) )
209 graph->
evalOpParm(myImperfect, nodeidx,
"imperfect", time, 0);
211 if (
true && ( (
true&&!(((
int64(getType())==0))||((
int64(getType())==4)&&(getImperfect()==0))||((
int64(getType())==3)&&(getImperfect()==0)))) ) )
212 graph->
evalOpParm(myCols, nodeidx,
"cols", time, 0);
228 template <
typename T>
235 if (idx.
size() != instance.
size()+1)
240 coerceValue(value, myType);
243 coerceValue(value, mySurftype);
246 coerceValue(value, myOrient);
249 coerceValue(value, myCap);
252 coerceValue(value, myConsolidatepts);
255 coerceValue(value, myVertexnormals);
258 coerceValue(value, myT);
261 coerceValue(value, myR);
264 coerceValue(value, myRad);
267 coerceValue(value, myRadscale);
270 coerceValue(value, myHeight);
273 coerceValue(value, myRows);
276 coerceValue(value, myOrderu);
279 coerceValue(value, myOrderv);
282 coerceValue(value, myImperfect);
285 coerceValue(value, myCols);
301 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
330 if (idx.
size() != instance.
size()+1)
335 coerceValue(myType, clampMinValue(0, clampMaxValue(5, value ) ));
338 coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
341 coerceValue(myOrient, clampMinValue(0, clampMaxValue(2, value ) ));
344 coerceValue(myCap, ( ( value ) ));
347 coerceValue(myConsolidatepts, ( ( value ) ));
350 coerceValue(myVertexnormals, ( ( value ) ));
353 coerceValue(myT, ( ( value ) ));
356 coerceValue(myR, ( ( value ) ));
359 coerceValue(myRad, clampMinValue(0, ( value ) ));
362 coerceValue(myRadscale, clampMinValue(0, ( value ) ));
365 coerceValue(myHeight, ( ( value ) ));
368 coerceValue(myRows, clampMinValue(2, ( value ) ));
371 coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
374 coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
377 coerceValue(myImperfect, ( ( value ) ));
380 coerceValue(myCols, clampMinValue(3, ( value ) ));
387 { doSetParmValue(idx, instance, 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); }
423 if (fieldnum.
size() < 1)
436 return "consolidatepts";
438 return "vertexnormals";
466 if (fieldnum.
size() < 1)
467 return PARM_UNSUPPORTED;
504 return PARM_UNSUPPORTED;
540 loadData(is, rampdata);
558 int typelen = colon - data.
buffer();
572 {
int64 iv =
v; UTwrite(os, &iv); }
574 { UTwrite<fpreal64>(os, &
v); }
576 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
578 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
579 UTwrite<fpreal64>(os, &v.
z()); }
581 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
582 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
594 if (s) s->save(ostr);
596 saveData(os, result);
603 ostr << s->getDataTypeToken();
608 saveData(os, result);
612 void save(std::ostream &os)
const
616 saveData(os, myType);
617 saveData(os, mySurftype);
618 saveData(os, myOrient);
620 saveData(os, myConsolidatepts);
621 saveData(os, myVertexnormals);
625 saveData(os, myRadscale);
626 saveData(os, myHeight);
627 saveData(os, myRows);
628 saveData(os, myOrderu);
629 saveData(os, myOrderv);
630 saveData(os, myImperfect);
631 saveData(os, myCols);
644 loadData(is, myType);
645 loadData(is, mySurftype);
646 loadData(is, myOrient);
648 loadData(is, myConsolidatepts);
649 loadData(is, myVertexnormals);
653 loadData(is, myRadscale);
654 loadData(is, myHeight);
655 loadData(is, myRows);
656 loadData(is, myOrderu);
657 loadData(is, myOrderv);
658 loadData(is, myImperfect);
659 loadData(is, myCols);
669 if (!thissop)
return getType();
671 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getSurftype();
681 OP_Utils::evalOpParm(result, thissop,
"surftype", cookparms.
getCookTime(), 0);
689 if (!thissop)
return getOrient();
691 OP_Utils::evalOpParm(result, thissop,
"orient", cookparms.
getCookTime(), 0);
699 if (!thissop)
return getCap();
701 OP_Utils::evalOpParm(result, thissop,
"cap", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getConsolidatepts();
711 OP_Utils::evalOpParm(result, thissop,
"consolidatepts", cookparms.
getCookTime(), 0);
719 if (!thissop)
return getVertexnormals();
721 OP_Utils::evalOpParm(result, thissop,
"vertexnormals", cookparms.
getCookTime(), 0);
729 if (!thissop)
return getT();
731 OP_Utils::evalOpParm(result, thissop,
"t", cookparms.
getCookTime(), 0);
739 if (!thissop)
return getR();
741 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
749 if (!thissop)
return getRad();
751 OP_Utils::evalOpParm(result, thissop,
"rad", cookparms.
getCookTime(), 0);
759 if (!thissop)
return getRadscale();
761 OP_Utils::evalOpParm(result, thissop,
"radscale", cookparms.
getCookTime(), 0);
769 if (!thissop)
return getHeight();
771 OP_Utils::evalOpParm(result, thissop,
"height", cookparms.
getCookTime(), 0);
779 if (!thissop)
return getRows();
781 OP_Utils::evalOpParm(result, thissop,
"rows", cookparms.
getCookTime(), 0);
789 if (!thissop)
return getOrderu();
791 OP_Utils::evalOpParm(result, thissop,
"orderu", cookparms.
getCookTime(), 0);
799 if (!thissop)
return getOrderv();
801 OP_Utils::evalOpParm(result, thissop,
"orderv", cookparms.
getCookTime(), 0);
809 if (!thissop)
return getImperfect();
811 OP_Utils::evalOpParm(result, thissop,
"imperfect", cookparms.
getCookTime(), 0);
819 if (!thissop)
return getCols();
821 OP_Utils::evalOpParm(result, thissop,
"cols", cookparms.
getCookTime(), 0);
830 bool myConsolidatepts;
831 bool myVertexnormals;
void setRad(UT_Vector2D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool opVertexnormals(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getRad() const
bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opRad(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
bool getImperfect() const
fpreal64 getHeight() const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
exint bread(int32 *buffer, exint asize=1)
static void saveData(std::ostream &os, UT_Vector3D v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_Vector2T< fpreal64 > UT_Vector2D
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 opRadscale(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void setT(UT_Vector3D val)
SYS_FORCE_INLINE const char * buffer() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setSurftype(Surftype val)
**But if you need a result
Surftype opSurftype(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
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 loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
fpreal64 getRadscale() const
static void saveData(std::ostream &os, bool v)
void setOrderu(int64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool load(UT_IStream &is)
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
bool isParmColorRamp(exint idx) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setVertexnormals(bool val)
Surftype getSurftype() const
ParmType getNestParmType(TempIndex fieldnum) const override
bool getVertexnormals() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 opHeight(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setConsolidatepts(bool val)
const OP_GraphProxy * graph() const
bool operator!=(const SOP_TubeParms &src) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool operator==(const SOP_TubeParms &src) const
int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
void setRadscale(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_Vector3T< fpreal64 > UT_Vector3D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Matrix3D v)
Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
void save(std::ostream &os) const
void setImperfect(bool val)
DEP_MicroNode * depnode() const
static void loadData(UT_IStream &is, int64 &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setOrient(Orient val)
constexpr SYS_FORCE_INLINE T & w() noexcept
void setR(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setOrderv(int64 val)
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
const char * findChar(int c) const
void setHeight(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getConsolidatepts() const
static void saveData(std::ostream &os, UT_Matrix2D v)
exint getNestNumParms(TempIndex idx) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool opCap(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept