76 geometry =
"Geometry"_UTsh;
103 if (intval != src.
intval)
return false;
104 if (fval != src.
fval)
return false;
105 if (v2val != src.
v2val)
return false;
106 if (v3val != src.
v3val)
return false;
107 if (v4val != src.
v4val)
return false;
108 if (timescale != src.
timescale)
return false;
109 if (fieldname != src.
fieldname)
return false;
111 if (ramp != src.
ramp)
112 {
if (!ramp || !src.
ramp || !(*ramp == *src.
ramp))
return false; }
113 if (rampsize != src.
rampsize)
return false;
114 if (geometry != src.
geometry)
return false;
117 if (attribtype != src.
attribtype)
return false;
118 if (attribsize != src.
attribsize)
return false;
119 if (volume != src.
volume)
return false;
120 if (vdbtype != src.
vdbtype)
return false;
122 if (voxelsize != src.
voxelsize)
return false;
126 if (readable != src.
readable)
return false;
127 if (writeable != src.
writeable)
return false;
128 if (optional != src.
optional)
return false;
129 if (defval != src.
defval)
return false;
130 if (dataname != src.
dataname)
return false;
131 if (optionname != src.
optionname)
return false;
132 if (optiontype != src.
optiontype)
return false;
133 if (optionsize != src.
optionsize)
return false;
149 for (
int i = 0; i < list.
entries(); i++)
163 buf.
appendSprintf(
"(%f, %f)", list(i).v2val.x(), list(i).v2val.y());
165 buf.
appendSprintf(
"(%f, %f, %f)", list(i).v3val.x(), list(i).v3val.y(), list(i).v3val.z());
167 buf.
appendSprintf(
"(%f, %f, %f, %f)", list(i).v4val.x(), list(i).v4val.y(), list(i).v4val.z(), list(i).v4val.w());
173 buf.
appendSprintf(
"%s", (list(i).fieldoffsets) ?
"true" :
"false");
179 list(i).ramp->save(os);
203 buf.
appendSprintf(
"%s", (list(i).voxelsize) ?
"true" :
"false");
205 buf.
appendSprintf(
"%s", (list(i).xformtoworld) ?
"true" :
"false");
207 buf.
appendSprintf(
"%s", (list(i).xformtovoxel) ?
"true" :
"false");
211 buf.
appendSprintf(
"%s", (list(i).readable) ?
"true" :
"false");
213 buf.
appendSprintf(
"%s", (list(i).writeable) ?
"true" :
"false");
215 buf.
appendSprintf(
"%s", (list(i).optional) ?
"true" :
"false");
217 buf.
appendSprintf(
"%s", (list(i).defval) ?
"true" :
"false");
240 myKernelName =
"kernelName"_UTsh;
241 myKernelFile =
""_UTsh;
242 myKernelCode =
""_UTsh;
244 myKernelOptions =
""_UTsh;
245 myOptionAttribute =
""_UTsh;
253 myFlushAttributes =
false;
258 myWorksetsGeometry =
""_UTsh;
259 myWorksetsBeginAttr =
""_UTsh;
260 myWorksetsLengthAttr =
""_UTsh;
262 myErrorMismatchedPoint =
false;
263 myErrorMismatchedPrim =
false;
264 mySingleWorkgroup = 0;
266 myImportPrequel =
true;
279 if (myRunOver != src.myRunOver)
return false;
280 if (myAlign != src.myAlign)
return false;
281 if (myUseCode != src.myUseCode)
return false;
282 if (myKernelName != src.myKernelName)
return false;
283 if (myKernelFile != src.myKernelFile)
return false;
284 if (myKernelCode != src.myKernelCode)
return false;
285 if (myAtBinding != src.myAtBinding)
return false;
286 if (myKernelOptions != src.myKernelOptions)
return false;
287 if (myOptionAttribute != src.myOptionAttribute)
return false;
288 if (myRecompile != src.myRecompile)
return false;
289 if (myOrigin != src.myOrigin)
return false;
290 if (mySize != src.mySize)
return false;
291 if (myVoxelSize != src.myVoxelSize)
return false;
292 if (myTime != src.myTime)
return false;
293 if (myFrame != src.myFrame)
return false;
294 if (myTimeInc != src.myTimeInc)
return false;
295 if (myFlushAttributes != src.myFlushAttributes)
return false;
296 if (myFinish != src.myFinish)
return false;
297 if (myTimeScale != src.myTimeScale)
return false;
298 if (myTimeMethod != src.myTimeMethod)
return false;
299 if (myXNoise != src.myXNoise)
return false;
300 if (myWorksetsGeometry != src.myWorksetsGeometry)
return false;
301 if (myWorksetsBeginAttr != src.myWorksetsBeginAttr)
return false;
302 if (myWorksetsLengthAttr != src.myWorksetsLengthAttr)
return false;
303 if (myWarnMissing != src.myWarnMissing)
return false;
304 if (myErrorMismatchedPoint != src.myErrorMismatchedPoint)
return false;
305 if (myErrorMismatchedPrim != src.myErrorMismatchedPrim)
return false;
306 if (mySingleWorkgroup != src.mySingleWorkgroup)
return false;
307 if (myPrecision != src.myPrecision)
return false;
308 if (myImportPrequel != src.myImportPrequel)
return false;
309 if (myBindings != src.myBindings)
return false;
330 {
return !strcmp(recordtype,
"Params"); }
335 if (recordtypenum == 0)
return "Params";
340 if (isMyRecord(recordtype))
return 1;
345 if (isMyRecord(recordtype))
351 int fieldnum)
const override
353 if (!isMyRecord(recordtype))
373 return "kerneloptions";
375 return "kerneloptionattrib";
391 return "flushattrib";
401 return "worksets_geo";
403 return "worksets_begin";
405 return "worksets_length";
407 return "warnmissing";
409 return "errormismatchedpoint";
411 return "errormismatchedprim";
413 return "singleworkgroup";
417 return "importprequel";
425 int fieldnum)
const override
427 if (!isMyRecord(recordtype))
501 const char *fieldname,
504 if (!isMyRecord(recordtype))
510 if (!strcmp(fieldname,
"runover"))
512 result = UTmakeUnique<UT_OptionInt>(myParms.myRunOver);
515 if (!strcmp(fieldname,
"align"))
517 result = UTmakeUnique<UT_OptionBool>(myParms.myAlign);
520 if (!strcmp(fieldname,
"usecode"))
522 result = UTmakeUnique<UT_OptionBool>(myParms.myUseCode);
525 if (!strcmp(fieldname,
"kernelname"))
527 result = UTmakeUnique<UT_OptionString>(myParms.myKernelName);
530 if (!strcmp(fieldname,
"kernelfile"))
532 result = UTmakeUnique<UT_OptionString>(myParms.myKernelFile);
535 if (!strcmp(fieldname,
"kernelcode"))
537 result = UTmakeUnique<UT_OptionString>(myParms.myKernelCode);
540 if (!strcmp(fieldname,
"atbinding"))
542 result = UTmakeUnique<UT_OptionBool>(myParms.myAtBinding);
545 if (!strcmp(fieldname,
"kerneloptions"))
547 result = UTmakeUnique<UT_OptionString>(myParms.myKernelOptions);
550 if (!strcmp(fieldname,
"kerneloptionattrib"))
552 result = UTmakeUnique<UT_OptionString>(myParms.myOptionAttribute);
555 if (!strcmp(fieldname,
"recompile"))
557 result = UTmakeUnique<UT_OptionBool>(myParms.myRecompile);
560 if (!strcmp(fieldname,
"origin"))
562 result = UTmakeUnique<UT_OptionBool>(myParms.myOrigin);
565 if (!strcmp(fieldname,
"size"))
567 result = UTmakeUnique<UT_OptionBool>(myParms.mySize);
570 if (!strcmp(fieldname,
"voxelsize"))
572 result = UTmakeUnique<UT_OptionBool>(myParms.myVoxelSize);
575 if (!strcmp(fieldname,
"time"))
577 result = UTmakeUnique<UT_OptionBool>(myParms.myTime);
580 if (!strcmp(fieldname,
"frame"))
582 result = UTmakeUnique<UT_OptionBool>(myParms.myFrame);
585 if (!strcmp(fieldname,
"timeinc"))
587 result = UTmakeUnique<UT_OptionBool>(myParms.myTimeInc);
590 if (!strcmp(fieldname,
"flushattrib"))
592 result = UTmakeUnique<UT_OptionBool>(myParms.myFlushAttributes);
595 if (!strcmp(fieldname,
"finish"))
597 result = UTmakeUnique<UT_OptionBool>(myParms.myFinish);
600 if (!strcmp(fieldname,
"timescale"))
602 result = UTmakeUnique<UT_OptionFpreal>(myParms.myTimeScale);
605 if (!strcmp(fieldname,
"timemethod"))
607 result = UTmakeUnique<UT_OptionInt>(myParms.myTimeMethod);
610 if (!strcmp(fieldname,
"xnoise"))
612 result = UTmakeUnique<UT_OptionBool>(myParms.myXNoise);
615 if (!strcmp(fieldname,
"worksets_geo"))
617 result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsGeometry);
620 if (!strcmp(fieldname,
"worksets_begin"))
622 result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsBeginAttr);
625 if (!strcmp(fieldname,
"worksets_length"))
627 result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsLengthAttr);
630 if (!strcmp(fieldname,
"warnmissing"))
632 result = UTmakeUnique<UT_OptionBool>(myParms.myWarnMissing);
635 if (!strcmp(fieldname,
"errormismatchedpoint"))
637 result = UTmakeUnique<UT_OptionBool>(myParms.myErrorMismatchedPoint);
640 if (!strcmp(fieldname,
"errormismatchedprim"))
642 result = UTmakeUnique<UT_OptionBool>(myParms.myErrorMismatchedPrim);
645 if (!strcmp(fieldname,
"singleworkgroup"))
647 result = UTmakeUnique<UT_OptionInt>(myParms.mySingleWorkgroup);
650 if (!strcmp(fieldname,
"precision"))
652 result = UTmakeUnique<UT_OptionInt>(myParms.myPrecision);
655 if (!strcmp(fieldname,
"importprequel"))
657 result = UTmakeUnique<UT_OptionBool>(myParms.myImportPrequel);
660 if (!strcmp(fieldname,
"bindings"))
662 result = UTmakeUnique<UT_OptionString>(myParms.createString(myParms.myBindings));
674 {
return new Query(owner, *
this); }
712 loadData(is, rampdata);
730 int typelen = colon - data.
buffer();
744 {
int64 iv =
v; UTwrite(os, &iv); }
746 { UTwrite<fpreal64>(os, &
v); }
748 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
750 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
751 UTwrite<fpreal64>(os, &v.
z()); }
753 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
754 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
766 if (s) s->save(ostr);
768 saveData(os, result);
775 ostr << s->getDataTypeToken();
780 saveData(os, result);
784 void save(std::ostream &os)
const
788 saveData(os, myRunOver);
789 saveData(os, myAlign);
790 saveData(os, myUseCode);
791 saveData(os, myKernelName);
792 saveData(os, myKernelFile);
793 saveData(os, myKernelCode);
794 saveData(os, myAtBinding);
795 saveData(os, myKernelOptions);
796 saveData(os, myOptionAttribute);
797 saveData(os, myRecompile);
798 saveData(os, myOrigin);
799 saveData(os, mySize);
800 saveData(os, myVoxelSize);
801 saveData(os, myTime);
802 saveData(os, myFrame);
803 saveData(os, myTimeInc);
804 saveData(os, myFlushAttributes);
805 saveData(os, myFinish);
806 saveData(os, myTimeScale);
807 saveData(os, myTimeMethod);
808 saveData(os, myXNoise);
809 saveData(os, myWorksetsGeometry);
810 saveData(os, myWorksetsBeginAttr);
811 saveData(os, myWorksetsLengthAttr);
812 saveData(os, myWarnMissing);
813 saveData(os, myErrorMismatchedPoint);
814 saveData(os, myErrorMismatchedPrim);
815 saveData(os, mySingleWorkgroup);
816 saveData(os, myPrecision);
817 saveData(os, myImportPrequel);
820 UTwrite(os, &length);
823 auto && _curentry = myBindings(i);
825 saveData(os, _curentry.name);
826 saveData(os, _curentry.type);
827 saveData(os, _curentry.intval);
828 saveData(os, _curentry.fval);
829 saveData(os, _curentry.v2val);
830 saveData(os, _curentry.v3val);
831 saveData(os, _curentry.v4val);
832 saveData(os, _curentry.timescale);
833 saveData(os, _curentry.fieldname);
834 saveData(os, _curentry.fieldoffsets);
835 saveData(os, _curentry.ramp);
836 saveData(os, _curentry.rampsize);
837 saveData(os, _curentry.geometry);
838 saveData(os, _curentry.attribute);
839 saveData(os, _curentry.attribclass);
840 saveData(os, _curentry.attribtype);
841 saveData(os, _curentry.attribsize);
842 saveData(os, _curentry.volume);
843 saveData(os, _curentry.vdbtype);
844 saveData(os, _curentry.resolution);
845 saveData(os, _curentry.voxelsize);
846 saveData(os, _curentry.xformtoworld);
847 saveData(os, _curentry.xformtovoxel);
848 saveData(os, _curentry.precision);
849 saveData(os, _curentry.readable);
850 saveData(os, _curentry.writeable);
851 saveData(os, _curentry.optional);
852 saveData(os, _curentry.defval);
853 saveData(os, _curentry.dataname);
854 saveData(os, _curentry.optionname);
855 saveData(os, _curentry.optiontype);
856 saveData(os, _curentry.optionsize);
872 loadData(is, myRunOver);
873 loadData(is, myAlign);
874 loadData(is, myUseCode);
875 loadData(is, myKernelName);
876 loadData(is, myKernelFile);
877 loadData(is, myKernelCode);
878 loadData(is, myAtBinding);
879 loadData(is, myKernelOptions);
880 loadData(is, myOptionAttribute);
881 loadData(is, myRecompile);
882 loadData(is, myOrigin);
883 loadData(is, mySize);
884 loadData(is, myVoxelSize);
885 loadData(is, myTime);
886 loadData(is, myFrame);
887 loadData(is, myTimeInc);
888 loadData(is, myFlushAttributes);
889 loadData(is, myFinish);
890 loadData(is, myTimeScale);
891 loadData(is, myTimeMethod);
892 loadData(is, myXNoise);
893 loadData(is, myWorksetsGeometry);
894 loadData(is, myWorksetsBeginAttr);
895 loadData(is, myWorksetsLengthAttr);
896 loadData(is, myWarnMissing);
897 loadData(is, myErrorMismatchedPoint);
898 loadData(is, myErrorMismatchedPrim);
899 loadData(is, mySingleWorkgroup);
900 loadData(is, myPrecision);
901 loadData(is, myImportPrequel);
905 myBindings.setSize(length);
908 auto && _curentry = myBindings(i);
910 loadData(is, _curentry.name);
911 loadData(is, _curentry.type);
912 loadData(is, _curentry.intval);
913 loadData(is, _curentry.fval);
914 loadData(is, _curentry.v2val);
915 loadData(is, _curentry.v3val);
916 loadData(is, _curentry.v4val);
917 loadData(is, _curentry.timescale);
918 loadData(is, _curentry.fieldname);
919 loadData(is, _curentry.fieldoffsets);
920 loadData(is, _curentry.ramp);
921 loadData(is, _curentry.rampsize);
922 loadData(is, _curentry.geometry);
923 loadData(is, _curentry.attribute);
924 loadData(is, _curentry.attribclass);
925 loadData(is, _curentry.attribtype);
926 loadData(is, _curentry.attribsize);
927 loadData(is, _curentry.volume);
928 loadData(is, _curentry.vdbtype);
929 loadData(is, _curentry.resolution);
930 loadData(is, _curentry.voxelsize);
931 loadData(is, _curentry.xformtoworld);
932 loadData(is, _curentry.xformtovoxel);
933 loadData(is, _curentry.precision);
934 loadData(is, _curentry.readable);
935 loadData(is, _curentry.writeable);
936 loadData(is, _curentry.optional);
937 loadData(is, _curentry.defval);
938 loadData(is, _curentry.dataname);
939 loadData(is, _curentry.optionname);
940 loadData(is, _curentry.optiontype);
941 loadData(is, _curentry.optionsize);
1029 bool myFlushAttributes;
1038 bool myErrorMismatchedPoint;
1039 bool myErrorMismatchedPrim;
1040 int64 mySingleWorkgroup;
1042 bool myImportPrequel;
bool getImportPrequel() const
bool operator!=(const Bindings &src) const
GLenum GLuint GLenum GLsizei const GLchar * buf
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getKernelName() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator==(const GAS_OpenCLParms &src) const
void setOptionAttribute(const UT_StringHolder &val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setTimeMethod(int64 val)
void setRunOver(int64 val)
bool getFlushAttributes() const
bool getErrorMismatchedPrim() const
const char * getFieldNameSubclass(const char *recordtype, int fieldnum) const override
exint bread(int32 *buffer, exint asize=1)
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getErrorMismatchedPoint() const
UT_StringHolder createString(const UT_Array< Bindings > &list) const
bool isMyRecord(const char *recordtype) const
bool getWarnMissing() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setWorksetsGeometry(const UT_StringHolder &val)
UT_OptionType getFieldTypeSubclass(const char *recordtype, int fieldnum) const override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
constexpr SYS_FORCE_INLINE T & z() noexcept
const UT_StringHolder & getWorksetsGeometry() const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
Query(const SIM_Data *owner, const GAS_OpenCLParms &parms)
const GAS_OpenCLParms & myParms
**But if you need a result
bool getRecompile() const
void setAtBinding(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setUseCode(bool val)
UT_StringHolder attribute
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setTimeInc(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setImportPrequel(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool getFieldRawSubclass(const char *recordtype, int recordnum, const char *fieldname, UT_OptionEntryPtr &result) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, int64 v)
void setBindings(const UT_Array< Bindings > &val)
bool load(UT_IStream &is)
SIM_Query * createQueryObject(const SIM_Data *owner) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & z() noexcept
int64 getTimeMethod() const
UT_SharedPtr< UT_Ramp > ramp
exint read(bool *array, exint sz=1)
int64 getPrecision() const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setErrorMismatchedPoint(bool val)
void setVoxelSize(bool val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool getAtBinding() const
HUSD_API const char * resolution()
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder optionname
GLuint const GLchar * name
void setErrorMismatchedPrim(bool val)
const UT_Array< Bindings > & getBindings() const
static void saveData(std::ostream &os, UT_Matrix2D v)
const char * getRecordTypeNameSubclass(int recordtypenum) const override
int getNumRecordsSubclass(const char *recordtype) const override
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setRecompile(bool val)
const UT_StringHolder & getOptionAttribute() const
GT_API const UT_StringHolder version
GLenum GLint GLint * precision
exint entries() const
Alias of size(). size() is preferred.
const UT_StringHolder & getKernelFile() const
UT_StringHolder fieldname
void setPrecision(int64 val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setWorksetsLengthAttr(const UT_StringHolder &val)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setTimeScale(fpreal64 val)
const UT_StringHolder & getKernelCode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setWorksetsBeginAttr(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
static void loadData(UT_IStream &is, UT_Vector3D &v)
int getNumFieldsSubclass(const char *recordtype) const override
static void saveData(std::ostream &os, UT_StringHolder s)
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
bool operator!=(const GAS_OpenCLParms &src) const
bool operator==(const Bindings &src) const
void setWarnMissing(bool val)
const UT_StringHolder & getKernelOptions() const
void setSingleWorkgroup(int64 val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
const char * findChar(int c) const
void setKernelName(const UT_StringHolder &val)
void setKernelCode(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal64 getTimeScale() const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool getVoxelSize() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void setKernelOptions(const UT_StringHolder &val)
int64 getSingleWorkgroup() const
const UT_StringHolder & getWorksetsLengthAttr() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setKernelFile(const UT_StringHolder &val)
void setFlushAttributes(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_UniquePtr< UT_OptionEntry > UT_OptionEntryPtr
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
int getNumRecordTypesSubclass() const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
const UT_StringHolder & getWorksetsBeginAttr() const
constexpr SYS_FORCE_INLINE T & x() noexcept