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

Definition of a geometry attribute. More...

#include <GA_Attribute.h>

+ Inheritance diagram for GA_Attribute:

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_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 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_AIFCopyDatagetAIFCopyData () const
 Return the attribute's copy interface or NULL. 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_AIFMergegetAIFMerge () 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_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_AIFBlindDatagetAIFBlindData () const
 Return the attribute's blind data interface or NULL. More...
 
virtual const GA_AIFEditgetAIFEdit () const
 Return the attribute's edit interface or NULL. More...
 
virtual const GA_AIFComparegetAIFCompare () const
 Return the attribute's comparison interface or NULL. More...
 
virtual const GA_AIFNumericArraygetAIFNumericArray () const
 Return the attribute's arraydata interface or NULL. More...
 
virtual const GA_AIFStatgetAIFStat () const
 
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 reconstructElementBlock (GA_Offset offset, GA_Offset nelements)=0
 
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 const GA_AIFJSONgetAIFJSON () 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_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)
 

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_AttributeGA_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
 

Detailed Description

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.

See Also
Iterators for implications of paged allocation strategies.

The attribute is responsible for providing interfaces (AIF).

Examples:
field3d/f3d_io.C, packedprim/packedprim.C, RAY/RAY_DemoSprite.C, SOP/SOP_ArrayAttrib.C, SOP/SOP_Flatten.C, SOP/SOP_PrimVOP.C, and SOP/SOP_TimeCompare.C.

Definition at line 198 of file GA_Attribute.h.

Member Enumeration Documentation

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.

Enumerator
WRITE_CONCURRENCE_NONE 

No concurrent writes supported.

WRITE_CONCURRENCE_PAGE 

Concurrent writes to separate pages supported.

WRITE_CONCURRENCE_ELEMENT 

Concurrent writes to separate elements supported.

Definition at line 363 of file GA_Attribute.h.

Constructor & Destructor Documentation

GA_Attribute::GA_Attribute ( const GA_AttributeType type,
const GA_IndexMap index_map,
GA_AttributeScope  scope,
const UT_StringHolder name 
)
virtual GA_Attribute::~GA_Attribute ( )
virtual

Member Function Documentation

SYS_FORCE_INLINE void GA_Attribute::assignNewDataId ( )
inline

Definition at line 301 of file GA_Attribute.h.

virtual void GA_Attribute::batchDeletion ( )
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).

static bool GA_Attribute::checkGlobalOverwrite ( const GA_MergeMap map,
const GA_Attribute attrib 
)
staticprotected

Determine if we should overwrite our attribute on merge, off for detail attributes so the first will win.

SYS_FORCE_INLINE void GA_Attribute::clearDataId ( )
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.

SYS_FORCE_INLINE void GA_Attribute::cloneDataId ( const GA_Attribute src,
bool  allow_clear = false 
)
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.

SYS_FORCE_INLINE void GA_Attribute::cloneOrBumpDataId ( const GA_Attribute src,
bool  allow_clear = false 
)
inline

NOTE: Just call cloneDataId(src).

Definition at line 334 of file GA_Attribute.h.

virtual void GA_Attribute::compactStorage ( )
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.

virtual bool GA_Attribute::copy ( GA_Offset  desti,
GA_Offset  srci 
)
inlinevirtual

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 bool GA_Attribute::copy ( GA_Offset  desti,
const GA_Attribute src,
GA_Offset  srci 
)
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.

virtual bool GA_Attribute::copy ( const GA_Range destrange,
const GA_Range srcrange 
)
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 bool GA_Attribute::copy ( const GA_Range destrange,
const GA_Attribute src,
const GA_Range srcrange 
)
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.

virtual void GA_Attribute::copyNonStorageMetadata ( const GA_Attribute that)
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.

virtual void GA_Attribute::countMemory ( UT_MemoryCounter counter,
bool  inclusive 
) const
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 bool GA_Attribute::debugValidateArrayCapacity ( GA_Offset  sz) const
virtual

Debug validation of allocated array size.

Reimplemented in GA_ElementGroup, GA_ATINumeric, GA_ATIString, and GA_ATIDict.

virtual void GA_Attribute::defragment ( const GA_Defragment defrag)
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.

virtual void GA_Attribute::destructElement ( GA_Offset  offset)
virtual

