HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AIFBlob Class Referenceabstract

Attribute Interface for accessing generic blob data. More...

#include <GA_AIFBlob.h>

Classes

class  BlobBuffer
 Class which holds temporary references to blobs. More...
 

Public Member Functions

 GA_AIFBlob ()
 
virtual ~GA_AIFBlob ()
 
virtual int getTupleSize (const GA_Attribute *attrib) const =0
 Return the number of blobs per element. More...
 
virtual bool setTupleSize (GA_Attribute *attrib, int size) const =0
 Set the tuple size. More...
 
virtual GA_Size getBlobCount (const GA_Attribute *attrib) const =0
 Return the total number of unique blobs stored in the attribute. More...
 
virtual GA_BlobRef lookupBlob (const GA_Attribute *attrib, GA_BlobIndex handle) const =0
 Given a blob integer identifier, return a handle to the actual blob data. More...
 
virtual GA_BlobRef lookupOrderedBlob (const GA_Attribute *attrib, exint index) const =0
 
virtual GA_BlobIndex getBlobIndex (const GA_Attribute *atr, GA_Offset offset, int tuple_index=0) const =0
 
virtual GA_BlobRef getBlob (const GA_Attribute *attrib, GA_Offset offset, int tuple_index=0) const =0
 Get the blob data associated with the tuple index of the given element. More...
 
virtual bool setBlob (GA_Attribute *attrib, const GA_BlobRef &blob, GA_Offset offset, int tuple_index=0) const =0
 Store a blob on the given element. More...
 
virtual bool replaceBlob (GA_Attribute *attrib, GA_BlobIndex handle, const GA_BlobRef &new_blob) const =0
 
virtual void compactStorage (GA_Attribute *attrib) const =0
 Compact the storage by removing empty indexes. More...
 
virtual bool arrayReserve (GA_Attribute *attrib, int length) const
 Reserve space for an array of the given size. More...
 
virtual bool arrayTruncate (GA_Attribute *attrib, int length) const
 Truncate the array to the given entries. More...
 
virtual int arrayTrim (GA_Attribute *attrib) const
 
virtual int arrayAppendBlob (GA_Attribute *attrib, const GA_BlobRef &blob, GA_Offset element_index=GA_Offset(0)) const
 Append an element to the end of the array for the given element. More...
 
virtual int arrayAppendUniqueBlob (GA_Attribute *attrib, const GA_BlobRef &blob, GA_Offset element_index=GA_Offset(0)) const
 
virtual int arrayAppendBlobIndex (GA_Attribute *attrib, GA_BlobIndex handle, GA_Offset element_index=GA_Offset(0)) const
 Append an element to the end of the array for the given element. More...
 
virtual int arrayAppendUniqueBlobIndex (GA_Attribute *attrib, GA_BlobIndex handle, GA_Offset element_index=GA_Offset(0)) const
 
virtual int arrayGetLength (const GA_Attribute *attrib, GA_Offset element_index=GA_Offset(0)) const
 
virtual int arrayGetMaxLength (const GA_Attribute *attrib, const GA_Range &range) const
 Return the maximum length of all elements in the range. More...
 
virtual GA_BlobIndex arrayGetBlobIndex (const GA_Attribute *attrib, int array_index, GA_Offset element_index=GA_Offset(0)) const
 Return the blob handle for the item at the given array index. More...
 
virtual GA_BlobRef arrayGetBlob (const GA_Attribute *attrib, int array_index, GA_Offset element_index=GA_Offset(0)) const
 Return the blob for the item at the given array index. More...
 
virtual int arrayGetBlobs (GA_BlobRefList &list, const GA_Attribute *attrib, GA_Offset element_index=GA_Offset(0)) const
 
virtual int arrayFindBlob (const GA_Attribute *attrib, const GA_BlobRef &blob, GA_Offset element_index=GA_Offset(0)) const
 
virtual bool arrayDestroyBlob (GA_Attribute *attrib, int array_index, GA_Offset element_index=GA_Offset(0)) const
 
virtual int arrayRemoveDuplicates (GA_Attribute *attrib, GA_Offset element_index=GA_Offset(0)) const
 

Protected Member Functions

virtual GA_BlobIndex addBlobReference (GA_Attribute *attrib, const GA_BlobRef &blob) const =0
 
virtual void delBlobReference (GA_Attribute *attrib, GA_BlobIndex handle) const =0
 

Friends

class BlobBuffer
 

Detailed Description

Attribute Interface for accessing generic blob data.

This attribute interface allows access to blob data on an attribute. This is provided automatically if you inherit from GA_ATIBlob.

Definition at line 39 of file GA_AIFBlob.h.

Constructor & Destructor Documentation

GA_AIFBlob::GA_AIFBlob ( )
virtual GA_AIFBlob::~GA_AIFBlob ( )
virtual

Member Function Documentation

virtual GA_BlobIndex GA_AIFBlob::addBlobReference ( GA_Attribute attrib,
const GA_BlobRef blob 
) const
protectedpure virtual

Methods used by the BlobBuffer methods to add an unreferenced blob to the attribute.

