23 namespace SOP_RawImportEnums
99 if (tuplesize != src.
tuplesize)
return false;
102 if (bfloat != src.
bfloat)
return false;
103 if (collate != src.
collate)
return false;
104 if (volres != src.
volres)
return false;
105 if (volorder != src.
volorder)
return false;
121 for (
int i = 0; i < list.
entries(); i++)
137 buf.
appendSprintf(
"%s", (list(i).bfloat) ?
"true" :
"false");
139 buf.
appendSprintf(
"%s", (list(i).collate) ?
"true" :
"false");
155 myFile =
"default.raw"_UTsh;
156 raw_myFile =
"default.raw"_UTsh;
158 myPointCountType = 0;
160 myPointCountAttrib =
"pointcount"_UTsh;
174 if (myFile != src.myFile)
return false;
175 if (raw_myFile != src.raw_myFile)
return false;
176 if (myEndian != src.myEndian)
return false;
177 if (myPointCountType != src.myPointCountType)
return false;
178 if (myPointCount != src.myPointCount)
return false;
179 if (myPointCountAttrib != src.myPointCountAttrib)
return false;
180 if (myBlocks != src.myBlocks)
return false;
199 myFile =
"default.raw"_UTsh;
201 graph->
evalOpParm(myFile, nodeidx,
"file", time, 0);
202 raw_myFile =
"default.raw"_UTsh;
207 graph->
evalOpParm(myEndian, nodeidx,
"endian", time, 0);
208 myPointCountType = 0;
210 graph->
evalOpParm(myPointCountType, nodeidx,
"pointcounttype", time, 0);
212 if (
true && ( (
true&&!(((
int64(getPointCountType())!=1)))) ) )
213 graph->
evalOpParm(myPointCount, nodeidx,
"pointcount", time, 0);
214 myPointCountAttrib =
"pointcount"_UTsh;
215 if (
true && ( (
true&&!(((
int64(getPointCountType())!=2)))) ) )
216 graph->
evalOpParm(myPointCountAttrib, nodeidx,
"pointcountattrib", time, 0);
220 graph->
evalOpParm(length, nodeidx,
"blocks", time, 0);
221 if (length < 0) length = 0;
222 myBlocks.setSize(length);
229 auto && _curentry = myBlocks(i);
231 _curentry.name =
""_UTsh;
233 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
234 _curentry.target = 1;
236 graph->
evalOpParmInst(_curentry.target, nodeidx,
"target#", parmidx, offsets, time, 0, 2-1);
237 _curentry.tuplesize = 1;
239 graph->
evalOpParmInst(_curentry.tuplesize, nodeidx,
"tuplesize#", parmidx, offsets, time, 0, 2-1);
242 graph->
evalOpParmInst(_curentry.type, nodeidx,
"type#", parmidx, offsets, time, 0, 2-1);
243 _curentry.precision = 2;
245 graph->
evalOpParmInst(_curentry.precision, nodeidx,
"precision#", parmidx, offsets, time, 0, 2-1);
246 _curentry.bfloat =
false;
247 if (
true && ( (
true&&!(((_curentry.type!=0))||((_curentry.precision!=1)))) ) )
248 graph->
evalOpParmInst(_curentry.bfloat, nodeidx,
"bfloat#", parmidx, offsets, time, 0, 2-1);
249 _curentry.collate =
false;
251 graph->
evalOpParmInst(_curentry.collate, nodeidx,
"collate#", parmidx, offsets, time, 0, 2-1);
253 if (
true && ( (
true&&!(((_curentry.target!=3))||((_curentry.collate==1)))) ) )
254 graph->
evalOpParmInst(_curentry.volres, nodeidx,
"volres#", parmidx, offsets, time, 0, 2-1);
255 _curentry.volorder = 0;
256 if (
true && ( (
true&&!(((_curentry.target!=3))||((_curentry.collate==1)))) ) )
257 graph->
evalOpParmInst(_curentry.volorder, nodeidx,
"volorder#", parmidx, offsets, time, 0, 2-1);
278 template <
typename T>
285 if (idx.
size() != instance.
size()+1)
307 else if (instance[0] < myBlocks.entries())
309 auto && _data = myBlocks(instance[0]);
357 { doGetParmValue(idx, instance, value); }
359 { doGetParmValue(idx, instance, value); }
361 { doGetParmValue(idx, instance, value); }
363 { doGetParmValue(idx, instance, value); }
365 { doGetParmValue(idx, instance, value); }
367 { doGetParmValue(idx, instance, value); }
369 { doGetParmValue(idx, instance, value); }
371 { doGetParmValue(idx, instance, value); }
373 { doGetParmValue(idx, instance, value); }
375 { doGetParmValue(idx, instance, value); }
377 { doGetParmValue(idx, instance, value); }
379 template <
typename T>
386 if (idx.
size() != instance.
size()+1)
410 if (newsize < 0) newsize = 0;
411 myBlocks.setSize(newsize);
417 myBlocks.setSizeIfNeeded(instance[0]+1);
418 auto && _data = myBlocks(instance[0]);
457 { doSetParmValue(idx, instance, value); }
459 { doSetParmValue(idx, instance, value); }
461 { doSetParmValue(idx, instance, value); }
463 { doSetParmValue(idx, instance, value); }
465 { doSetParmValue(idx, instance, value); }
467 { doSetParmValue(idx, instance, value); }
469 { doSetParmValue(idx, instance, value); }
471 { doSetParmValue(idx, instance, value); }
473 { doSetParmValue(idx, instance, value); }
475 { doSetParmValue(idx, instance, value); }
477 { doSetParmValue(idx, instance, value); }
495 if (fieldnum.
size() < 1)
504 return "pointcounttype";
508 return "pointcountattrib";
510 if (fieldnum.
size() == 1)
542 if (fieldnum.
size() < 1)
543 return PARM_UNSUPPORTED;
557 if (fieldnum.
size() == 1)
558 return PARM_MULTIPARM;
603 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
605 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
607 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
620 loadData(is, rampdata);
638 int typelen = colon - data.
buffer();
652 {
int64 iv =
v; UTwrite(os, &iv); }
654 { UTwrite<fpreal64>(os, &
v); }
656 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
658 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
659 UTwrite<fpreal64>(os, &v.
z()); }
661 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
662 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
674 if (s) s->save(ostr);
676 saveData(os, result);
683 ostr << s->getDataTypeToken();
688 saveData(os, result);
692 void save(std::ostream &os)
const
696 saveData(os, myFile);
697 saveData(os, raw_myFile);
698 saveData(os, myEndian);
699 saveData(os, myPointCountType);
700 saveData(os, myPointCount);
701 saveData(os, myPointCountAttrib);
704 UTwrite(os, &length);
707 auto && _curentry = myBlocks(i);
709 saveData(os, _curentry.name);
710 saveData(os, _curentry.target);
711 saveData(os, _curentry.tuplesize);
712 saveData(os, _curentry.type);
713 saveData(os, _curentry.precision);
714 saveData(os, _curentry.bfloat);
715 saveData(os, _curentry.collate);
716 saveData(os, _curentry.volres);
717 saveData(os, _curentry.volorder);
733 loadData(is, myFile);
734 loadData(is, raw_myFile);
735 loadData(is, myEndian);
736 loadData(is, myPointCountType);
737 loadData(is, myPointCount);
738 loadData(is, myPointCountAttrib);
742 myBlocks.setSize(length);
745 auto && _curentry = myBlocks(i);
747 loadData(is, _curentry.name);
748 loadData(is, _curentry.target);
749 loadData(is, _curentry.tuplesize);
750 loadData(is, _curentry.type);
751 loadData(is, _curentry.precision);
752 loadData(is, _curentry.bfloat);
753 loadData(is, _curentry.collate);
754 loadData(is, _curentry.volres);
755 loadData(is, _curentry.volorder);
768 if (!thissop)
return getFile();
770 OP_Utils::evalOpParm(result, thissop,
"file", cookparms.
getCookTime(), 0);
778 if (!thissop)
return raw_getFile();
780 OP_Utils::evalOpParmRaw(result, thissop,
"file", cookparms.
getCookTime(), 0);
788 if (!thissop)
return getEndian();
790 OP_Utils::evalOpParm(result, thissop,
"endian", cookparms.
getCookTime(), 0);
798 if (!thissop)
return getPointCountType();
800 OP_Utils::evalOpParm(result, thissop,
"pointcounttype", cookparms.
getCookTime(), 0);
808 if (!thissop)
return getPointCount();
810 OP_Utils::evalOpParm(result, thissop,
"pointcount", cookparms.
getCookTime(), 0);
818 if (!thissop)
return getPointCountAttrib();
820 OP_Utils::evalOpParm(result, thissop,
"pointcountattrib", cookparms.
getCookTime(), 0);
828 if (!thissop)
return getBlocks().entries();
830 OP_Utils::evalOpParm(result, thissop,
"blocks", cookparms.
getCookTime(), 0);
834 {
return opinstBlocks_name(cookparms, &_idx); }
838 if (!thissop)
return (myBlocks(_idx[0]).
name);
840 _parmidx[1-1] = _idx[1-1] + 1;
843 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
847 {
return opinstBlocks_target(cookparms, &_idx); }
851 if (!thissop)
return (myBlocks(_idx[0]).
target);
853 _parmidx[1-1] = _idx[1-1] + 1;
856 OP_Utils::evalOpParmInst(result, thissop,
"target#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
860 {
return opinstBlocks_tuplesize(cookparms, &_idx); }
864 if (!thissop)
return (myBlocks(_idx[0]).tuplesize);
866 _parmidx[1-1] = _idx[1-1] + 1;
869 OP_Utils::evalOpParmInst(result, thissop,
"tuplesize#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
873 {
return opinstBlocks_type(cookparms, &_idx); }
877 if (!thissop)
return (myBlocks(_idx[0]).
type);
879 _parmidx[1-1] = _idx[1-1] + 1;
882 OP_Utils::evalOpParmInst(result, thissop,
"type#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
886 {
return opinstBlocks_precision(cookparms, &_idx); }
890 if (!thissop)
return (myBlocks(_idx[0]).
precision);
892 _parmidx[1-1] = _idx[1-1] + 1;
895 OP_Utils::evalOpParmInst(result, thissop,
"precision#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
899 {
return opinstBlocks_bfloat(cookparms, &_idx); }
903 if (!thissop)
return (myBlocks(_idx[0]).bfloat);
905 _parmidx[1-1] = _idx[1-1] + 1;
908 OP_Utils::evalOpParmInst(result, thissop,
"bfloat#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
912 {
return opinstBlocks_collate(cookparms, &_idx); }
916 if (!thissop)
return (myBlocks(_idx[0]).collate);
918 _parmidx[1-1] = _idx[1-1] + 1;
921 OP_Utils::evalOpParmInst(result, thissop,
"collate#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
925 {
return opinstBlocks_volres(cookparms, &_idx); }
929 if (!thissop)
return (myBlocks(_idx[0]).volres);
931 _parmidx[1-1] = _idx[1-1] + 1;
934 OP_Utils::evalOpParmInst(result, thissop,
"volres#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
938 {
return opinstBlocks_volorder(cookparms, &_idx); }
942 if (!thissop)
return (myBlocks(_idx[0]).volorder);
944 _parmidx[1-1] = _idx[1-1] + 1;
947 OP_Utils::evalOpParmInst(result, thissop,
"volorder#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
956 int64 myPointCountType;
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
int64 opBlocks_tuplesize(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, int64 v)
bool operator!=(const Blocks &src) const
GLenum GLuint GLenum GLsizei const GLchar * buf
bool operator!=(const SOP_RawImportParms &src) const
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
SOP_Node * getNode() const
void loadFromOpSubclass(const LoadParms &loadparms) override
PointCountType getPointCountType() const
void copyFrom(const OP_NodeParms *src) override
T clampMaxValue(fpreal maxvalue, const T &src) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setPointCount(int64 val)
UT_StringHolder opPointCountAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const UT_Array< Blocks > & getBlocks() const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
virtual void evalOpParmRaw(UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
SYS_FORCE_INLINE const char * buffer() const
GLuint GLsizei GLsizei * length
static void saveData(std::ostream &os, UT_Matrix3D v)
An output stream object that owns its own string buffer storage.
int64 opinstBlocks_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool operator==(const SOP_RawImportParms &src) const
static void loadData(UT_IStream &is, int64 &v)
**But if you need a result
UT_Vector3T< int64 > UT_Vector3I
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
T clampMinValue(fpreal minvalue, const T &src) const
UT_Vector3I opinstBlocks_volres(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstBlocks_target(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint getNestNumParms(TempIndex idx) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
bool isParmColorRamp(exint idx) const override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
PointCountType opPointCountType(const SOP_NodeVerb::CookParms &cookparms) const
int64 opinstBlocks_tuplesize(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setFile(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setPointCountType(PointCountType val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
UT_StringHolder opFile(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
int64 opinstBlocks_precision(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opinstBlocks_bfloat(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder createString(const UT_Array< Blocks > &list) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setBlocks(const UT_Array< Blocks > &val)
void setEndian(Endian val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
const UT_StringHolder & getFile() const
void setPointCountAttrib(const UT_StringHolder &val)
bool opBlocks_collate(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool opinstBlocks_collate(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
ParmType getNestParmType(TempIndex fieldnum) const override
int64 opBlocks_volorder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
int64 opPointCount(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getPointCountAttrib() const
UT_StringHolder opinstBlocks_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opBlocks_bfloat(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
exint opBlocks(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
int64 opBlocks_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLuint const GLchar * name
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_Vector3I opBlocks_volres(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void raw_setFile(const UT_StringHolder &val)
SYS_FORCE_INLINE void strcat(const char *src)
static void saveData(std::ostream &os, bool v)
UT_StringHolder opBlocks_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
bool operator==(const Blocks &src) const
GT_API const UT_StringHolder version
GLenum GLint GLint * precision
exint entries() const
Alias of size(). size() is preferred.
int64 opBlocks_target(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void coerceValue(T &result, const S &src) const
int64 opBlocks_precision(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool load(UT_IStream &is)
DEP_MicroNode * depnode() const
static void saveData(std::ostream &os, UT_Matrix4D v)
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
int64 getPointCount() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
int64 opinstBlocks_volorder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
fpreal getCookTime() const
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & raw_getFile() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_StringHolder s)
UT_StringHolder raw_opFile(const SOP_NodeVerb::CookParms &cookparms) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
Endian opEndian(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, fpreal64 v)
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & x() noexcept