HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_ATIBlindData Class Reference

Attribute type implementation to store blind data per element. More...

#include <GA_ATIBlindData.h>

+ Inheritance diagram for GA_ATIBlindData:

Public Member Functions

 GA_ATIBlindData (const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, GA_Size size, GA_Size align, bool copy_flag, bool little_endian)
 Create blind data attribute. More...
 
 ~GA_ATIBlindData () override
 
int64 getMemoryUsage (bool inclusive) const override
 Report memory usage. More...
 
void countMemory (UT_MemoryCounter &counter, bool inclusive) const override
 
WriteConcurrence getSupportedWriteConcurrence () const override
 Supports concurrent writes to separate elements. More...
 
const GA_AIFStatgetAIFStat () const override
 
const GA_AIFBlindDatagetAIFBlindData () const override
 Return the attribute's blind data interface or NULL. More...
 
const GA_AIFCopyDatagetAIFCopyData () const override
 Return the attribute's copy interface or NULL. More...
 
const GA_AIFCopyDatagetAIFCopyDataAnyway () const
 
const GA_AIFComparegetAIFCompare () const override
 Return the attribute's comparison interface or NULL. More...
 
const GA_AIFMergegetAIFMerge () const override
 Return the attribute's merge interface or NULL. More...
 
const GA_AIFJSONgetAIFJSON () const override
 
bool setArraySize (GA_Offset new_size) override
 Grow data. More...
 
void tryCompressAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET) override
 
void hardenAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET) override
 
bool matchesStorage (const GA_Attribute *that) const override
 
void copyNonStorageMetadata (const GA_Attribute *that) override
 
void replace (const GA_Attribute &src) override
 
const voidgetRead (GA_Offset offset) const
 Get read-only access to the data for the specified offset. More...
 
voidgetWrite (GA_Offset offset)
 Get read-write access to the data for the specified offset. More...
 
void defragment (const GA_Defragment &defrag) override
 
- Public Member Functions inherited from GA_Attribute
 GA_Attribute (const GA_AttributeType &type, const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name)
 
virtual ~GA_Attribute ()
 
SYS_FORCE_INLINE const
GA_AttributeType
getType () const
 
SYS_FORCE_INLINE const
GA_IndexMap
getIndexMap () const
 
SYS_FORCE_INLINE const GA_DetailgetDetail () const
 
SYS_FORCE_INLINE GA_DetailgetDetail ()
 
SYS_FORCE_INLINE GA_AttributeOwner getOwner () const
 
SYS_FORCE_INLINE GA_AttributeScope getScope () const
 
SYS_FORCE_INLINE bool isGroup () const
 
SYS_FORCE_INLINE GA_TypeInfo getTypeInfo () const
 
SYS_FORCE_INLINE void setTypeInfo (GA_TypeInfo type)
 
bool shouldInterpretAsTexCoord (bool allow_float2=false) const
 
GA_StorageClass getStorageClass () const
 Returns the approximate type of the attribute. More...
 
int getTupleSize () const
 Size of the AIFTuple, if it exists. If it doesn't, 1. More...
 
SYS_FORCE_INLINE const
UT_StringHolder
getName () const
 
SYS_FORCE_INLINE const
UT_StringHolder
getFullName () const
 
SYS_FORCE_INLINE GA_DataId getDataId () const
 
SYS_FORCE_INLINE void assignNewDataId ()
 
SYS_FORCE_INLINE void bumpDataId ()
 
SYS_FORCE_INLINE void clearDataId ()
 
SYS_FORCE_INLINE void cloneDataId (const GA_Attribute &src, bool allow_clear=false)
 
SYS_FORCE_INLINE void cloneOrBumpDataId (const GA_Attribute &src, bool allow_clear=false)
 NOTE: Just call cloneDataId(src). More...
 
virtual const GA_AIFDeltagetAIFDelta () const
 Return the attribute's delta interface or NULL. More...
 
