HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AIFBlobArray.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_AIFBlobArray.h ( GA Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GA_AIFBlobArray__
12 #define __GA_AIFBlobArray__
13 
14 #include "GA_API.h"
15 #include "GA_Types.h"
16 #include "GA_BlobData.h"
17 #include "GA_BlobContainer.h"
18 
19 #include <UT/UT_Array.h>
20 #include <UT/UT_ValArray.h>
21 
22 #include <SYS/SYS_Types.h>
23 
24 #include <stddef.h>
25 
26 
27 class GA_Range;
29 
30 
33 
34 
35 /// @brief Attribute Interface for accessing generic blob data
36 ///
37 /// This attribute interface allows access to blob data on an attribute.
38 /// This is provided automatically if you inherit from GA_ATIBlob.
40 {
41 public:
43  virtual ~GA_AIFBlobArray();
44 
45  /// Return the total number of unique blobs stored in the attribute
46  virtual GA_Size getBlobCount(const GA_Attribute *attrib) const = 0;
47 
48  /// Given a blob integer identifier, return a handle to the actual blob data
49  virtual GA_BlobRef lookupBlob(const GA_Attribute *attrib,
50  GA_BlobIndex handle) const = 0;
51 
52  /// Blob handles (GA_BlobIndex) may not be contiguous.
53  /// This may be an expensive operation.
54  virtual GA_BlobRef lookupOrderedBlob(const GA_Attribute *attrib,
55  exint index) const = 0;
56 
57  /// Get the integer identifier for the blob associated with the tuple index
58  /// of the given element. An element with no blob data will have an index
59  /// less than 0.
60  virtual void getBlobIndex(const GA_Attribute *atr,
62  GA_Offset offset) const = 0;
63  /// Get the blob data associated with the tuple index of the given element.
64  virtual void getBlob(const GA_Attribute *attrib,
65  UT_Array<GA_BlobRef> &blobs,
66  GA_Offset offset) const = 0;
67  /// Store a blob on the given element
68  virtual bool setBlob(GA_Attribute *attrib,
69  const UT_Array<GA_BlobRef> &blobs,
70  GA_Offset offset) const = 0;
71 
72  /// Replace the value of the blob at the given index with a new value.
73  /// Implementors should be careful to check whether the @c new_blob exists
74  /// (i.e. renaming an existing blob to another existing blob).
75  /// All blobs which reference the original handle will now reference the
76  /// new blob.
77  virtual bool replaceBlob(GA_Attribute *attrib,
78  GA_BlobIndex handle,
79  const GA_BlobRef &new_blob) const =0;
80 
81  /// Compact the storage by removing empty indexes
82  virtual void compactStorage(GA_Attribute *attrib) const = 0;
83 
84 protected:
85  /// Methods used by the BlobBuffer methods to add an unreferenced blob to
86  /// the attribute.
87  virtual GA_BlobIndex addBlobReference(GA_Attribute *attrib,
88  const GA_BlobRef &blob) const = 0;
89  virtual void delBlobReference(GA_Attribute *attrib,
90  GA_BlobIndex handle) const=0;
91 };
92 
93 #endif
UT_ValArray< GA_BlobIndex > GA_BlobIndexList
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
Attribute Interface for accessing generic blob data.
int64 exint
Definition: SYS_Types.h:125
#define GA_API
Definition: GA_API.h:14
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:235
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_Size GA_Offset
Definition: GA_Types.h:641
GLintptr offset
Definition: glcorearb.h:665
UT_IndexedHashMapItemId GA_BlobIndex
GLuint index
Definition: glcorearb.h:786
UT_Array< GA_BlobRef > GA_BlobRefList