13 #ifndef __GA_Attribute__
14 #define __GA_Attribute__
83 void buildFullOptions(
UT_Options &fulloptions)
const;
88 void extractBuiltinOptions();
114 {
return myExportOnMergeValid ? myExportOnMerge : defval; }
118 myExportOnMergeValid =
true;
128 {
return myExportOnSaveValid ? myExportOnSave : defval; }
132 myExportOnSaveValid =
true;
139 {
return myIsStringSetValid ? myIsStringSet : defval; }
143 myIsStringSetValid =
true;
157 bool removeOption(
const char *
name);
166 bool myIsNonTransforming : 1;
167 bool myExportOnMergeValid : 1, myExportOnMerge : 1;
168 bool myExportOnSaveValid : 1, myExportOnSave : 1;
170 bool myIsStringSetValid : 1, myIsStringSet : 1;
172 bool myExportToInfoBlock : 1;
173 bool myLeaveOnGPU : 1;
230 FLAG_TAIL_INITIALIZE = 1,
231 FLAG_STREAM_ACTIVE = 2,
232 FLAG_STREAM_NOPREEXIST = 4
236 {
return (myAttribFlags & flag) ?
true :
false; }
241 myAttribFlags |= (
int)flag;
243 myAttribFlags &= ~(
int)flag;
253 return myOptions.myTypeInfo;
261 myOptions.myTypeInfo =
type;
270 bool shouldInterpretAsTexCoord(
bool allow_float2=
false)
const;
276 int getTupleSize()
const;
302 myDataId = nextDataId();
324 bool allow_clear =
false)
326 if (allow_clear || src.myDataId != -1)
327 myDataId = src.myDataId;
334 bool allow_clear =
false)
336 cloneDataId(src, allow_clear);
347 virtual void tryCompressAllPages(
356 virtual void hardenAllPages(
368 WRITE_CONCURRENCE_ELEMENT
371 virtual WriteConcurrence getSupportedWriteConcurrence()
const = 0;
384 virtual const GA_AIFInterp *getAIFInterp()
const;
415 template <
typename T>
const T *
getAIF()
const {
return GAgetAIF<T>(*this); }
430 myOptions.setIsNonTransforming(val);
439 && !myOptions.isNonTransforming()
440 && GAisTransformingType(getTypeInfo())
441 && (include_P || strcmp(getName(),
"P") != 0);
446 return myOptions.myDetached;
457 void setExportName(
const char *external_name);
458 bool hasExportName()
const;
464 { myOptions.mergeOptions(src); }
467 bool importOption(
const char *name,
int &
v)
const;
468 bool importOption(
const char *name,
bool &
v)
const;
469 bool importOption(
const char *name,
fpreal32 &
v)
const;
470 bool importOption(
const char *name,
fpreal64 &
v)
const;
471 bool importOption(
const char *name,
UT_String &
v)
const;
477 virtual bool needDestruction()
const;
484 void setTailInitialization(
bool onoff);
488 {
return hasFlag(FLAG_TAIL_INITIALIZE); }
495 { reconstructElementBlock(offset,
GA_Offset(1)); }
506 virtual void compactStorage();
513 virtual void batchDeletion();
521 bool clone_options)
const;
603 virtual int getSaveVersion()
const;
606 virtual bool debugValidateArrayCapacity(
GA_Offset sz)
const;
615 virtual int64 getMemoryUsage(
bool inclusive)
const = 0;
639 const GA_Attribute *getMergeSource()
const {
return myMergeSource; }
658 {
return getCEAttribute(storage,
GA_PRECISION_32, tuplesize, isarray, read, write); }
661 void setCEAttribute(
GA_CEAttribute *ceattrib,
bool leaveOnGPU=
false);
665 void flushCEWriteCaches(
bool clearwriteback=
true);
666 bool hasPendingCEWriteBack()
const;
669 void flushCECaches();
686 {
return hasFlag(FLAG_STREAM_ACTIVE); }
689 { setFlag(FLAG_STREAM_ACTIVE, isstreaming); }
695 {
return !hasFlag(FLAG_STREAM_NOPREEXIST); }
698 { setFlag(FLAG_STREAM_NOPREEXIST, !preexisted); }
704 int64 getBaseMemoryUsage()
const;
709 myOptions.myDetached = detached;
772 bool detached = myOptions.myDetached;
773 myOptions = that->myOptions;
774 myOptions.myDetached = detached;
800 {
return copy(desti, *
this, srci); }
810 {
return copy(destrange, *
this, srcrange); }
821 {
return fill(destrange, *
this, srci); }
837 #define GA_GET_AIF_SPECIALIZATION(AIF_NAME) \
838 template <> SYS_STATIC_INLINE const GA_##AIF_NAME * \
839 GAgetAIF(const GA_Attribute &attrib) { return attrib.get##AIF_NAME(); } \
859 #undef GA_GET_AIF_SPECIALIZATION
885 : myAttribute(attribute)
886 , myStart(start_offset)
893 myAttribute.hardenAllPages(myStart, myEnd);
897 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)
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.
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
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)
GLuint const GLchar * name
#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.
GLubyte GLubyte GLubyte GLubyte w
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.
This class holds a reference to an attribute. Such an indirection level allows an easy way to invalid...
const UT_Options * options() const
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
bool needsTransform(bool include_P=true) const
GLsizei const GLchar *const * string
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 native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
SYS_FORCE_INLINE GA_DataId getDataId() const
GA_AttributeOptions & getOptions()
GA_AttributeScope getScope() const
virtual void copyNonStorageMetadata(const GA_Attribute *that)
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
GLenum GLint GLint * precision
SYS_FORCE_INLINE void clearDataId()
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.
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.
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()