virtual const GA_AIFTuplegetAIFTuple () const
 Return the attribute's tuple interface or NULL. More...
 
virtual const GA_AIFMathgetAIFMath () const
 Return the attribute's math interface or NULL. More...
 
virtual const GA_AIFInterp * getAIFInterp () const
 Return the attribute's interpolation interface or NULL. More...
 
virtual const GA_AIFBlobgetAIFBlob () const
 Return the attribute's blob interface or NULL. More...
 
virtual const GA_AIFBlobArraygetAIFBlobArray () const
 Return the attribute's blob array interface or NULL. More...
 
virtual const GA_AIFStringTuplegetAIFStringTuple () const
 Return the attribute's string tuple interface or NULL. More...
 
virtual const
GA_AIFSharedStringTuple
getAIFSharedStringTuple () const
 Return the attribute's shared string tuple interface or NULL. More...
 
virtual const
GA_AIFSharedStringArray
getAIFSharedStringArray () const
 Return the attribute's shared string array interface or NULL. More...
 
virtual const
GA_AIFSharedDictTuple
getAIFSharedDictTuple () const
 Return the attribute's shared options tuple interface or NULL. More...
 
virtual const
GA_AIFSharedDictArray
getAIFSharedDictArray () const
 Return the attribute's shared options tuple interface or NULL. More...
 
virtual const GA_AIFIndexPairgetAIFIndexPair () const
 Return the attribute's index pair interface or NULL. More...
 
virtual const GA_AIFEditgetAIFEdit () const
 Return the attribute's edit interface or NULL. More...
 
virtual const GA_AIFNumericArraygetAIFNumericArray () const
 Return the attribute's arraydata interface or NULL. More...
 
template<typename T >
const TgetAIF () const
 Generic method for getting an AIF by type. More...
 
const GA_AttributeOptionsgetOptions () const
 
GA_AttributeOptionsgetOptions ()
 
void setNonTransforming (bool val)
 
bool needsTransform (bool include_P=true) const
 
bool isDetached () const
 
void mergeOptions (const GA_AttributeOptions &src)
 Merge the options passed in with the options in the attribute. More...
 
bool importOption (const char *name, int &v) const
 
bool importOption (const char *name, bool &v) const
 
bool importOption (const char *name, fpreal32 &v) const
 
bool importOption (const char *name, fpreal64 &v) const
 
bool importOption (const char *name, UT_String &v) const
 
virtual bool needDestruction () const
 Methods which can be overridden from GA_Attribute. More...
 
virtual void destructElement (GA_Offset offset)
 Callback invoked if needsDestruction() returns true. More...
 
void setTailInitialization (bool onoff)
 
bool isTailInitialization () const
 Check whether the attribute is set to tail initialization. More...
 
void reconstructElement (GA_Offset offset)
 
virtual void compactStorage ()
 
virtual void batchDeletion ()
 
GA_Attributeclone (const GA_IndexMap &index_map, const UT_StringHolder &name, bool clone_options) const
 
bool jsonSaveDefinition (UT_JSONWriter &w) const
 Save the GA_Attribute-Definition section. More...
 
virtual int getSaveVersion () const
 
virtual bool debugValidateArrayCapacity (GA_Offset sz) const
 Debug validation of allocated array size. More...
 
SYS_FORCE_INLINE
GA_AttributeProxyHandle 
getProxy ()
 
SYS_FORCE_INLINE
GA_ConstAttributeProxyHandle 
getProxy () const
 
void setExportName (const char *external_name)
 
bool hasExportName () const
 
std::string getExportName () const
 
GA_CEAttributegetCEAttribute (GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write)
 
GA_CEAttributegetCEAttribute (GA_StorageClass storage, GA_Precision precision, int &tuplesize, bool isarray, bool read, bool write)
 
void setCEAttribute (GA_CEAttribute *ceattrib, bool leave_on_gpu=false)
 
void flushCEWriteCaches (bool clearwriteback=true)
 
bool hasPendingCEWriteBack () const
 
void flushCECaches ()
 Remove all CE Caches, copying back any marked as written to. More...
 
void stealCEAttribute (const GA_Attribute &src)
 
bool isActivelyStreamed () const
 
void setActivelyStreamed (bool isstreaming)
 
bool existedPriorToStream () const
 
void setExistedPriorToStream (bool preexisted)
 
virtual bool copy (GA_Offset desti, GA_Offset srci)
 
virtual bool copy (GA_Offset desti, const GA_Attribute &src, GA_Offset srci)
 
virtual bool copy (const GA_Range &destrange, const GA_Range &srcrange)
 
virtual bool copy (const GA_Range &destrange, const GA_Attribute &src, const GA_Range &srcrange)
 
virtual bool fill (const GA_Range &destrange, GA_Offset srci)
 
virtual bool fill (const GA_Range &destrange, const GA_Attribute &src, GA_Offset srci)
 
bool hasFlag (AttribFlag flag) const
 
void setFlag (AttribFlag flag, bool onoff)
 

Static Public Member Functions

static void registerType ()
 
static SYS_FORCE_INLINE const
UT_StringHolder
getTypeName ()
 
static SYS_FORCE_INLINE const
GA_AttributeType
getType ()
 
static SYS_FORCE_INLINE bool isType (const GA_Attribute *attrib)
 
static SYS_FORCE_INLINE
GA_ATIBlindData
cast (GA_Attribute *attrib)
 
static SYS_FORCE_INLINE const
GA_ATIBlindData
cast (const GA_Attribute *attrib)
 
static GA_Attributecreate (const GA_IndexMap &index_map, GA_AttributeScope scope, const UT_StringHolder &name, GA_Size bytes=-1, GA_Size align=-1, const GA_AttributeOptions *attribute_options=NULL)
 
- Static Public Member Functions inherited from GA_Attribute
static bool jsonLoadDefinition (UT_JSONParser &p, GA_AttributeScope &scope, UT_WorkBuffer &type, UT_WorkBuffer &name, int64 &version, GA_AttributeOptions &options)
 Load the GA_Attribute-Definition section. More...
 
static GA_DataId nextDataId ()
 

Protected Member Functions

GA_AttributedoClone (const GA_IndexMap &index_map, const UT_StringHolder &name) const override
 Create a new attribute of this type. More...
 
void reconstructElementBlock (GA_Offset offset, GA_Offset nelements) override
 Re-initialize data for a deleted element. More...
 
- Protected Member Functions inherited from GA_Attribute
int64 getBaseMemoryUsage () const
 
void setDetached (bool detached)
 Only called by GA_AttributeSet and GA_ElementGroup. More...
 

Additional Inherited Members

- Public Types inherited from GA_Attribute
enum  WriteConcurrence { WRITE_CONCURRENCE_NONE, WRITE_CONCURRENCE_PAGE, WRITE_CONCURRENCE_ELEMENT }
 
enum  AttribFlag { FLAG_TAIL_INITIALIZE = 1, FLAG_STREAM_ACTIVE = 2, FLAG_STREAM_NOPREEXIST = 4 }
 
- Static Protected Member Functions inherited from GA_Attribute
static bool checkGlobalOverwrite (const GA_MergeMap &map, const GA_Attribute *attrib)
 

Detailed Description

Attribute type implementation to store blind data per element.

This attribute type allocates a chunk of data per element (point, vertex or detail). The data is typeless. Users can write any data to this

Creation options may contain: "blinddata:size" - The initial size of the attribute (default 0) "blinddata:align" - The initial alignment (default sizeof(void *)) "blinddata:copy" - Copy data from element to element (default false)

Definition at line 53 of file GA_ATIBlindData.h.

Constructor & Destructor Documentation