virtual int GA_AIFBlob::arrayAppendBlob ( GA_Attribute attrib,
const GA_BlobRef blob,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual

Append an element to the end of the array for the given element.

virtual int GA_AIFBlob::arrayAppendBlobIndex ( GA_Attribute attrib,
GA_BlobIndex  handle,
GA_Offset  element_index = GA_Offset(0) 
) const
inlinevirtual

Append an element to the end of the array for the given element.

Definition at line 194 of file GA_AIFBlob.h.

virtual int GA_AIFBlob::arrayAppendUniqueBlob ( GA_Attribute attrib,
const GA_BlobRef blob,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual

Append an element to the array, but only if the element is unique in the array.

virtual int GA_AIFBlob::arrayAppendUniqueBlobIndex ( GA_Attribute attrib,
GA_BlobIndex  handle,
GA_Offset  element_index = GA_Offset(0) 
) const
inlinevirtual

Append an element to the array, but only if the element is unique in the array.

Definition at line 205 of file GA_AIFBlob.h.

virtual bool GA_AIFBlob::arrayDestroyBlob ( GA_Attribute attrib,
int  array_index,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual

Delete a blob from the index. This will shift occupied blobs after the deleted blob so that the tuple contains a contiguous array of occupied tuple indices.

virtual int GA_AIFBlob::arrayFindBlob ( const GA_Attribute attrib,
const GA_BlobRef blob,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual

Find a blob in the array, returning its index. Returns -1 if the blob isn't found.

virtual GA_BlobRef GA_AIFBlob::arrayGetBlob ( const GA_Attribute attrib,
int  array_index,
GA_Offset  element_index = GA_Offset(0) 
) const
inlinevirtual

Return the blob for the item at the given array index.

Definition at line 233 of file GA_AIFBlob.h.

virtual GA_BlobIndex GA_AIFBlob::arrayGetBlobIndex ( const GA_Attribute attrib,
int  array_index,
GA_Offset  element_index = GA_Offset(0) 
) const
inlinevirtual

Return the blob handle for the item at the given array index.

Definition at line 225 of file GA_AIFBlob.h.

virtual int GA_AIFBlob::arrayGetBlobs ( GA_BlobRefList list,
const GA_Attribute attrib,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual
virtual int GA_AIFBlob::arrayGetLength ( const GA_Attribute attrib,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual

Return the length of occupied blobs in the array. This is primarily useful for global attributes.

virtual int GA_AIFBlob::arrayGetMaxLength ( const GA_Attribute attrib,
const GA_Range range 
) const
virtual

Return the maximum length of all elements in the range.

virtual int GA_AIFBlob::arrayRemoveDuplicates ( GA_Attribute attrib,
GA_Offset  element_index = GA_Offset(0) 
) const
virtual

Remove duplicate blobs from the array The element_index specifies the point, primitive, vertex etc.

virtual bool GA_AIFBlob::arrayReserve ( GA_Attribute attrib,
int  length 
) const
inlinevirtual

Reserve space for an array of the given size.

The Array API. This API allows the attribute to store an "array" on each data element. This is done by changing the tuple size to match the array length. Each tuple, therefore, represents an array. The length is determined by the occupied entries in the tuple.

These methods can all be implemented using the other API functions. However, they provide a simpler interface.

Definition at line 162 of file GA_AIFBlob.h.

virtual int GA_AIFBlob::arrayTrim ( GA_Attribute attrib) const
virtual

Trim the array to the minimum required size. This may be an expensive operation as it traverses all elements to compute the minimum size, then calls truncate. The method returns the new size.

virtual bool GA_AIFBlob::arrayTruncate ( GA_Attribute attrib,
int  length 
) const
inlinevirtual

Truncate the array to the given entries.

Definition at line 170 of file GA_AIFBlob.h.

virtual void GA_AIFBlob::compactStorage ( GA_Attribute attrib) const
pure virtual

Compact the storage by removing empty indexes.

virtual void GA_AIFBlob::delBlobReference ( GA_Attribute attrib,
GA_BlobIndex  handle 
) const
protectedpure virtual
virtual GA_BlobRef GA_AIFBlob::getBlob ( const GA_Attribute attrib,
GA_Offset  offset,
int  tuple_index = 0 
) const
pure virtual

Get the blob data associated with the tuple index of the given element.

virtual GA_Size GA_AIFBlob::getBlobCount ( const GA_Attribute attrib) const
pure virtual

Return the total number of unique blobs stored in the attribute.

virtual GA_BlobIndex GA_AIFBlob::getBlobIndex ( const GA_Attribute atr,
GA_Offset  offset,
int  tuple_index = 0 
) const
pure virtual

Get the integer identifier for the blob associated with the tuple index of the given element. An element with no blob data will have an index less than 0.

virtual int GA_AIFBlob::getTupleSize ( const GA_Attribute attrib) const
pure virtual

Return the number of blobs per element.

virtual GA_BlobRef GA_AIFBlob::lookupBlob ( const GA_Attribute attrib,
GA_BlobIndex  handle 
) const
pure virtual

Given a blob integer identifier, return a handle to the actual blob data.

virtual GA_BlobRef GA_AIFBlob::lookupOrderedBlob ( const GA_Attribute attrib,
exint  index 
) const
pure virtual

Blob handles (GA_BlobIndex) may not be contiguous. This may be an expensive operation.

virtual bool GA_AIFBlob::replaceBlob ( GA_Attribute attrib,
GA_BlobIndex  handle,
const GA_BlobRef new_blob 
) const
pure virtual

Replace the value of the blob at the given index with a new value. Implementors should be careful to check whether the new_blob exists (i.e. renaming an existing blob to another existing blob). All blobs which reference the original handle will now reference the new blob.

virtual bool GA_AIFBlob::setBlob ( GA_Attribute attrib,
const GA_BlobRef blob,
GA_Offset  offset,
int  tuple_index = 0 
) const
pure virtual

Store a blob on the given element.

virtual bool GA_AIFBlob::setTupleSize ( GA_Attribute attrib,
int  size 
) const
pure virtual

Set the tuple size.

Friends And Related Function Documentation

friend class BlobBuffer
friend

Definition at line 266 of file GA_AIFBlob.h.


The documentation for this class was generated from the following file: