23 namespace SOP_AttribPromoteEnums
36 using namespace UT::Literal;
57 using namespace UT::Literal;
85 using namespace UT::Literal;
115 myUsePieceAttrib =
false;
116 myPieceAttrib =
"name"_UTsh;
118 myUseoutname =
false;
133 if (myInname != src.myInname)
return false;
134 if (myInclass != src.myInclass)
return false;
135 if (myOutclass != src.myOutclass)
return false;
136 if (myUsePieceAttrib != src.myUsePieceAttrib)
return false;
137 if (myPieceAttrib != src.myPieceAttrib)
return false;
138 if (myMethod != src.myMethod)
return false;
139 if (myUseoutname != src.myUseoutname)
return false;
140 if (myOutname != src.myOutname)
return false;
141 if (myDeletein != src.myDeletein)
return false;
162 graph->
evalOpParm(myInname, nodeidx,
"inname", time, graph->
isDirect()?
nullptr:depnode);
165 graph->
evalOpParm(myInclass, nodeidx,
"inclass", time, graph->
isDirect()?
nullptr:depnode);
168 graph->
evalOpParm(myOutclass, nodeidx,
"outclass", time, graph->
isDirect()?
nullptr:depnode);
169 myUsePieceAttrib =
false;
170 if (
true && ( (
true&&!(((
int64(getOutclass())==0))||((
int64(getInclass())==0)))) ) )
171 graph->
evalOpParm(myUsePieceAttrib, nodeidx,
"usepieceattrib", time, graph->
isDirect()?
nullptr:depnode);
172 myPieceAttrib =
"name"_UTsh;
173 if (
true && ( (
true&&!(((getUsePieceAttrib()==0))||((
int64(getOutclass())==0))||((
int64(getInclass())==0)))) ) )
174 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, graph->
isDirect()?
nullptr:depnode);
177 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
178 myUseoutname =
false;
180 graph->
evalOpParm(myUseoutname, nodeidx,
"useoutname", time, graph->
isDirect()?
nullptr:depnode);
182 if (
true && ( (
true&&!(((getUseoutname()==0)))) ) )
183 graph->
evalOpParm(myOutname, nodeidx,
"outname", time, graph->
isDirect()?
nullptr:depnode);
185 if (
true && ( (
true&&!(((getUseoutname()==0)&&(
int64(getInclass())==2)&&(
int64(getOutclass())==3))||((getUseoutname()==0)&&(
int64(getInclass())==3)&&(
int64(getOutclass())==2)))) ) )
186 graph->
evalOpParm(myDeletein, nodeidx,
"deletein", time, graph->
isDirect()?
nullptr:depnode);
202 template <
typename T>
209 if (idx.
size() != instance.
size()+1)
214 coerceValue(value, myInname);
217 coerceValue(value, myInclass);
220 coerceValue(value, myOutclass);
223 coerceValue(value, myUsePieceAttrib);
226 coerceValue(value, myPieceAttrib);
229 coerceValue(value, myMethod);
232 coerceValue(value, myUseoutname);
235 coerceValue(value, myOutname);
238 coerceValue(value, myDeletein);
254 { doGetParmValue(idx, instance, value); }
256 { doGetParmValue(idx, instance, value); }
258 { doGetParmValue(idx, instance, value); }
260 { doGetParmValue(idx, instance, value); }
262 { doGetParmValue(idx, instance, value); }
264 { doGetParmValue(idx, instance, value); }
266 { doGetParmValue(idx, instance, value); }
268 { doGetParmValue(idx, instance, value); }
270 { doGetParmValue(idx, instance, value); }
272 { doGetParmValue(idx, instance, value); }
274 { doGetParmValue(idx, instance, value); }
276 template <
typename T>
283 if (idx.
size() != instance.
size()+1)
288 coerceValue(myInname, ( ( value ) ));
291 coerceValue(myInclass, clampMinValue(0, clampMaxValue(3, value ) ));
294 coerceValue(myOutclass, clampMinValue(0, clampMaxValue(3, value ) ));
297 coerceValue(myUsePieceAttrib, ( ( value ) ));
300 coerceValue(myPieceAttrib, ( ( value ) ));
303 coerceValue(myMethod, clampMinValue(0, clampMaxValue(10, value ) ));
306 coerceValue(myUseoutname, ( ( value ) ));
309 coerceValue(myOutname, ( ( value ) ));
312 coerceValue(myDeletein, ( ( value ) ));
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
333 { doSetParmValue(idx, instance, value); }
335 { doSetParmValue(idx, instance, value); }
337 { doSetParmValue(idx, instance, value); }
339 { doSetParmValue(idx, instance, value); }
355 if (fieldnum.
size() < 1)
366 return "usepieceattrib";
368 return "pieceattrib";
384 if (fieldnum.
size() < 1)
385 return PARM_UNSUPPORTED;
408 return PARM_UNSUPPORTED;
444 loadData(is, rampdata);
462 int typelen = colon - data.
buffer();
476 {
int64 iv =
v; UTwrite(os, &iv); }
478 { UTwrite<fpreal64>(os, &
v); }
480 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
482 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
483 UTwrite<fpreal64>(os, &v.
z()); }
485 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
486 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
498 if (s) s->save(ostr);
500 saveData(os, result);
507 ostr << s->getDataTypeToken();
512 saveData(os, result);
516 void save(std::ostream &os)
const
520 saveData(os, myInname);
521 saveData(os, myInclass);
522 saveData(os, myOutclass);
523 saveData(os, myUsePieceAttrib);
524 saveData(os, myPieceAttrib);
525 saveData(os, myMethod);
526 saveData(os, myUseoutname);
527 saveData(os, myOutname);
528 saveData(os, myDeletein);
541 loadData(is, myInname);
542 loadData(is, myInclass);
543 loadData(is, myOutclass);
544 loadData(is, myUsePieceAttrib);
545 loadData(is, myPieceAttrib);
546 loadData(is, myMethod);
547 loadData(is, myUseoutname);
548 loadData(is, myOutname);
549 loadData(is, myDeletein);
559 if (!thissop)
return getInname();
561 OP_Utils::evalOpParm(result, thissop,
"inname", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getInclass();
571 OP_Utils::evalOpParm(result, thissop,
"inclass", cookparms.
getCookTime(), 0);
579 if (!thissop)
return getOutclass();
581 OP_Utils::evalOpParm(result, thissop,
"outclass", cookparms.
getCookTime(), 0);
589 if (!thissop)
return getUsePieceAttrib();
591 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
599 if (!thissop)
return getPieceAttrib();
601 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getMethod();
611 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
619 if (!thissop)
return getUseoutname();
621 OP_Utils::evalOpParm(result, thissop,
"useoutname", cookparms.
getCookTime(), 0);
629 if (!thissop)
return getOutname();
631 OP_Utils::evalOpParm(result, thissop,
"outname", cookparms.
getCookTime(), 0);
639 if (!thissop)
return getDeletein();
641 OP_Utils::evalOpParm(result, thissop,
"deletein", cookparms.
getCookTime(), 0);
649 bool myUsePieceAttrib;
SOP_Node * getNode() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
GLsizei const GLfloat * value
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
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
const OP_GraphProxy * graph() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
virtual UT_StringHolder baseGetSignature() const
fpreal getCookTime() const
const char * findChar(int c) const
constexpr SYS_FORCE_INLINE T & y() noexcept
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept