13 #ifndef __GA_Attribute__
14 #define __GA_Attribute__
89 void buildFullOptions(
UT_Options &fulloptions)
const;
94 void extractBuiltinOptions();
120 {
return myExportOnMergeValid ? myExportOnMerge : defval; }
124 myExportOnMergeValid =
true;
134 {
return myExportOnSaveValid ? myExportOnSave : defval; }
138 myExportOnSaveValid =
true;
145 {
return myIsStringSetValid ? myIsStringSet : defval; }
149 myIsStringSetValid =
true;
163 bool removeOption(
const char *
name);
172 bool myIsNonTransforming : 1;
173 bool myExportOnMergeValid : 1, myExportOnMerge : 1;
174 bool myExportOnSaveValid : 1, myExportOnSave : 1;
176 bool myIsStringSetValid : 1, myIsStringSet : 1;
178 bool myExportToInfoBlock : 1;
179 bool myLeaveOnGPU : 1;
236 FLAG_TAIL_INITIALIZE = 1,
237 FLAG_STREAM_ACTIVE = 2,
238 FLAG_STREAM_NOPREEXIST = 4
242 {
return (myAttribFlags & flag) ?
true :
false; }
247 myAttribFlags |= (
int)flag;
249 myAttribFlags &= ~(
int)flag;
259 return myOptions.myTypeInfo;
267 myOptions.myTypeInfo =
type;
276 bool shouldInterpretAsTexCoord(
bool allow_float2=
false)
const;
282 int getTupleSize()
const;
286 bool getIsArray()
const;
312 myDataId = nextDataId();
334 bool allow_clear =
false)
336 if (allow_clear || src.myDataId != -1)
337 myDataId = src.myDataId;
344 bool allow_clear =
false)
346 cloneDataId(src, allow_clear);
357 virtual void tryCompressAllPages(
366 virtual void hardenAllPages(
378 WRITE_CONCURRENCE_ELEMENT
381 virtual WriteConcurrence getSupportedWriteConcurrence()
const = 0;
394 virtual const GA_AIFInterp *getAIFInterp()
const;
425 template <
typename T>
const T *
getAIF()
const {
return GAgetAIF<T>(*this); }
440 myOptions.setIsNonTransforming(val);
449 && !myOptions.isNonTransforming()
450 && GAisTransformingType(getTypeInfo())
451 && (include_P || strcmp(
getName(),
"P") != 0);
456 return myOptions.myDetached;
467 void setExportName(
const char *external_name);
468 bool hasExportName()
const;
469 std::string getExportName()
const;
474 { myOptions.mergeOptions(src); }
477 bool importOption(
const char *name,
int &
v)
const;
478 bool importOption(
const char *name,
bool &
v)
const;
479 bool importOption(
const char *name,
fpreal32 &
v)
const;
480 bool importOption(
const char *name,
fpreal64 &
v)
const;
481 bool importOption(
const char *name,
UT_String &
v)
const;
487 virtual bool needDestruction()
const;
494 void setTailInitialization(
bool onoff);
498 {
return hasFlag(FLAG_TAIL_INITIALIZE); }
505 { reconstructElementBlock(offset,
GA_Offset(1)); }
516 virtual void compactStorage();
523 virtual void batchDeletion();
531 bool clone_options)
const;
613 virtual int getSaveVersion()
const;
616 virtual bool debugValidateArrayCapacity(
GA_Offset sz)
const;
625 virtual int64 getMemoryUsage(
bool inclusive)
const = 0;
626 virtual int64 getDeviceMemoryUsage()
const;
641 virtual void countMemory(
UT_MemoryCounter &counter,
bool inclusive)
const = 0;
650 const GA_Attribute *getMergeSource()
const {
return myMergeSource; }
669 bool isarray,
bool read,
bool write)
674 int &tuplesize,
bool isarray,
675 bool read,
bool write);
683 bool isarray,
bool read,
bool write)
684 {
return getCEAttributeAccessor(storage,
GA_PRECISION_32, tuplesize, isarray,
688 {
return getCEAttributeAccessor(storage,
GA_PRECISION_32, tuplesize, isarray,
692 {
return getCEAttributeAccessor(storage,
GA_PRECISION_32, tuplesize, isarray,
696 {
return getCEAttributeAccessor(storage,
GA_PRECISION_32, tuplesize, isarray,
700 int &tuplesize,
bool isarray,
701 bool read,
bool write);
722 void flushCEWriteCaches(
bool clearwriteback=
true);
723 bool hasPendingCEWriteBack()
const;
726 void flushCECaches();
729 void clearCECaches();
751 {
return hasFlag(FLAG_STREAM_ACTIVE); }
754 { setFlag(FLAG_STREAM_ACTIVE, isstreaming); }
760 {
return !hasFlag(FLAG_STREAM_NOPREEXIST); }
763 { setFlag(FLAG_STREAM_NOPREEXIST, !preexisted); }
769 int64 getBaseMemoryUsage()
const;
774 myOptions.myDetached = detached;
837 bool detached = myOptions.myDetached;
838 myOptions = that->myOptions;
839 myOptions.myDetached = detached;
865 {
return copy(desti, *
this, srci); }
875 {
return copy(destrange, *
this, srcrange); }
886 {
return fill(destrange, *
this, srci); }
900 mutable bool myCEAttributeBuilt;
903 #define GA_GET_AIF_SPECIALIZATION(AIF_NAME) \
904 template <> SYS_STATIC_INLINE const GA_##AIF_NAME * \
905 GAgetAIF(const GA_Attribute &attrib) { return attrib.get##AIF_NAME(); } \
925 #undef GA_GET_AIF_SPECIALIZATION
951 : myAttribute(attribute)
952 , myStart(start_offset)
959 myAttribute.hardenAllPages(myStart, myEnd);
963 myAttribute.tryCompressAllPages(myStart, myEnd);
A class to manage an ordered array which has fixed offset handles.
UT_SharedPtr< GA_CEAttribute > GA_CEAttributePtr
UT_UniquePtr< const GA_Attribute > GA_ConstAttributeUPtr
GA_CEAttributeAccessorPtr getCEAttributeAccessorR(GA_StorageClass storage, int &tuplesize, bool isarray)
SYS_FORCE_INLINE void bumpDataId()
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
SYS_FORCE_INLINE const GA_Detail & getDetail() const
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)
SYS_FORCE_INLINE GA_Detail & getDetail()
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
getFileOption("OpenEXR:storage") storage
Attribute Interface class to perform numeric operations on attributes.
SYS_FORCE_INLINE const GA_IndexMap & getIndexMap() const
GA_CEAttributeAccessorPtr getCEAttributeAccessor(GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
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.
The merge map keeps track of information when merging details.
GA_CEAttributeAccessorPtr getCEAttributeAccessorW(GA_StorageClass storage, int &tuplesize, bool isarray)
void setExportOnMerge(bool v)
Set the export on merge flag.
~GA_AutoHardenForThreading()
void setExportOnSave(bool v)
Set the export on save flag.
SYS_FORCE_INLINE GA_AttributeScope getScope() const
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
SYS_FORCE_INLINE int getTypeId() const
SYS_FORCE_INLINE const GA_AttributeType & getType() const
No concurrent writes supported.
#define GA_INVALID_OFFSET
GA_CEAttributePtr getCEAttribute(GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
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 const UT_StringHolder & getName() const
SYS_FORCE_INLINE GA_ConstAttributeProxyHandle getProxy() const
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)
GLint GLint GLsizei GLint GLenum GLenum type
Attribute Interface for accessing generic blob data.
Automatically expand attribute data pages for threading.
SYS_FORCE_INLINE bool isGroup() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Attribute Interface for merging attribute data between details.
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
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
UT_SharedPtr< const GA_CEAttribute > GA_CEAttributeConstPtr
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.
Defragmentation of IndexMaps.
void setLeaveOnGPU(bool v)
GLuint const GLchar * name
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()
SYS_FORCE_INLINE GA_AttributeProxyHandle getProxy()
virtual void copyNonStorageMetadata(const GA_Attribute *that)
UT_UniquePtr< GA_Attribute > GA_AttributeUPtr
#define GA_GET_AIF_SPECIALIZATION(AIF_NAME)
bool exportToInfoBlock() const
GT_API const UT_StringHolder version
UT_SharedPtr< GA_CEAttributeAccessor > GA_CEAttributeAccessorPtr
GLenum GLint GLint * precision
SYS_FORCE_INLINE const UT_StringHolder & getFullName() const
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
virtual bool copy(GA_Offset desti, GA_Offset srci)
void reconstructElement(GA_Offset offset)
LeafData & operator=(const LeafData &)=delete
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
SYS_FORCE_INLINE GA_AttributeOwner getOwner() const
Container class for all geometry.
Attribute Interface class to copy attribute data.
GLubyte GLubyte GLubyte GLubyte w
void setNonTransforming(bool val)
bool isTailInitialization() const
Check whether the attribute is set to tail initialization.
GA_CEAttributeAccessorPtr getCEAttributeAccessorRW(GA_StorageClass storage, int &tuplesize, bool isarray)
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
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.