Callback invoked if needsDestruction() returns true.

Reimplemented in GA_ElementGroup, GA_ATIBlob, GA_ATIString, and GA_ATIBlobArray.

bool GA_Attribute::existedPriorToStream ( ) const
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.

virtual bool GA_Attribute::fill ( const GA_Range destrange,
GA_Offset  srci 
)
inlinevirtual

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 bool GA_Attribute::fill ( const GA_Range destrange,
const GA_Attribute src,
GA_Offset  srci 
)
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.

template<typename T >
const T* GA_Attribute::getAIF ( ) const
inline

Generic method for getting an AIF by type.

Definition at line 416 of file GA_Attribute.h.

virtual const GA_AIFBlindData* GA_Attribute::getAIFBlindData ( ) const
virtual

Return the attribute's blind data interface or NULL.

Reimplemented in GA_ATIBlindData.

virtual const GA_AIFBlob* GA_Attribute::getAIFBlob ( ) const
virtual

Return the attribute's blob interface or NULL.

Reimplemented in GA_ATIBlob.

virtual const GA_AIFBlobArray* GA_Attribute::getAIFBlobArray ( ) const
virtual

Return the attribute's blob array interface or NULL.

Reimplemented in GA_ATIBlobArray.

virtual const GA_AIFCompare* GA_Attribute::getAIFCompare ( ) const
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 const GA_AIFCopyData* GA_Attribute::getAIFCopyData ( ) const
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.

Examples:
RAY/RAY_DemoSprite.C.
virtual const GA_AIFDelta* GA_Attribute::getAIFDelta ( ) const
virtual

Return the attribute's delta interface or NULL.

Reimplemented in GA_ATINumeric.

virtual const GA_AIFEdit* GA_Attribute::getAIFEdit ( ) const
virtual

Return the attribute's edit interface or NULL.

Reimplemented in GA_ATIIndexPair, GA_ATINumeric, and GA_ATINumericArray.

virtual const GA_AIFIndexPair* GA_Attribute::getAIFIndexPair ( ) const
virtual

Return the attribute's index pair interface or NULL.

Reimplemented in GA_ATIIndexPair, and GA_ATINumericArray.

virtual const GA_AIFInterp* GA_Attribute::getAIFInterp ( ) const
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 const GA_AIFJSON* GA_Attribute::getAIFJSON ( ) const
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 const GA_AIFMath* GA_Attribute::getAIFMath ( ) const
virtual

Return the attribute's math interface or NULL.

Reimplemented in GA_ATIIndexPair, GA_ATINumeric, and GA_ATINumericArray.

Examples:
SOP/SOP_TimeCompare.C.
virtual const GA_AIFMerge* GA_Attribute::getAIFMerge ( ) const
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 const GA_AIFNumericArray* GA_Attribute::getAIFNumericArray ( ) const
virtual

Return the attribute's arraydata interface or NULL.

Reimplemented in GA_ATINumericArray.

Examples:
SOP/SOP_ArrayAttrib.C.
virtual const GA_AIFSharedDictArray* GA_Attribute::getAIFSharedDictArray ( ) const
virtual

Return the attribute's shared options tuple interface or NULL.

Reimplemented in GA_ATIDictArray.

virtual const GA_AIFSharedDictTuple* GA_Attribute::getAIFSharedDictTuple ( ) const
virtual

Return the attribute's shared options tuple interface or NULL.

Reimplemented in GA_ATIDict.

virtual const GA_AIFSharedStringArray* GA_Attribute::getAIFSharedStringArray ( ) const
virtual

Return the attribute's shared string array interface or NULL.

Reimplemented in GA_ATIStringArray.

virtual const GA_AIFSharedStringTuple* GA_Attribute::getAIFSharedStringTuple ( ) const
virtual

Return the attribute's shared string tuple interface or NULL.

Reimplemented in GA_ATIString.

virtual const GA_AIFStat* GA_Attribute::getAIFStat ( ) const
virtual

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

Reimplemented in GA_ATIBlindData.

virtual const GA_AIFStringTuple* GA_Attribute::getAIFStringTuple ( ) const
virtual

Return the attribute's string tuple interface or NULL.

Reimplemented in GA_ATIString.

virtual const GA_AIFTuple* GA_Attribute::getAIFTuple ( ) const
virtual

Return the attribute's tuple interface or NULL.

