13 #ifndef __GA_Attribute__
14 #define __GA_Attribute__
82 void buildFullOptions(
UT_Options &fulloptions)
const;
87 void extractBuiltinOptions();
113 {
return myExportOnMergeValid ? myExportOnMerge : defval; }
117 myExportOnMergeValid =
true;
127 {
return myExportOnSaveValid ? myExportOnSave : defval; }
131 myExportOnSaveValid =
true;
138 {
return myIsStringSetValid ? myIsStringSet : defval; }
142 myIsStringSetValid =
true;
156 bool removeOption(
const char *
name);
165 bool myIsNonTransforming : 1;
166 bool myExportOnMergeValid : 1, myExportOnMerge : 1;
167 bool myExportOnSaveValid : 1, myExportOnSave : 1;
169 bool myIsStringSetValid : 1, myIsStringSet : 1;
171 bool myExportToInfoBlock : 1;
172 bool myLeaveOnGPU : 1;
228 FLAG_TAIL_INITIALIZE = 1,
229 FLAG_STREAM_ACTIVE = 2,
230 FLAG_STREAM_NOPREEXIST = 4
234 {
return (myAttribFlags & flag) ?
true :
false; }
239 myAttribFlags |= (
int)flag;
241 myAttribFlags &= ~(
int)flag;
251 return myOptions.myTypeInfo;
259 myOptions.myTypeInfo =
type;
268 bool shouldInterpretAsTexCoord(
bool allow_float2=
false)
const;
274 int getTupleSize()
const;
300 myDataId = nextDataId();
322 bool allow_clear =
false)
324 if (allow_clear || src.myDataId != -1)
325 myDataId = src.myDataId;
332 bool allow_clear =
false)
334 cloneDataId(src, allow_clear);
345 virtual void tryCompressAllPages(
354 virtual void hardenAllPages(
366 WRITE_CONCURRENCE_ELEMENT
369 virtual WriteConcurrence getSupportedWriteConcurrence()
const = 0;
382 virtual const GA_AIFInterp *getAIFInterp()
const;
413 template <
typename T>
const T *
getAIF()
const {
return GAgetAIF<T>(*this); }
428 myOptions.setIsNonTransforming(val);
437 && !myOptions.isNonTransforming()
438 && GAisTransformingType(getTypeInfo())
439 && (include_P || strcmp(getName(),
"P") != 0);
444 return myOptions.myDetached;
455 void setExportName(
const char *external_name);
456 bool hasExportName()
const;
462 { myOptions.mergeOptions(src); }
465 bool importOption(
const char *name,
int &
v)
const;
466 bool importOption(
const char *name,
bool &
v)
const;
467 bool importOption(
const char *name,
fpreal32 &
v)
const;
468 bool importOption(
const char *name,
fpreal64 &
v)
const;
469 bool importOption(
const char *name,
UT_String &
v)
const;
475 virtual bool needDestruction()
const;
482 void setTailInitialization(
bool onoff);
486 {
return hasFlag(FLAG_TAIL_INITIALIZE); }
493 { reconstructElementBlock(offset,
GA_Offset(1)); }
504 virtual void compactStorage();
511 virtual void batchDeletion();
519 bool clone_options)
const;
601 virtual int getSaveVersion()
const;
604 virtual bool debugValidateArrayCapacity(
GA_Offset sz)
const;
613 virtual int64 getMemoryUsage(
bool inclusive)
const = 0;
637 const GA_Attribute *getMergeSource()
const {
return myMergeSource; }
656 {
return getCEAttribute(storage,
GA_PRECISION_32, tuplesize, isarray, read, write); }
661 void flushCEWriteCaches(
bool clearwriteback=
true);
662 bool hasPendingCEWriteBack()
const;
665 void flushCECaches();
679 {
return hasFlag(FLAG_STREAM_ACTIVE); }
682 { setFlag(FLAG_STREAM_ACTIVE, isstreaming); }
688 {
return !hasFlag(FLAG_STREAM_NOPREEXIST); }
691 { setFlag(FLAG_STREAM_NOPREEXIST, !preexisted); }
697 int64 getBaseMemoryUsage()
const;
702 myOptions.myDetached = detached;
760 bool detached = myOptions.myDetached;
761 myOptions = that->myOptions;
762 myOptions.myDetached = detached;
788 {
return copy(desti, *
this, srci); }
798 {
return copy(destrange, *
this, srcrange); }
809 {
return fill(destrange, *
this, srci); }
825 #define GA_GET_AIF_SPECIALIZATION(AIF_NAME) \
826 template <> SYS_STATIC_INLINE const GA_##AIF_NAME * \
827 GAgetAIF(const GA_Attribute &attrib) { return attrib.get##AIF_NAME(); } \
847 #undef GA_GET_AIF_SPECIALIZATION
873 : myAttribute(attribute)
874 , myStart(start_offset)
877 myAttribute.hardenAllPages(myStart, myEnd);
881 myAttribute.tryCompressAllPages(myStart, myEnd);
A class to manage an ordered array which has fixed offset handles.
GA_CEAttribute * getCEAttribute(GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
UT_UniquePtr< const GA_Attribute > GA_ConstAttributeUPtr
SYS_FORCE_INLINE void bumpDataId()
Definition of a geometry attribute.
Generic Attribute Interface class to access an attribute as a array.
Generic Attribute Interface class to get/set data as index pairs.
virtual bool copy(const GA_Range &destrange, const GA_Range &srcrange)
GLuint const GLchar * name
void setTypeInfo(GA_TypeInfo t)
UT_IntrusivePtr< GA_AttributeProxy > GA_AttributeProxyHandle
UT_IntrusivePtr< const GA_AttributeProxy > GA_ConstAttributeProxyHandle
A specialization of GA_AIFDictTuple to access "shared strings".
bool exportOnSave(bool defval=false) const
Attribute Interface class to perform numeric operations on attributes.
ImageBuf OIIO_API fill(cspan< float > values, ROI roi, int nthreads=0)
GLuint const GLfloat * val
GA_Attribute * create(const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, const UT_Options *creation_options, const GA_AttributeOptions *attribute_options) const
Attribute Interface for accessing generic blob data.
GA_ConstAttributeProxyHandle getProxy() const
The merge map keeps track of information when merging details.
void setExportOnMerge(bool v)
Set the export on merge flag.
~GA_AutoHardenForThreading()
void setExportOnSave(bool v)
Set the export on save flag.
bool hasFlag(AttribFlag flag) const
void setExportToInfoBlock(bool v)
JSON reader class which handles parsing of JSON or bJSON files.
Class which writes ASCII or binary JSON streams.
void setExistedPriorToStream(bool preexisted)
#define GA_INVALID_DATAID
virtual bool matchesStorage(const GA_Attribute *that) const
const UT_StringHolder & getName() const
SYS_FORCE_INLINE int getTypeId() const
void read(T &in, bool &v)
No concurrent writes supported.
#define GA_INVALID_OFFSET
A range of elements in an index-map.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
SYS_FORCE_INLINE void cloneDataId(const GA_Attribute &src, bool allow_clear=false)
virtual bool fill(const GA_Range &destrange, GA_Offset srci)
void setFlag(AttribFlag flag, bool onoff)
Attribute Interface for accessing generic blob data.
Automatically expand attribute data pages for threading.
const UT_StringHolder & getFullName() const
Attribute Interface for merging attribute data between details.
std::string OIIO_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
GLint GLenum GLsizei GLint GLsizei const void * data
This class holds a reference to an attribute. Such an indirection level allows an easy way to invalid...
const UT_Options * options() const
bool needsTransform(bool include_P=true) const
GLubyte GLubyte GLubyte GLubyte w
Class to fill GA_Stat information about an attribute. This AIF is used to fill GA_Stat type informati...
A specialization of GA_AIFStringArray to access "shared strings".
GA_AutoHardenForThreading(GA_Attribute &attribute, GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)
void mergeOptions(const GA_AttributeOptions &src)
Merge the options passed in with the options in the attribute.
Attribute Interface class to perform comparisons on attributes.
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
Defragmentation of IndexMaps.
void setLeaveOnGPU(bool v)
OPENVDB_API void initialize()
Global registration of basic types.
SYS_FORCE_INLINE GA_DataId getDataId() const
GA_AttributeOptions & getOptions()
GA_AttributeScope getScope() const
virtual void copyNonStorageMetadata(const GA_Attribute *that)
GLuint GLuint GLsizei GLenum type
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
#define GA_GET_AIF_SPECIALIZATION(AIF_NAME)
const GA_AttributeType & getType() const
bool exportToInfoBlock() const
GT_API const UT_StringHolder version
SYS_FORCE_INLINE void clearDataId()
GLsizei const GLchar *const * string
A map of string to various well defined value types.
bool exportOnMergeSet() const
void setDetached(bool detached)
Only called by GA_AttributeSet and GA_ElementGroup.
void setActivelyStreamed(bool isstreaming)
SYS_FORCE_INLINE GA_TypeInfo getTypeInfo() const
const GA_IndexMap & getIndexMap() const
virtual bool copy(GA_Offset desti, GA_Offset srci)
void reconstructElement(GA_Offset offset)
const T * getAIF() const
Generic method for getting an AIF by type.
GA_TypeInfo typeInfo() const
bool isStringSet(bool defval=false) const
const GA_AttributeOptions & getOptions() const
A specialization of GA_AIFDictArray to access "shared strings".
A specialization of GA_AIFStringTuple to access "shared strings".
Concurrent writes to separate pages supported.
OIIO_API bool copy(string_view from, string_view to, std::string &err)
Attribute Interface for blind data per element.
bool isNonTransforming() const
#define SYS_UNIMPLEMENTED_TEMPLATE(T)
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
bool exportOnSaveSet() const
getOption("OpenEXR.storage") storage
Container class for all geometry.
Attribute Interface class to copy attribute data.
void setNonTransforming(bool val)
bool isTailInitialization() const
Check whether the attribute is set to tail initialization.
bool existedPriorToStream() const
SYS_FORCE_INLINE void assignNewDataId()
Attribute Interface for file I/O.
void setIsNonTransforming(bool v)
SYS_FORCE_INLINE void setTypeInfo(GA_TypeInfo type)
bool exportOnMerge(bool defval=false) const
void write(T &out, bool v)
AIF to record changes to attribute values.
SYS_FORCE_INLINE void cloneOrBumpDataId(const GA_Attribute &src, bool allow_clear=false)
NOTE: Just call cloneDataId(src).
Generic Attribute Interface class to access an attribute as a tuple.
GLenum GLint GLint * precision
bool isActivelyStreamed() const
Generic Attribute Interface class to work with string indices directly, rather than string values...
void setIsStringSet(bool v)
Set the "string set" flag.
GA_AttributeProxyHandle getProxy()