HDK
|
Definition of a geometry attribute. More...
#include <GA_Attribute.h>
Public Types | |
enum | WriteConcurrence { WRITE_CONCURRENCE_NONE, WRITE_CONCURRENCE_PAGE, WRITE_CONCURRENCE_ELEMENT } |
Public Member Functions | |
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_Detail & | getDetail () const |
SYS_FORCE_INLINE GA_Detail & | getDetail () |
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 bool | setArraySize (GA_Offset size)=0 |
virtual void | tryCompressAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0 |
virtual void | hardenAllPages (GA_Offset start_offset=GA_Offset(0), GA_Offset end_offset=GA_INVALID_OFFSET)=0 |
virtual WriteConcurrence | getSupportedWriteConcurrence () const =0 |
virtual const GA_AIFCopyData * | getAIFCopyData () const |
Return the attribute's copy interface or NULL. More... | |
virtual const GA_AIFDelta * | getAIFDelta () const |
Return the attribute's delta interface or NULL. More... | |
virtual const GA_AIFTuple * | getAIFTuple () const |
Return the attribute's tuple interface or NULL. More... | |
virtual const GA_AIFMath * | getAIFMath () const |
Return the attribute's math interface or NULL. More... | |
virtual const GA_AIFMerge * | getAIFMerge () const |
Return the attribute's merge interface or NULL. More... | |
virtual const GA_AIFInterp * | getAIFInterp () const |
Return the attribute's interpolation interface or NULL. More... | |
virtual const GA_AIFBlob * | getAIFBlob () const |
Return the attribute's blob interface or NULL. More... | |
virtual const GA_AIFBlobArray * | getAIFBlobArray () const |
Return the attribute's blob array interface or NULL. More... | |
virtual const GA_AIFStringTuple * | getAIFStringTuple () 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_AIFIndexPair * | getAIFIndexPair () const |
Return the attribute's index pair interface or NULL. More... | |
virtual const GA_AIFBlindData * | getAIFBlindData () const |
Return the attribute's blind data interface or NULL. More... | |
virtual const GA_AIFEdit * | getAIFEdit () const |
Return the attribute's edit interface or NULL. More... | |
virtual const GA_AIFCompare * | getAIFCompare () const |
Return the attribute's comparison interface or NULL. More... | |
virtual const GA_AIFNumericArray * | getAIFNumericArray () const |
Return the attribute's arraydata interface or NULL. More... | |
virtual const GA_AIFStat * | getAIFStat () const |
template<typename T > | |
const T * | getAIF () const |
Generic method for getting an AIF by type. More... | |
const GA_AttributeOptions & | getOptions () const |
GA_AttributeOptions & | getOptions () |
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 | reconstructElementBlock (GA_Offset offset, GA_Offset nelements)=0 |
virtual void | compactStorage () |
virtual void | batchDeletion () |
GA_Attribute * | clone (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 const GA_AIFJSON * | getAIFJSON () const |
Return the AIF to handle saving/loading of the private data section. More... | |
virtual int | getSaveVersion () const |
virtual bool | debugValidateArrayCapacity (GA_Offset sz) const |
Debug validation of allocated array size. More... | |
virtual int64 | getMemoryUsage (bool inclusive) const =0 |
virtual void | countMemory (UT_MemoryCounter &counter, bool inclusive) const =0 |
virtual bool | matchesStorage (const GA_Attribute *that) const |
virtual void | copyNonStorageMetadata (const GA_Attribute *that) |
virtual void | replace (const GA_Attribute &src)=0 |
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 |
virtual void | defragment (const GA_Defragment &defrag)=0 |
GA_CEAttribute * | getCEAttribute (GA_StorageClass storage, int &tuplesize, bool isarray, bool read, bool write) |
GA_CEAttribute * | getCEAttribute (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) |
Static Public Member Functions | |
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 | |
int64 | getBaseMemoryUsage () const |
void | setDetached (bool detached) |
Only called by GA_AttributeSet and GA_ElementGroup. More... | |
Static Protected Member Functions | |
static bool | checkGlobalOverwrite (const GA_MergeMap &map, const GA_Attribute *attrib) |
Friends | |
GA_Attribute * | GA_AttributeType::create (const GA_IndexMap &, GA_AttributeScope, const UT_StringHolder &, const UT_Options *, const GA_AttributeOptions *) const |
enum | AttribFlag { FLAG_TAIL_INITIALIZE = 1, FLAG_STREAM_ACTIVE = 2, FLAG_STREAM_NOPREEXIST = 4 } |
bool | hasFlag (AttribFlag flag) const |
void | setFlag (AttribFlag flag, bool onoff) |
class | GA_AttributeSet |
class | GA_ElementGroup |
class | GA_MergeMap |
Definition of a geometry attribute.
An attribute can be attached to points, vertices, primitives or the detail itself. The attribute is responsible for maintaining the data array.
The attribute is responsible for providing interfaces (AIF).
Definition at line 198 of file GA_Attribute.h.
Attribute flags store certain mutable properties of the attribute, largely used for internal book keeping and semantic error detection
Enumerator | |
---|---|
FLAG_TAIL_INITIALIZE | |
FLAG_STREAM_ACTIVE | |
FLAG_STREAM_NOPREEXIST |
Definition at line 230 of file GA_Attribute.h.
The various concurrency levels supported by attributes for writing per-element data.
Definition at line 363 of file GA_Attribute.h.
GA_Attribute::GA_Attribute | ( | const GA_AttributeType & | type, |
const GA_IndexMap & | index_map, | ||
GA_AttributeScope | scope, | ||
const UT_StringHolder & | name | ||
) |
|
virtual |
|
inline |
Definition at line 301 of file GA_Attribute.h.
|
virtual |
This method is called before a batch deletion operation. It allows the attribute to mark objects as dirty so that there can be lazy computation of data. For example, re-computing the number of elements in a group. This method may be called multiple times, and so should typically just set a flag (not perform a lot of computation).
|
inline |
Definition at line 306 of file GA_Attribute.h.
|
staticprotected |
Determine if we should overwrite our attribute on merge, off for detail attributes so the first will win.
|
inline |
Definition at line 312 of file GA_Attribute.h.
GA_Attribute* GA_Attribute::clone | ( | const GA_IndexMap & | index_map, |
const UT_StringHolder & | name, | ||
bool | clone_options | ||
) | const |
This method returns a new attribute of the same type with identical settings. Attribute data is not copied. Derived classes implement this method by overriding the virtual doClone(). Those classes not supporting cloning are permitted to return NULL.
|
inline |
This clones the data ID from src. If src has an invalid data ID, which can be the case for details not created by SOP_Node or SIM_GeometryCopy, we default to bumping the destination data ID. This should be used by functions like GA_Attribute::replace() when an attribute's data is replaced with that of src.
NOTE: We must always either clone or bump the data ID if we've copied from another attribute, even if that src attribute has an invalid data ID. See Bug 79446 and 79438.
Definition at line 324 of file GA_Attribute.h.
|
inline |
NOTE: Just call cloneDataId(src).
Definition at line 334 of file GA_Attribute.h.
|
virtual |
A method to "compact" any storage. For example, if there's a string table associated with the attribute, this gives the attribute the option to adjust the table to be more compact.
Reimplemented in GA_ATIBlob, GA_ATIBlobArray, and GA_ATIString.
Copy attribute values for a single element. NOTE: The default implementation just tries to use GA_AIFCopyData, incurring 2 more virtual calls!
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATINumeric.
Definition at line 800 of file GA_Attribute.h.
|
virtual |
Copy attribute values for a single element. NOTE: The default implementation just tries to use GA_AIFCopyData, incurring 2 more virtual calls!
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATINumeric.
|
inlinevirtual |
Copy attribute values for a range of elements. NOTE: The default implementation just tries to use GA_AIFCopyData, incurring 2 more virtual calls! WARNING: These do not support overlapping ranges within a single attribute!
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATINumeric.
Definition at line 810 of file GA_Attribute.h.
|
virtual |
Copy attribute values for a range of elements. NOTE: The default implementation just tries to use GA_AIFCopyData, incurring 2 more virtual calls! WARNING: These do not support overlapping ranges within a single attribute!
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATINumeric.
|
inlinevirtual |
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. The attribute class of that must match the attribute class of that. Subclasses must call this.
Reimplemented in GA_ElementGroup, GA_ATIIndexPair, GA_ATINumeric, and GA_ATIBlindData.
Definition at line 765 of file GA_Attribute.h.
|
pure virtual |
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).
Implemented in GA_ATIBlob, GA_ElementGroup, GA_ATIIndexPair, GA_ATIBlobArray, GA_ATIBlindData, GA_ATITopology, GA_ATIString, GA_ATINumeric, and GA_ATINumericArray.
|
virtual |
Debug validation of allocated array size.
Reimplemented in GA_ElementGroup, GA_ATINumeric, GA_ATIString, and GA_ATIDict.
|
pure virtual |
defragment()
defragments the memory used to store data elements
Implemented in GA_ATIBlob, GA_ElementGroup, GA_ATIIndexPair, GA_ATIBlobArray, GA_ATIBlindData, GA_ATINumeric, GA_ATIString, and GA_ATINumericArray.
Callback invoked if needsDestruction() returns true.
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATIBlobArray.
|
inline |
Was this attribute created as a result of the stream operation? This allows detection of attributes that only exist as a result of the stream beginning. Default is that it existed.
Definition at line 695 of file GA_Attribute.h.
Assign all elements of a range from a single attribute value. NOTE: The default implementation just tries to use GA_AIFCopyData, incurring 2 more virtual calls, falling back on calling copy() for each element in the destination range, which incurs the cost of the virtual call for each!
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATINumeric.
Definition at line 821 of file GA_Attribute.h.
|
virtual |
Assign all elements of a range from a single attribute value. NOTE: The default implementation just tries to use GA_AIFCopyData, incurring 2 more virtual calls, falling back on calling copy() for each element in the destination range, which incurs the cost of the virtual call for each!
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATINumeric.
void GA_Attribute::flushCECaches | ( | ) |
Remove all CE Caches, copying back any marked as written to.
void GA_Attribute::flushCEWriteCaches | ( | bool | clearwriteback = true | ) |
Any CE cache which was marked as written to will be copied back to the CPU. It will be left on the GPU, however.
|
inline |
Generic method for getting an AIF by type.
Definition at line 416 of file GA_Attribute.h.
|
virtual |
Return the attribute's blind data interface or NULL.
Reimplemented in GA_ATIBlindData.
|
virtual |
Return the attribute's blob interface or NULL.
Reimplemented in GA_ATIBlob.
|
virtual |
Return the attribute's blob array interface or NULL.
Reimplemented in GA_ATIBlobArray.
|
virtual |
Return the attribute's comparison interface or NULL.
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATIString, GA_ATIBlindData, GA_ATINumeric, and GA_ATINumericArray.
|
virtual |
Return the attribute's copy interface or NULL.
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIBlobArray, GA_ATIString, GA_ATIIndexPair, GA_ATIBlindData, GA_ATITopology, GA_ATINumeric, and GA_ATINumericArray.
|
virtual |
Return the attribute's delta interface or NULL.
Reimplemented in GA_ATINumeric.
|
virtual |
Return the attribute's edit interface or NULL.
Reimplemented in GA_ATIIndexPair, GA_ATINumeric, and GA_ATINumericArray.
|
virtual |
Return the attribute's index pair interface or NULL.
Reimplemented in GA_ATIIndexPair, and GA_ATINumericArray.
|
virtual |
Return the attribute's interpolation interface or NULL.
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATIString, GA_ATINumeric, and GA_ATINumericArray.
|
virtual |
Return the AIF to handle saving/loading of the private data section.
Reimplemented in GA_ATIIndexPair, GA_ATIString, GA_ATIBlindData, GA_ATINumeric, GA_ATINumericArray, GA_ATIDict, GA_ATIStringArray, and GA_ATIDictArray.
|
virtual |
Return the attribute's math interface or NULL.
Reimplemented in GA_ATIIndexPair, GA_ATINumeric, and GA_ATINumericArray.
|
virtual |
Return the attribute's merge interface or NULL.
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATIString, GA_ATIBlindData, GA_ATINumeric, GA_ATITopology, and GA_ATINumericArray.
|
virtual |
Return the attribute's arraydata interface or NULL.
Reimplemented in GA_ATINumericArray.
|
virtual |
Return the attribute's shared options tuple interface or NULL.
Reimplemented in GA_ATIDictArray.
|
virtual |
Return the attribute's shared options tuple interface or NULL.
Reimplemented in GA_ATIDict.
|
virtual |
Return the attribute's shared string array interface or NULL.
Reimplemented in GA_ATIStringArray.
|
virtual |
Return the attribute's shared string tuple interface or NULL.
Reimplemented in GA_ATIString.
|
virtual |
Return the attribute's stat interface. Unlike other interfaces, this method has default behaviour.
Reimplemented in GA_ATIBlindData.
|
virtual |
Return the attribute's string tuple interface or NULL.
Reimplemented in GA_ATIString.
|
virtual |
Return the attribute's tuple interface or NULL.
Reimplemented in GA_ElementGroup, GA_ATIIndexPair, GA_ATINumeric, and GA_ATINumericArray.
|
protected |
For use by getMemoryUsage and countMemory in subclasses to count the amount of memory used by this base class (NOTE: always exclusive)
|
inline |
The attribute data may be moved to the GPU, and hence backed by a compute buffer (GA_CEAttribute). Flushing will delete our buffer & copy it back from the GPU if it has been marked as modified. Caches a CE Attribute. If a cache already exists, the cached data is returned and the write flag updated. If the cache does not exist, an attempt is made to build a buffer. If read is true, the buffer is initialized with the geometry data. This can return NULL if a failure to build an attribute occurs (for example, unsupported type or no GPU)
Definition at line 658 of file GA_Attribute.h.
GA_CEAttribute* GA_Attribute::getCEAttribute | ( | GA_StorageClass | storage, |
GA_Precision | precision, | ||
int & | tuplesize, | ||
bool | isarray, | ||
bool | read, | ||
bool | write | ||
) |
The attribute data may be moved to the GPU, and hence backed by a compute buffer (GA_CEAttribute). Flushing will delete our buffer & copy it back from the GPU if it has been marked as modified. Caches a CE Attribute. If a cache already exists, the cached data is returned and the write flag updated. If the cache does not exist, an attempt is made to build a buffer. If read is true, the buffer is initialized with the geometry data. This can return NULL if a failure to build an attribute occurs (for example, unsupported type or no GPU)
|
inline |
The data ID is shared by attributes that represent the same underlying data and is used by cache mechanisms to avoid rebuilding when data has not really changed. An ID of -1 indicates that this attribute is not going to get a new ID when its data is changed, and therefore is not participating in this scheme.
Two attributes can share the same data ID even when they don't share the same internal data pages or even fragmentation patterns. Note however that the data ID is not necessarily changed for topology changes, so it is necessary to also compare topology data IDs in order to be absolutely sure that two attributes sharing the same data ID represent the same data (taking into account defragmentation).
Definition at line 299 of file GA_Attribute.h.
|
inline |
Definition at line 208 of file GA_Attribute.h.
|
inline |
Definition at line 209 of file GA_Attribute.h.
std::string GA_Attribute::getExportName | ( | ) | const |
Houdini forces certain restrictions on attribute names. However, external software doesn't always have these restrictions. When importing attributes, you can store the "real" attribute name, or use the "export" name when exporting.
getExportName()
will return the attribute name if there's no export name set.
|
inline |
Definition at line 284 of file GA_Attribute.h.
|
inline |
Definition at line 207 of file GA_Attribute.h.
|
pure virtual |
Report the memory usage
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::getMemoryUsage(false) to count the memory in Base and above, excluding sizeof(Base).
Implemented in GA_ATIBlob, GA_ElementGroup, GA_ATIIndexPair, GA_ATIBlobArray, GA_ATIBlindData, GA_ATITopology, GA_ATIString, GA_ATINumeric, and GA_ATINumericArray.
|
inline |
Definition at line 283 of file GA_Attribute.h.
|
inline |
Definition at line 420 of file GA_Attribute.h.
|
inline |
Definition at line 421 of file GA_Attribute.h.
|
inline |
Definition at line 210 of file GA_Attribute.h.
|
inline |
Obtains the proxy representative used as a reference holder to this attribute. This proxy gets invalidated when the attribute gets deleted. Invalidation clears the proxy's pointer to NULL, but the proxy's memory stays valid, unlike the memory of the attribute object.
Definition at line 220 of file GA_Attribute.h.
|
inline |
Obtains the proxy representative used as a reference holder to this attribute. This proxy gets invalidated when the attribute gets deleted. Invalidation clears the proxy's pointer to NULL, but the proxy's memory stays valid, unlike the memory of the attribute object.
Definition at line 222 of file GA_Attribute.h.
|
virtual |
Return the optional "save" version number. This is passed to the JSON attribute loader. If the version is <= 0, the version is not saved to the file and 0 will be passed to the loader.
|
inline |
Definition at line 212 of file GA_Attribute.h.
GA_StorageClass GA_Attribute::getStorageClass | ( | ) | const |
Returns the approximate type of the attribute.
|
pure virtual |
Implemented in GA_ElementGroup, GA_ATIBlob, GA_ATIBlobArray, GA_ATIString, GA_ATIIndexPair, GA_ATIBlindData, GA_ATITopology, GA_ATINumeric, and GA_ATINumericArray.
int GA_Attribute::getTupleSize | ( | ) | const |
Size of the AIFTuple, if it exists. If it doesn't, 1.
|
inline |
Definition at line 206 of file GA_Attribute.h.
|
inline |
Uses the "type" option to determine type information
Definition at line 252 of file GA_Attribute.h.
|
pure virtual |
Harden data pages Will harden all pages overlapping the specified offset range. Once this is done, multiple threads can write to an attribute in parallel at a finer granularity than pages. Must be implemented in subclasses
Implemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, GA_ATITopology, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATINumeric, GA_ATIBlindData, and GA_ATINumericArray.
bool GA_Attribute::hasExportName | ( | ) | const |
Houdini forces certain restrictions on attribute names. However, external software doesn't always have these restrictions. When importing attributes, you can store the "real" attribute name, or use the "export" name when exporting.
getExportName()
will return the attribute name if there's no export name set.
|
inline |
Attribute flags store certain mutable properties of the attribute, largely used for internal book keeping and semantic error detection
Definition at line 236 of file GA_Attribute.h.
bool GA_Attribute::hasPendingCEWriteBack | ( | ) | const |
The attribute data may be moved to the GPU, and hence backed by a compute buffer (GA_CEAttribute). Flushing will delete our buffer & copy it back from the GPU if it has been marked as modified. Caches a CE Attribute. If a cache already exists, the cached data is returned and the write flag updated. If the cache does not exist, an attempt is made to build a buffer. If read is true, the buffer is initialized with the geometry data. This can return NULL if a failure to build an attribute occurs (for example, unsupported type or no GPU)
bool GA_Attribute::importOption | ( | const char * | name, |
int & | v | ||
) | const |
bool GA_Attribute::importOption | ( | const char * | name, |
bool & | v | ||
) | const |
bool GA_Attribute::importOption | ( | const char * | name, |
fpreal32 & | v | ||
) | const |
bool GA_Attribute::importOption | ( | const char * | name, |
fpreal64 & | v | ||
) | const |
bool GA_Attribute::importOption | ( | const char * | name, |
UT_String & | v | ||
) | const |
|
inline |
During streaming operations it can be important to flag which attributes are in the process of being modified. This way attempts to random-access read them can be detected and thwarted as they won't be valid. Is this attribute is currently being streamed? No random reads should be done to this attribute. Default is that it is not streaming.
Definition at line 686 of file GA_Attribute.h.
|
inline |
Definition at line 445 of file GA_Attribute.h.
|
inline |
Definition at line 213 of file GA_Attribute.h.
|
inline |
Check whether the attribute is set to tail initialization.
Definition at line 488 of file GA_Attribute.h.
|
static |
Load the GA_Attribute-Definition section.
bool GA_Attribute::jsonSaveDefinition | ( | UT_JSONWriter & | w | ) | const |
Save the GA_Attribute-Definition section.
The schema for an attribute consists of an array of two items. The first entry contains of the definition of the attribute. The second entry is the "private" data for the attribute. If there is no data for the attribute (i.e. the attribute doesn't provide an AIFJSON), then a null will be saved as the second element.
The private data is saved/loaded by the GA_AIFJSON class for the attribute.
The attribute definition is a map containing the fields required to recreate the attribute.
|
inlinevirtual |
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. Subclasses should call this first and return false if this returns false.
Reimplemented in GA_ATIBlob, GA_ATIString, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATINumeric, GA_ATIBlindData, GA_ATITopology, and GA_ATINumericArray.
Definition at line 751 of file GA_Attribute.h.
|
inline |
Merge the options passed in with the options in the attribute.
Definition at line 464 of file GA_Attribute.h.
|
virtual |
Methods which can be overridden from GA_Attribute.
Element destruction event. When an element is destroyed, the attribute may be notified of this event.
Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATIBlobArray.
|
inline |
needTransform() checks whether the attribute is a floating-point attribute whose type info is a transforming type and whose non-transforming flag is false.
Definition at line 437 of file GA_Attribute.h.
|
static |
This is only here so that select data outside of GA_Attribute can also have data IDs, like GA_PrimitiveList and GA_EdgeGroup.
When the array size is grown, attributes should initialize the value appropriately. When an element is reused, however, the reconstructElement is called. This happens if an element is deleted then a new element is allocated (using the existing slot)
Definition at line 495 of file GA_Attribute.h.
|
pure virtual |
When the array size is grown, attributes should initialize the value appropriately. When elements are reused, however, reconstructElementBlock is called. This happens if an element is deleted and then a new element is allocated (using the existing slot)
Implemented in GA_ElementGroup, GA_ATIBlindData, GA_ATIBlob, GA_ATIIndexPair, GA_ATIBlobArray, GA_ATINumeric, GA_ATIString, and GA_ATINumericArray.
|
pure virtual |
This replaces the entirety of this attribute's content and non- storage metadata (except the name) with that of the src attribute. 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.
Implemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATINumeric, GA_ATIBlindData, GA_ATITopology, and GA_ATINumericArray.
|
inline |
During streaming operations it can be important to flag which attributes are in the process of being modified. This way attempts to random-access read them can be detected and thwarted as they won't be valid. Is this attribute is currently being streamed? No random reads should be done to this attribute. Default is that it is not streaming.
Definition at line 689 of file GA_Attribute.h.
|
pure virtual |
The method to set array size Must be implemented in subclasses Return true if the attribute was resized.
Implemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, GA_ATITopology, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATINumeric, GA_ATIBlindData, and GA_ATINumericArray.
void GA_Attribute::setCEAttribute | ( | GA_CEAttribute * | ceattrib, |
bool | leave_on_gpu = false |
||
) |
The attribute data may be moved to the GPU, and hence backed by a compute buffer (GA_CEAttribute). Flushing will delete our buffer & copy it back from the GPU if it has been marked as modified. Caches a CE Attribute. If a cache already exists, the cached data is returned and the write flag updated. If the cache does not exist, an attempt is made to build a buffer. If read is true, the buffer is initialized with the geometry data. This can return NULL if a failure to build an attribute occurs (for example, unsupported type or no GPU)
|
inlineprotected |
Only called by GA_AttributeSet and GA_ElementGroup.
Definition at line 708 of file GA_Attribute.h.
|
inline |
During streaming operations it can be important to flag which attributes are in the process of being modified. This way attempts to random-access read them can be detected and thwarted as they won't be valid. Is this attribute is currently being streamed? No random reads should be done to this attribute. Default is that it is not streaming.
Definition at line 698 of file GA_Attribute.h.
void GA_Attribute::setExportName | ( | const char * | external_name | ) |
Houdini forces certain restrictions on attribute names. However, external software doesn't always have these restrictions. When importing attributes, you can store the "real" attribute name, or use the "export" name when exporting.
getExportName()
will return the attribute name if there's no export name set.
|
inline |
Attribute flags store certain mutable properties of the attribute, largely used for internal book keeping and semantic error detection
Definition at line 239 of file GA_Attribute.h.
|
inline |
Although an attribute may be a "point" or "normal", we may not want to transform the point. This is the case with "rest" for example. At the current time, this sets the flag corresponding with "attribute:non_transforming" in the options.
Definition at line 429 of file GA_Attribute.h.
void GA_Attribute::setTailInitialization | ( | bool | onoff | ) |
The GA library expects any elements allocated at the end of the array to be set to their default values. If this is not the case, then the attribute can register itself for special initialization.
|
inline |
Set the option. This sets the "type" option on the attribute
Definition at line 260 of file GA_Attribute.h.
bool GA_Attribute::shouldInterpretAsTexCoord | ( | bool | allow_float2 = false | ) | const |
Checks if an attribute should be treated as a texture coordinate attribute. Ideally, we could rely on the type info being GA_TYPE_TEXTURE_COORD, but old files don't have this, and various importers don't set this. If a float[3] (optionnally float[2]) attribute's name starts with "uv" and is followed by zero or more digits (and nothing else), it's probably safe to assume that it should be treated as a texture attribute.
void GA_Attribute::stealCEAttribute | ( | const GA_Attribute & | src | ) |
Steal the CE attribute from the source attribute, leaving the src with a null CE attribute.
|
pure virtual |
Try to compress data pages Will try to compress all pages overlapping the specified offset range. Must be implemented in subclasses
Implemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, GA_ATITopology, GA_ATIBlobArray, GA_ATIIndexPair, GA_ATINumeric, GA_ATIBlindData, and GA_ATINumericArray.
|
friend |
Only called by GA_AttributeSet and GA_ElementGroup.
Definition at line 738 of file GA_Attribute.h.
|
friend |
|
friend |
Only called by GA_AttributeSet and GA_ElementGroup.
Definition at line 739 of file GA_Attribute.h.
|
friend |
Only called by GA_AttributeSet and GA_ElementGroup.
Definition at line 740 of file GA_Attribute.h.