Reimplemented in GA_ElementGroup, GA_ATIIndexPair, GA_ATINumeric, and GA_ATINumericArray.

int64 GA_Attribute::getBaseMemoryUsage ( ) const
protected

For use by getMemoryUsage and countMemory in subclasses to count the amount of memory used by this base class (NOTE: always exclusive)

GA_CEAttribute* GA_Attribute::getCEAttribute ( GA_StorageClass  storage,
int tuplesize,
bool  isarray,
bool  read,
bool  write 
)
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)

SYS_FORCE_INLINE GA_DataId GA_Attribute::getDataId ( ) const
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.

SYS_FORCE_INLINE const GA_Detail& GA_Attribute::getDetail ( ) const
inline

Definition at line 208 of file GA_Attribute.h.

SYS_FORCE_INLINE GA_Detail& GA_Attribute::getDetail ( )
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.

SYS_FORCE_INLINE const UT_StringHolder& GA_Attribute::getFullName ( ) const
inline

Definition at line 284 of file GA_Attribute.h.

SYS_FORCE_INLINE const GA_IndexMap& GA_Attribute::getIndexMap ( ) const
inline

Definition at line 207 of file GA_Attribute.h.

virtual int64 GA_Attribute::getMemoryUsage ( bool  inclusive) const
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.

SYS_FORCE_INLINE const UT_StringHolder& GA_Attribute::getName ( ) const
inline
Examples:
field3d/f3d_io.C, RAY/RAY_DemoSprite.C, and SOP/SOP_PrimVOP.C.

Definition at line 283 of file GA_Attribute.h.

const GA_AttributeOptions& GA_Attribute::getOptions ( ) const
inline

Definition at line 420 of file GA_Attribute.h.

GA_AttributeOptions& GA_Attribute::getOptions ( )
inline

Definition at line 421 of file GA_Attribute.h.

SYS_FORCE_INLINE GA_AttributeOwner GA_Attribute::getOwner ( ) const
inline

Definition at line 210 of file GA_Attribute.h.

SYS_FORCE_INLINE GA_AttributeProxyHandle GA_Attribute::getProxy ( )
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.

SYS_FORCE_INLINE GA_ConstAttributeProxyHandle GA_Attribute::getProxy ( ) const
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 int GA_Attribute::getSaveVersion ( ) const
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.

SYS_FORCE_INLINE GA_AttributeScope GA_Attribute::getScope ( ) const
inline

Definition at line 212 of file GA_Attribute.h.

GA_StorageClass GA_Attribute::getStorageClass ( ) const

Returns the approximate type of the attribute.

Examples:
field3d/f3d_io.C, and SOP/SOP_PrimVOP.C.
virtual WriteConcurrence GA_Attribute::getSupportedWriteConcurrence ( ) const
pure virtual
int GA_Attribute::getTupleSize ( ) const

Size of the AIFTuple, if it exists. If it doesn't, 1.

Examples:
field3d/f3d_io.C, and SOP/SOP_PrimVOP.C.
SYS_FORCE_INLINE const GA_AttributeType& GA_Attribute::getType ( ) const
inline

Definition at line 206 of file GA_Attribute.h.

SYS_FORCE_INLINE GA_TypeInfo GA_Attribute::getTypeInfo ( ) const
inline

Uses the "type" option to determine type information

See Also
getOptions()
Examples:
SOP/SOP_Flatten.C.

Definition at line 252 of file GA_Attribute.h.

virtual void GA_Attribute::hardenAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)
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.

bool GA_Attribute::hasFlag ( AttribFlag  flag) const
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
bool GA_Attribute::isActivelyStreamed ( ) 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.

bool GA_Attribute::isDetached ( ) const
inline

Definition at line 445 of file GA_Attribute.h.

SYS_FORCE_INLINE bool GA_Attribute::isGroup ( ) const
inline

Definition at line 213 of file GA_Attribute.h.

bool GA_Attribute::isTailInitialization ( ) const
inline

Check whether the attribute is set to tail initialization.

Definition at line 488 of file GA_Attribute.h.

static bool GA_Attribute::jsonLoadDefinition ( UT_JSONParser p,
GA_AttributeScope scope,
UT_WorkBuffer type,
UT_WorkBuffer name,
int64 version,
GA_AttributeOptions options 
)
static

Load the GA_Attribute-Definition section.

bool GA_Attribute::jsonSaveDefinition ( UT_JSONWriter w) const

Save the GA_Attribute-Definition section.

JSON Schema: GA_Attribute

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.

[
"name" : "GA_Attribute",
"description" :
"An attribute is defined by an array with two items. The
first item is the definition of the attribute, the second
is private data associated with the attribute (may be null).",
"type" : "array",
"items" : [
{ "$ref" : "GA_Attribute-Definition" }, // Attribute Definition
{ "$ref" : "GA_Attribute-Data" }, // Specific type data
],
]

JSON Schema: GA_Attribute-Definition

The attribute definition is a map containing the fields required to recreate the attribute.

{
"name" : "GA_Attribute-Definition",
"description" : "An map defining the attribute",
"type" : "orderedmap",
"properties": {
"scope": {
"type" : "string",
"optional" : true,
"default" : "public",
"description" : "Scope of the attribute",
},
"type": {
"type" : "string",
"description" : "Attribute type (ATI name)",
},
"name": {
"type" : "string",
"description" : "Name of the attribute",
},
"version": {
"type" : "integer",
"optional" : true,
"description" : "Version level for save",
},
"options": {
"type" : { "$ref" : "UT_Options" }
"description" : "Arbitrary options on the attribute",
},
},
}
See Also
JSON_FileFormat, GA_AttributeSet, GA_AttributeType
virtual bool GA_Attribute::matchesStorage ( const GA_Attribute that) const
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.

void GA_Attribute::mergeOptions ( const GA_AttributeOptions src)
inline

Merge the options passed in with the options in the attribute.

Definition at line 464 of file GA_Attribute.h.

virtual bool GA_Attribute::needDestruction ( ) const
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.

bool GA_Attribute::needsTransform ( bool  include_P = true) const
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.

Examples:
SOP/SOP_Flatten.C.

Definition at line 437 of file GA_Attribute.h.

static GA_DataId GA_Attribute::nextDataId ( )
static

This is only here so that select data outside of GA_Attribute can also have data IDs, like GA_PrimitiveList and GA_EdgeGroup.

void GA_Attribute::reconstructElement ( GA_Offset  offset)
inline

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.

virtual void GA_Attribute::reconstructElementBlock ( GA_Offset  offset,
GA_Offset  nelements 
)
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.

virtual void GA_Attribute::replace ( const GA_Attribute src)
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.

void GA_Attribute::setActivelyStreamed ( bool  isstreaming)
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.

virtual bool GA_Attribute::setArraySize ( GA_Offset  size)
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)

void GA_Attribute::setDetached ( bool  detached)
inlineprotected

Only called by GA_AttributeSet and GA_ElementGroup.

Definition at line 708 of file GA_Attribute.h.

void GA_Attribute::setExistedPriorToStream ( bool  preexisted)
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.

void GA_Attribute::setFlag ( AttribFlag  flag,
bool  onoff 
)
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.

void GA_Attribute::setNonTransforming ( bool  val)
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.

See Also
needsTransform()
getTypeInfo()

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.

SYS_FORCE_INLINE void GA_Attribute::setTypeInfo ( GA_TypeInfo  type)
inline

Set the option. This sets the "type" option on the attribute

See Also
getOptions()
Examples:
SIM/SNOW_Solver.C, and SOP/SOP_SParticle.C.

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.

virtual void GA_Attribute::tryCompressAllPages ( GA_Offset  start_offset = GA_Offset(0),
GA_Offset  end_offset = GA_INVALID_OFFSET 
)
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.

Friends And Related Function Documentation

friend class GA_AttributeSet
friend

Only called by GA_AttributeSet and GA_ElementGroup.

Definition at line 738 of file GA_Attribute.h.

GA_Attribute* GA_AttributeType::create ( const GA_IndexMap ,
GA_AttributeScope  ,
const UT_StringHolder ,
const UT_Options ,
const GA_AttributeOptions  
) const
friend
friend class GA_ElementGroup
friend

Only called by GA_AttributeSet and GA_ElementGroup.

Definition at line 739 of file GA_Attribute.h.

friend class GA_MergeMap
friend

Only called by GA_AttributeSet and GA_ElementGroup.

Definition at line 740 of file GA_Attribute.h.


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