13 #ifndef __GA_ATIBlob__
14 #define __GA_ATIBlob__
47 template <
typename T>
class UT_Array;
95 static void registerType();
98 {
return theAttributeType->getTypeName(); }
107 if (&attrib->
getType() == theAttributeType)
109 if (dynamic_cast<const GA_ATIBlob *>(attrib))
124 return static_cast<const GA_ATIBlob *
>(attrib);
164 {
return myHandles.getTupleSize(); }
168 {
return myBlobs.entries(); }
174 {
return myBlobs.getMaximumIndex(); }
178 {
return myBlobs.capacity(); }
185 return GA_BlobIndex(myHandles.get(offset, tuple_index));
196 int tuple_index = 0);
203 return lookupBlob(getBlobIndex(offset, tuple_idx));
208 return lookupRawBlob(getBlobIndex(offset, tuple_idx));
214 int tuple_index = 0);
225 {
return myBlobs.getBlob(handle); }
229 {
return myBlobs.getRawBlob(handle); }
234 {
return myBlobs.getOrderedBlob(idx); }
242 {
return myBlobs.getOccupancy(); }
253 const GA_AIFInterp *
getAIFInterp()
const override {
return myAIFInterp; }
265 const char *blobtoken =
"data")
const;
279 const char *blobtoken =
"data");
287 return myBlobs.extractBlobs(blobs, handles);
292 return myBlobs.extractBlobs(blobs, handles, maxblobs);
336 copyData(desti,
this, srci);
344 copyData(desti, UTverify_cast<const GA_ATIBlob *>(&
src), srci);
349 copyData(desti, &src, srci);
357 const GA_Range &srcrange)
override final
359 return copyData(destrange,
this, srcrange);
366 return copyData(destrange, UTverify_cast<const GA_ATIBlob*>(&
src), srcrange);
370 return copyData(destrange, &src, srcrange);
378 fillData(destrange,
this, srci);
386 fillData(destrange, UTverify_cast<const GA_ATIBlob *>(&
src), srci);
391 fillData(destrange, &src, srci);
397 bool validate()
const;
403 virtual bool setTupleSize(
int size);
418 void mergeDestroyDestination(
const GA_MergeMap &map,
477 template <
typename T>
486 static GA_AIFInterp *myAIFInterp;
491 friend class ga_BlobBlob;
492 friend class ga_BlobMerge;
493 friend class ga_BlobCopyData;
494 friend class ga_BlobCompare;
fpreal getStorageOccupancy()
Get a measure of the vacancy entropy of the storage container. This.
A class to manage an ordered array which has fixed offset handles.
HandleArrayType myHandles
bool copy(const GA_Range &destrange, const GA_Range &srcrange) overridefinal
Definition of a geometry attribute.
Used to pass options and map offset values during saving.
int getTupleSize() const
Size of the AIFTuple, if it exists. If it doesn't, 1.
bool fill(const GA_Range &destrange, const GA_ATIBlob &src, GA_Offset srci)
SYS_FORCE_INLINE GA_BlobIndex getBlobIndex(GA_Offset offset, int tuple_index=0) const
Look up a blob handle by offset.
The merge map keeps track of information when merging details.
virtual void reconstructElementBlock(GA_Offset offset, GA_Offset nelements)=0
bool matchesStorage(const GA_Attribute *that) const override
bool fill(const GA_Range &destrange, GA_Offset srci) overridefinal
JSON reader class which handles parsing of JSON or bJSON files.
virtual bool setArraySize(GA_Offset size)=0
A simple ATI to store aribtrary "blobs" of data in an attribute.
Class which writes ASCII or binary JSON streams.
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
virtual void countMemory(UT_MemoryCounter &counter, bool inclusive) const =0
Standard user attribute level.
const GA_AIFCompare * getAIFCompare() const override
Return the attribute's comparison interface or NULL.
virtual int64 getMemoryUsage(bool inclusive) const =0
virtual bool matchesStorage(const GA_Attribute *that) const
virtual void tryCompressAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
SYS_FORCE_INLINE GA_BlobRef getBlob(GA_Offset offset, int tuple_idx=0) const
SYS_FORCE_INLINE const GA_AttributeType & getType() const
#define GA_INVALID_OFFSET
A range of elements in an index-map.
static SYS_FORCE_INLINE const GA_ATIBlob * cast(const GA_Attribute *attrib)
static GA_Attribute * create(const GA_IndexMap &index_map, const UT_StringHolder &name, int tuple_size)
WriteConcurrence getSupportedWriteConcurrence() const override
virtual bool needDestruction() const
Methods which can be overridden from GA_Attribute.
SYS_FORCE_INLINE int getTupleSize() const
Get the tuple size.
Attribute Interface for accessing generic blob data.
int entries() const
Return the entries in the blob container.
Utility class to load blob data from a JSON stream.
virtual void replace(const GA_Attribute &src)=0
Attribute Interface for merging attribute data between details.
bool copy(GA_Offset desti, const GA_Attribute &src, GA_Offset srci) overridefinal
UT_IndexedHashMapItemId GA_BlobIndex
const GA_AIFCopyData * getAIFCopyData() const override
Return the attribute's copy interface or NULL.
SYS_FORCE_INLINE const GA_BlobData * getRawBlob(GA_Offset offset, int tuple_idx=0) const
SYS_FORCE_INLINE const GA_BlobData * lookupRawBlob(GA_BlobIndex handle) const
static SYS_FORCE_INLINE GA_ATIBlob * cast(GA_Attribute *attrib)
#define GA_INVALID_BLOB_INDEX
Attribute Interface class to perform comparisons on attributes.
Defragmentation of IndexMaps.
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
int capacity() const
Return the capacity of the blob container.
GA_BlobRef getOrderedBlob(exint idx) const
Lookup a blob given an ordered index.
GA_PageArray< int32 > HandleArrayType
A map of string to various well defined value types.
virtual ~GA_BlobDataLoader()
const GA_AIFBlob * getAIFBlob() const override
Return the attribute's blob interface or NULL.
static SYS_FORCE_INLINE bool isType(const GA_Attribute *attrib)
bool copy(const GA_Range &destrange, const GA_ATIBlob &src, const GA_Range &srcrange)
SYS_FORCE_INLINE GA_BlobRef lookupBlob(GA_BlobIndex handle) const
Concurrent writes to separate pages supported.
GA_BlobContainer myBlobs
Blob references. This is protected for convenience to sub-classes.
virtual void compactStorage()
int extractBlobs(UT_Array< GA_BlobRef > &blobs, UT_IntArray &handles) const
const GA_AIFMerge * getAIFMerge() const override
Return the attribute's merge interface or NULL.
bool copy(GA_Offset desti, const GA_ATIBlob &src, GA_Offset srci)
static SYS_FORCE_INLINE const GA_AttributeType & getType()
bool copy(const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange) overridefinal
virtual void destructElement(GA_Offset offset)
Callback invoked if needsDestruction() returns true.
Attribute Interface class to copy attribute data.
GLubyte GLubyte GLubyte GLubyte w
GA_BlobIndex getMaximumIndex() const
static SYS_FORCE_INLINE const UT_StringHolder & getTypeName()
bool copy(GA_Offset desti, GA_Offset srci) overridefinal
virtual void hardenAllPages(GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0
virtual void defragment(const GA_Defragment &defrag)=0
int extractBlobs(UT_Array< GA_BlobRef > &blobs, UT_IntArray &handles, exint maxblobs) const
bool fill(const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci) overridefinal
Container to store blobs of arbitrary data for attributes.
const GA_AIFInterp * getAIFInterp() const override
Return the attribute's interpolation interface or NULL.