23 namespace SOP_AttribPromoteEnums
36 using namespace UT::Literal;
57 using namespace UT::Literal;
86 using namespace UT::Literal;
117 myUsePieceAttrib =
false;
118 myPieceAttrib =
"name"_UTsh;
120 myDoindexattrib =
false;
121 myIndexattrib =
"sourceindex"_UTsh;
122 myUseoutname =
false;
137 if (myInname != src.myInname)
return false;
138 if (myInclass != src.myInclass)
return false;
139 if (myOutclass != src.myOutclass)
return false;
140 if (myUsePieceAttrib != src.myUsePieceAttrib)
return false;
141 if (myPieceAttrib != src.myPieceAttrib)
return false;
142 if (myMethod != src.myMethod)
return false;
143 if (myDoindexattrib != src.myDoindexattrib)
return false;
144 if (myIndexattrib != src.myIndexattrib)
return false;
145 if (myUseoutname != src.myUseoutname)
return false;
146 if (myOutname != src.myOutname)
return false;
147 if (myDeletein != src.myDeletein)
return false;
168 graph->
evalOpParm(myInname, nodeidx,
"inname", time, graph->
isDirect()?
nullptr:depnode);
171 graph->
evalOpParm(myInclass, nodeidx,
"inclass", time, graph->
isDirect()?
nullptr:depnode);
174 graph->
evalOpParm(myOutclass, nodeidx,
"outclass", time, graph->
isDirect()?
nullptr:depnode);
175 myUsePieceAttrib =
false;
176 if (
true && ( (
true&&!(((
int64(getOutclass())==0))||((
int64(getInclass())==0)))) ) )
177 graph->
evalOpParm(myUsePieceAttrib, nodeidx,
"usepieceattrib", time, graph->
isDirect()?
nullptr:depnode);
178 myPieceAttrib =
"name"_UTsh;
179 if (
true && ( (
true&&!(((getUsePieceAttrib()==0))||((
int64(getOutclass())==0))||((
int64(getInclass())==0)))) ) )
180 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, graph->
isDirect()?
nullptr:depnode);
183 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
184 myDoindexattrib =
false;
185 if (
true && ( (
true&&!(((
int64(getMethod())!=0)&&(
int64(getMethod())!=1)&&(
int64(getMethod())!=4)&&(
int64(getMethod())!=8)&&(
int64(getMethod())!=9)))) ) )
186 graph->
evalOpParm(myDoindexattrib, nodeidx,
"doindexattrib", time, graph->
isDirect()?
nullptr:depnode);
187 myIndexattrib =
"sourceindex"_UTsh;
188 if (
true && ( (
true&&!(((
int64(getMethod())!=0)&&(
int64(getMethod())!=1)&&(
int64(getMethod())!=4)&&(
int64(getMethod())!=8)&&(
int64(getMethod())!=9))||((getDoindexattrib()!=1)))) ) )
189 graph->
evalOpParm(myIndexattrib, nodeidx,
"indexattrib", time, graph->
isDirect()?
nullptr:depnode);
190 myUseoutname =
false;
192 graph->
evalOpParm(myUseoutname, nodeidx,
"useoutname", time, graph->
isDirect()?
nullptr:depnode);
194 if (
true && ( (
true&&!(((getUseoutname()==0)))) ) )
195 graph->
evalOpParm(myOutname, nodeidx,
"outname", time, graph->
isDirect()?
nullptr:depnode);
197 if (
true && ( (
true&&!(((getUseoutname()==0)&&(
int64(getInclass())==2)&&(
int64(getOutclass())==3))||((getUseoutname()==0)&&(
int64(getInclass())==3)&&(
int64(getOutclass())==2)))) ) )
198 graph->
evalOpParm(myDeletein, nodeidx,
"deletein", time, graph->
isDirect()?
nullptr:depnode);
214 template <
typename T>
221 if (idx.
size() != instance.
size()+1)
226 coerceValue(value, myInname);
229 coerceValue(value, myInclass);
232 coerceValue(value, myOutclass);
235 coerceValue(value, myUsePieceAttrib);
238 coerceValue(value, myPieceAttrib);
241 coerceValue(value, myMethod);
244 coerceValue(value, myDoindexattrib);
247 coerceValue(value, myIndexattrib);
250 coerceValue(value, myUseoutname);
253 coerceValue(value, myOutname);
256 coerceValue(value, myDeletein);
272 { doGetParmValue(idx, instance, value); }
274 { doGetParmValue(idx, instance, value); }
276 { doGetParmValue(idx, instance, value); }
278 { doGetParmValue(idx, instance, value); }
280 { doGetParmValue(idx, instance, value); }
282 { doGetParmValue(idx, instance, value); }
284 { doGetParmValue(idx, instance, value); }
286 { doGetParmValue(idx, instance, value); }
288 { doGetParmValue(idx, instance, value); }
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 template <
typename T>
301 if (idx.
size() != instance.
size()+1)
306 coerceValue(myInname, ( ( value ) ));
309 coerceValue(myInclass, clampMinValue(0, clampMaxValue(3, value ) ));
312 coerceValue(myOutclass, clampMinValue(0, clampMaxValue(3, value ) ));
315 coerceValue(myUsePieceAttrib, ( ( value ) ));
318 coerceValue(myPieceAttrib, ( ( value ) ));
321 coerceValue(myMethod, clampMinValue(0, clampMaxValue(11, value ) ));
324 coerceValue(myDoindexattrib, ( ( value ) ));
327 coerceValue(myIndexattrib, ( ( value ) ));
330 coerceValue(myUseoutname, ( ( value ) ));
333 coerceValue(myOutname, ( ( value ) ));
336 coerceValue(myDeletein, ( ( value ) ));
343 { doSetParmValue(idx, instance, value); }
345 { doSetParmValue(idx, instance, value); }
347 { doSetParmValue(idx, instance, value); }
349 { doSetParmValue(idx, instance, value); }
351 { doSetParmValue(idx, instance, value); }
353 { doSetParmValue(idx, instance, value); }
355 { doSetParmValue(idx, instance, value); }
357 { doSetParmValue(idx, instance, value); }
359 { doSetParmValue(idx, instance, value); }
361 { doSetParmValue(idx, instance, value); }
363 { doSetParmValue(idx, instance, value); }
379 if (fieldnum.
size() < 1)
390 return "usepieceattrib";
392 return "pieceattrib";
396 return "doindexattrib";
398 return "indexattrib";
412 if (fieldnum.
size() < 1)
413 return PARM_UNSUPPORTED;
440 return PARM_UNSUPPORTED;
476 loadData(is, rampdata);
494 int typelen = colon - data.
buffer();
508 {
int64 iv =
v; UTwrite(os, &iv); }
510 { UTwrite<fpreal64>(os, &
v); }
512 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
514 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
515 UTwrite<fpreal64>(os, &v.
z()); }
517 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
518 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
530 if (s) s->save(ostr);
532 saveData(os, result);
539 ostr << s->getDataTypeToken();
544 saveData(os, result);
548 void save(std::ostream &os)
const
552 saveData(os, myInname);
553 saveData(os, myInclass);
554 saveData(os, myOutclass);
555 saveData(os, myUsePieceAttrib);
556 saveData(os, myPieceAttrib);
557 saveData(os, myMethod);
558 saveData(os, myDoindexattrib);
559 saveData(os, myIndexattrib);
560 saveData(os, myUseoutname);
561 saveData(os, myOutname);
562 saveData(os, myDeletein);
575 loadData(is, myInname);
576 loadData(is, myInclass);
577 loadData(is, myOutclass);
578 loadData(is, myUsePieceAttrib);
579 loadData(is, myPieceAttrib);
580 loadData(is, myMethod);
581 loadData(is, myDoindexattrib);
582 loadData(is, myIndexattrib);
583 loadData(is, myUseoutname);
584 loadData(is, myOutname);
585 loadData(is, myDeletein);
595 if (!thissop)
return getInname();
597 OP_Utils::evalOpParm(result, thissop,
"inname", cookparms.
getCookTime(), 0);
605 if (!thissop)
return getInclass();
607 OP_Utils::evalOpParm(result, thissop,
"inclass", cookparms.
getCookTime(), 0);
615 if (!thissop)
return getOutclass();
617 OP_Utils::evalOpParm(result, thissop,
"outclass", cookparms.
getCookTime(), 0);
625 if (!thissop)
return getUsePieceAttrib();
627 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
635 if (!thissop)
return getPieceAttrib();
637 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
645 if (!thissop)
return getMethod();
647 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
655 if (!thissop)
return getDoindexattrib();
657 OP_Utils::evalOpParm(result, thissop,
"doindexattrib", cookparms.
getCookTime(), 0);
665 if (!thissop)
return getIndexattrib();
667 OP_Utils::evalOpParm(result, thissop,
"indexattrib", cookparms.
getCookTime(), 0);
675 if (!thissop)
return getUseoutname();
677 OP_Utils::evalOpParm(result, thissop,
"useoutname", cookparms.
getCookTime(), 0);
685 if (!thissop)
return getOutname();
687 OP_Utils::evalOpParm(result, thissop,
"outname", cookparms.
getCookTime(), 0);
695 if (!thissop)
return getDeletein();
697 OP_Utils::evalOpParm(result, thissop,
"deletein", cookparms.
getCookTime(), 0);
705 bool myUsePieceAttrib;
708 bool myDoindexattrib;
SOP_Node * getNode() const
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
exint bread(uint8 *buffer, exint asize=1)
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