GA_ATIBlindData::GA_ATIBlindData ( const GA_AttributeType type,
const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
GA_Size  size,
GA_Size  align,
bool  copy_flag,
bool  little_endian 
)

Create blind data attribute.

GA_ATIBlindData::~GA_ATIBlindData ( )
override

Member Function Documentation

static SYS_FORCE_INLINE GA_ATIBlindData* GA_ATIBlindData::cast ( GA_Attribute attrib)
inlinestatic

Definition at line 69 of file GA_ATIBlindData.h.

static SYS_FORCE_INLINE const GA_ATIBlindData* GA_ATIBlindData::cast ( const GA_Attribute attrib)
inlinestatic

Definition at line 76 of file GA_ATIBlindData.h.

void GA_ATIBlindData::copyNonStorageMetadata ( const GA_Attribute that)
inlineoverridevirtual

In the case that we're copying from an attribute whose storage type matches this exactly, this function copies the metadata not associated with the storage, e.g. myOptions, excluding the name and the data ID.

Reimplemented from GA_Attribute.

Definition at line 211 of file GA_ATIBlindData.h.

void GA_ATIBlindData::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const
overridevirtual

Count memory usage using a UT_MemoryCounter in order to count shared memory correctly. If inclusive is true, the size of this object is counted, else only memory owned by this object is counted. If this is pointed to by the calling object, inclusive should be true. If this is contained in the calling object, inclusive should be false. (Its memory was already counted in the size of the calling object.)

NOTE: If you're implementing this in a direct subclass of GA_Attribute, call getBaseMemoryUsage() to get the amount of memory in the base class. If in a more distant descendant class, call Base::countMemory(counter, false) to count the memory in Base and above, excluding sizeof(Base).

Implements GA_Attribute.

static GA_Attribute* GA_ATIBlindData::create ( const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name,
GA_Size  bytes = -1,
GA_Size  align = -1,
const GA_AttributeOptions attribute_options = NULL 
)
static
void GA_ATIBlindData::defragment ( const GA_Defragment defrag)
overridevirtual

Interface for defragmentation

Implements GA_Attribute.

GA_Attribute* GA_ATIBlindData::doClone ( const GA_IndexMap index_map,
const UT_StringHolder name 
) const
overrideprotectedvirtual

Create a new attribute of this type.

Reimplemented from GA_Attribute.

const GA_AIFBlindData* GA_ATIBlindData::getAIFBlindData ( ) const
inlineoverridevirtual

Return the attribute's blind data interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 116 of file GA_ATIBlindData.h.

const GA_AIFCompare* GA_ATIBlindData::getAIFCompare ( ) const
inlineoverridevirtual

Return the attribute's comparison interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 128 of file GA_ATIBlindData.h.

const GA_AIFCopyData* GA_ATIBlindData::getAIFCopyData ( ) const
inlineoverridevirtual

Return the attribute's copy interface or NULL.

Reimplemented from GA_Attribute.

Definition at line 118 of file GA_ATIBlindData.h.

const GA_AIFCopyData* GA_ATIBlindData::getAIFCopyDataAnyway ( ) const
inline

Definition at line 124 of file GA_ATIBlindData.h.

const GA_AIFJSON* GA_ATIBlindData::getAIFJSON ( ) const
inlineoverridevirtual

JSON Schema: GA_ATIBlindData

{
"name" : "GA_ATIBlindData",
"description" : "An array of blind data",
"type" : "orderedmap",
"properties": {
"size": {
"type" : "integer",
"minimum" : 1,
"description" : "Bytes per element",
},
"alignment": {
"type" : "integer",
"description" : "Data alignment: 0 indicates sizeof(void*)",
},
"defaultsize": {
"type" : "integer",
"minimum" : 1,
"description" : "Bytes stored in the defualt",
},
"endian": {
"type" : "string",
"description" : "Endian storage of binary data",
"enum" : [ "little", "big" ],
},
"defaults": {
"type" : "array",
"description" : "binary data (bytes)",
"items" : "number",
},
"values": {
"type" : "array",
"description" : "binary data (bytes)",
"items" : "number",
},
},
}
See Also
JSON_FileFormat

