13 #ifndef __GA_Attribute__
14 #define __GA_Attribute__
84 void buildFullOptions(
UT_Options &fulloptions)
const;
89 void extractBuiltinOptions();
115 {
return myExportOnMergeValid ? myExportOnMerge : defval; }
119 myExportOnMergeValid =
true;
129 {
return myExportOnSaveValid ? myExportOnSave : defval; }
133 myExportOnSaveValid =
true;
140 {
return myIsStringSetValid ? myIsStringSet : defval; }
144 myIsStringSetValid =
true;
158 bool removeOption(
const char *
name);
167 bool myIsNonTransforming : 1;
168 bool myExportOnMergeValid : 1, myExportOnMerge : 1;
169 bool myExportOnSaveValid : 1, myExportOnSave : 1;
171 bool myIsStringSetValid : 1, myIsStringSet : 1;
173 bool myExportToInfoBlock : 1;
174 bool myLeaveOnGPU : 1;
231 FLAG_TAIL_INITIALIZE = 1,
232 FLAG_STREAM_ACTIVE = 2,
233 FLAG_STREAM_NOPREEXIST = 4
237 {
return (myAttribFlags & flag) ?
true :
false; }
242 myAttribFlags |= (
int)flag;
244 myAttribFlags &= ~(
int)flag;
254 return myOptions.myTypeInfo;
262 myOptions.myTypeInfo =
type;
271 bool shouldInterpretAsTexCoord(
bool allow_float2=
false)
const;
277 int getTupleSize()
const;
303 myDataId = nextDataId();
325 bool allow_clear =
false)
327 if (allow_clear || src.myDataId != -1)
328 myDataId = src.myDataId;
335 bool allow_clear =
false)
337 cloneDataId(src, allow_clear);
348 virtual void tryCompressAllPages(
357 virtual void hardenAllPages(
369 WRITE_CONCURRENCE_ELEMENT
372 virtual WriteConcurrence getSupportedWriteConcurrence()
const = 0;
385 virtual const GA_AIFInterp *getAIFInterp()
const;
416 template <
typename T>
const T *
getAIF()
const {
return GAgetAIF<T>(*this); }
431 myOptions.setIsNonTransforming(val);
440 && !myOptions.isNonTransforming()
441 && GAisTransformingType(getTypeInfo())
442 && (include_P || strcmp(
getName(),
"P") != 0);
447 return myOptions.myDetached;
458 void setExportName(
const char *external_name);
459 bool hasExportName()
const;
465 { myOptions.mergeOptions(src); }
468 bool importOption(
const char *name,
int &
v)
const;
469 bool importOption(
const char *name,
bool &
v)
const;
470 bool importOption(
const char *name,
fpreal32 &
v)
const;
471 bool importOption(
const char *name,
fpreal64 &
v)
const;
472 bool importOption(
const char *name,
UT_String &
v)
const;
478 virtual bool needDestruction()
const;
485 void setTailInitialization(
bool onoff);
489 {
return hasFlag(FLAG_TAIL_INITIALIZE); }
496 { reconstructElementBlock(offset,
GA_Offset(1)); }
507 virtual void compactStorage();
514 virtual void batchDeletion();
522 bool clone_options)
const;
604 virtual int getSaveVersion()
const;
607 virtual bool debugValidateArrayCapacity(
GA_Offset sz)
const;
616 virtual int64 getMemoryUsage(
bool inclusive)
const = 0;
631 virtual void countMemory(
UT_MemoryCounter &counter,
bool inclusive)
const = 0;
640 const GA_Attribute *getMergeSource()
const {
return myMergeSource; }
659 {
return getCEAttribute(storage,
GA_PRECISION_32, tuplesize, isarray, read, write); }
662 void setCEAttribute(
GA_CEAttribute *ceattrib,
bool leave_on_gpu=
false);
666 void flushCEWriteCaches(
bool clearwriteback=
true);
667 bool hasPendingCEWriteBack()
const;
670 void flushCECaches();
687 {
return hasFlag(FLAG_STREAM_ACTIVE); }
690 { setFlag(FLAG_STREAM_ACTIVE, isstreaming); }
696 {
return !hasFlag(FLAG_STREAM_NOPREEXIST); }
699 { setFlag(FLAG_STREAM_NOPREEXIST, !preexisted); }
705 int64 getBaseMemoryUsage()
const;
710 myOptions.myDetached = detached;
773 bool detached = myOptions.myDetached;
774 myOptions = that->myOptions;
775 myOptions.myDetached = detached;
801 {
return copy(desti, *
this, srci); }
811 {
return copy(destrange, *
this, srcrange); }
822 {
return fill(destrange, *
this, srci); }
838 #define GA_GET_AIF_SPECIALIZATION(AIF_NAME) \
839 template <> SYS_STATIC_INLINE const GA_##AIF_NAME * \
840 GAgetAIF(const GA_Attribute &attrib) { return attrib.get##AIF_NAME(); } \
860 #undef GA_GET_AIF_SPECIALIZATION
886 : myAttribute(attribute)
887 , myStart(start_offset)
894 myAttribute.hardenAllPages(myStart, myEnd);
898 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()
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.
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
SYS_FORCE_INLINE const GA_IndexMap & getIndexMap() const
GLsizei const GLchar *const * string
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.
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
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)
Attribute Interface for accessing generic blob data.
Automatically expand attribute data pages for threading.
SYS_FORCE_INLINE bool isGroup() const
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
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
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.
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.