Reimplemented from GA_Attribute.

Definition at line 174 of file GA_ATIBlindData.h.

const GA_AIFMerge* GA_ATIBlindData::getAIFMerge ( ) const
overridevirtual

Return the attribute's merge interface or NULL.

Reimplemented from GA_Attribute.

const GA_AIFStat* GA_ATIBlindData::getAIFStat ( ) const
inlineoverridevirtual

Return the attribute's stat interface. Unlike other interfaces, this method has default behaviour.

Reimplemented from GA_Attribute.

Definition at line 114 of file GA_ATIBlindData.h.

int64 GA_ATIBlindData::getMemoryUsage ( bool  inclusive) const
overridevirtual

Report memory usage.

Implements GA_Attribute.

const void* GA_ATIBlindData::getRead ( GA_Offset  offset) const

Get read-only access to the data for the specified offset.

WriteConcurrence GA_ATIBlindData::getSupportedWriteConcurrence ( ) const
inlineoverridevirtual

Supports concurrent writes to separate elements.

Implements GA_Attribute.

Definition at line 111 of file GA_ATIBlindData.h.

static SYS_FORCE_INLINE const GA_AttributeType& GA_ATIBlindData::getType ( )
inlinestatic

Definition at line 61 of file GA_ATIBlindData.h.

static SYS_FORCE_INLINE const UT_StringHolder& GA_ATIBlindData::getTypeName ( )
inlinestatic

Definition at line 58 of file GA_ATIBlindData.h.

void* GA_ATIBlindData::getWrite ( GA_Offset  offset)

Get read-write access to the data for the specified offset.

void GA_ATIBlindData::hardenAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)
inlineoverridevirtual

Hardening data pages is not applicable to blind data, so this does nothing.

Implements GA_Attribute.

Definition at line 186 of file GA_ATIBlindData.h.

static SYS_FORCE_INLINE bool GA_ATIBlindData::isType ( const GA_Attribute attrib)
inlinestatic

Definition at line 64 of file GA_ATIBlindData.h.

bool GA_ATIBlindData::matchesStorage ( const GA_Attribute that) const
inlineoverridevirtual

Returns true iff that is an attribute whose content can be copied from this without any type conversions. This is important to avoid reallocation of an attribute if its storage type, including tuple size, matches the source attribute exactly.

Reimplemented from GA_Attribute.

Definition at line 194 of file GA_ATIBlindData.h.

void GA_ATIBlindData::reconstructElementBlock ( GA_Offset  offset,
GA_Offset  nelements 
)
overrideprotectedvirtual

Re-initialize data for a deleted element.

Implements GA_Attribute.

static void GA_ATIBlindData::registerType ( )
static
void GA_ATIBlindData::replace ( const GA_Attribute src)
overridevirtual

This replaces the entirety of this attribute's content and non- storage metadata (except the name) with that of the src attribute. The matchesStorage(src) should already return true. This is primarily for use by GA_AttributeSet::replace(). NOTE: The internal content sizes may not match exactly if the attribute type may overallocate, but the sizes should be such that any real data will fit in the destination, so be careful and deal with the myTailInitialize flag appropriately if any extra elements aren't equal to the default.

Implements GA_Attribute.

bool GA_ATIBlindData::setArraySize ( GA_Offset  new_size)
overridevirtual

Grow data.

Implements GA_Attribute.

void GA_ATIBlindData::tryCompressAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)
inlineoverridevirtual

Compressing data pages is not applicable to blind data, so this does nothing.

Implements GA_Attribute.

Definition at line 181 of file GA_ATIBlindData.h.


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