omni::graph::core::IAttributeData

Defined in omni/graph/core/iAttributeData.h

struct IAttributeData

Interface to data belonging to a specific attribute.

Public Functions

inline bool isArray(const GraphContextObj &contextObj, ConstAttributeDataHandle handle)

Checks whether the type of this attribute data is an array type, i.e.

array depth of 1 (array) or 2 (array of arrays; not yet supported).

Parameters
  • contextObj[in] The GraphContextObj containing the attribute data

  • handle[in] The handle to the attribute data to check

Returns

true if the attribute data is an array type, else false

Public Members

NameToken (*getName)(const GraphContextObj &contextObj, ConstAttributeDataHandle handle)

Gets the name of the attribute containing this attribute data.

The attribute data handle may refer to attribute data from an attribute that is upstream of the attribute from which the handle was retrieved, in which case, this will return the upstream attribute’s name.

Param contextObj

[in] The GraphContextObj containing the attribute data

Param handle

[in] The handle to the attribute whose name is being requested

Return

A NameToken representing the attribute’s name, for which the text can be retrieved using IToken::getText

NameToken (*getTypeName)(const GraphContextObj &contextObj, ConstAttributeDataHandle handle)

Gets the name of the type of this attribute data.

Use getType to get a representation of the type that is easier to interpret in code.

The actual attribute data may have a different type than an associated attribute on a node, for example, if the upstream source of the data has a different type. This function returns the type of the data, not the type of the associated attribute.

Param contextObj

[in] The GraphContextObj containing the attribute data

Param handle

[in] The handle to the attribute data whose type name is being requested

Return

A NameToken representing the attribute data’s type name, for which the text can be retrieved using IToken::getText

Type (*getType)(const GraphContextObj &contextObj, ConstAttributeDataHandle handle)

Gets the type of this attribute data in a representation that is easily interpreted by code.

The actual attribute data may have a different type than an associated attribute on a node, for example, if the upstream source of the data has a different type. This function returns the type of the data, not the type of the associated attribute.

Param contextObj

[in] The GraphContextObj containing the attribute data

Param handle

[in] The handle to the attribute data whose type is being requested

Return

A Type structure representing the attribute data’s type, whose members provide information about the type

void (*deprecated_0)(const void**, const GraphContextObj&, const ConstAttributeDataHandle*, size_t)

deprecated function, do not use

void (*getDataRGPU)(const void **attrsOut, const GraphContextObj &contextObj, const ConstAttributeDataHandle *attrHandles, size_t attrCount)

Gets GPU pointers to the read-only GPU data of some number of attributes.

Any invalid attributes will have null pointers. Array attributes have an extra level of indirection. For example, after requesting int attribute data, attrsOut will effectively be of type const int** upon returning, but after requesting int array attribute data, attrsOut will effectively be of type const int* const**.

If the attribute data is not on the GPU at the time of this call, but is on the CPU, it will be copied to the GPU before returning.

Deprecated: Use getDataRGpuAt

Param attrsOut

[out] Array to be filled in with pointers to data of each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose data are being requested

Param attrCount

[in] Number of attributes whose data are being requested

void (*getDataW)(void **attrsOut, const GraphContextObj &contextObj, const AttributeDataHandle *attrHandles, size_t attrCount)

Gets CPU pointers to the writable CPU data of some number of attributes.

Any invalid attributes will have null pointers. Array attributes have an extra level of indirection. For example, after requesting int attribute data, attrsOut will effectively be of type int** upon returning, but after requesting int array attribute data, attrsOut will effectively be of type int*const**.

If the attribute data is not on the CPU at the time of this call, but is on the GPU, it will be copied to the CPU and invalidated on the GPU before returning.

Param attrsOut

[out] Array to be filled in with pointers to data of each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose data are being requested

Param attrCount

[in] Number of attributes whose data are being requested

void (*getDataWGPU)(void **attrsOut, const GraphContextObj &contextObj, const AttributeDataHandle *attrHandles, size_t attrCount)

Gets GPU pointers to the writable GPU data of some number of attributes.

Any invalid attributes will have null pointers. Array attributes have an extra level of indirection. For example, after requesting int attribute data, attrsOut will effectively be of type int** upon returning, but after requesting int array attribute data, attrsOut will effectively be of type int*const**.

If the attribute data is not on the GPU at the time of this call, but is on the CPU, it will be copied to the GPU and invalidated on the CPU before returning.

Deprecated: Use getDataWGpuAt

Param attrsOut

[out] Array to be filled in with pointers to data of each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose data are being requested

Param attrCount

[in] Number of attributes whose data are being requested

void (*deprecated_1)(const GraphContextObj&, const AttributeDataHandle*, size_t)

Deprecated function, do not use.

void (*getElementCount)(size_t *countOut, const GraphContextObj &contextObj, const ConstAttributeDataHandle *attrHandles, size_t attrCount)

Gets the number of array elements in each of the specified attributes.

Any invalid attributes will considered to have 0 elements. Attributes that are not arrays will be considered to have 1 element. Array of array attributes are not yet supported.

Param countOut

[out] Array to be filled in with number of elements in each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose element counts are being requested

Param attrCount

[in] Number of attributes whose element counts are being requested

void (*setElementCount)(const GraphContextObj &contextObj, AttributeDataHandle handle, size_t count)

Sets the number of array elements in the specified array attribute.

The array attribute’s data will not be resized until a pointer to its data is requested.

Param contextObj

[in] The GraphContextObj containing the attribute data

Param handle

[in] Attribute data handle referring to an array attribute

Param count

[in] Element count to which the array attribute data should be resized.

void (*copyData)(AttributeDataHandle destination, const GraphContextObj &contextObj, ConstAttributeDataHandle source)

Copies the data from an existing attribute data value into this one.

As only data is being copied a name for the destination is not required and will remain unchanged.

Param destination

[in] Data location to be overwritten

Param contextObj

[in] Location of both sets of attribute data

Param source

[in] Data being copied

void (*getDataReferenceR)(const ConstAttributeDataHandle attrHandle, const GraphContextObj &contextObj, ConstRawPtr &refToData, size_t &refToSize)

Get the location and total number of bytes occupied by the readable attribute data on the CPU.

If the data is not currently valid on the CPU the pointer returned will be nullptr.

Param contextObj

[in] Location of both sets of attribute data

Param attrHandle

[in] Handle to the attribute whose size is to be returned

Param refToData

[out] Resulting pointer to the attribute data

Param refToSize

[out] Size of the data being pointed at

void (*getDataReferenceRGpu)(const ConstAttributeDataHandle attrHandle, const GraphContextObj &contextObj, ConstRawPtr &refToData, size_t &refToSize)

Get the location and total number of bytes occupied by the readable attribute data on the GPU.

If the data is not currently valid on the GPU the pointer returned will be nullptr. If it is then it will point to GPU memory, and should not be dereferenced on the CPU side.

Deprecated: Use getDataReferenceRGpuAt

Param contextObj

[in] Location of both sets of attribute data

Param attrHandle

[in] Handle to the attribute whose size is to be returned

Param refToData

[out] Resulting pointer to the attribute data

Param refToSize

[out] Size of the data being pointed at

void (*getDataReferenceW)(const AttributeDataHandle attrHandle, const GraphContextObj &contextObj, RawPtr &refToData, size_t &refToSize)

Get the location and total number of bytes occupied by the writable attribute data on the CPU.

If the data is not currently valid on the CPU the pointer returned will be nullptr.

Param contextObj

[in] Location of both sets of attribute data

Param attrHandle

[in] Handle to the attribute whose size is to be returned

Param refToData

[out] Resulting pointer to the attribute data

Param refToSize

[out] Size of the data being pointed at

void (*getDataReferenceWGpu)(const AttributeDataHandle attrHandle, const GraphContextObj &contextObj, RawPtr &refToData, size_t &refToSize)

Get the location and total number of bytes occupied by the writable attribute data on the GPU.

If the data is not currently valid on the GPU the pointer returned will be nullptr. If it is then it will point to GPU memory, and should not be dereferenced on the CPU side.

Deprecated: Use getDataReferenceWGpuAt

Param contextObj

[in] Location of both sets of attribute data

Param attrHandle

[in] Handle to the attribute whose size is to be returned

Param refToData

[out] Resulting pointer to the attribute data

Param refToSize

[out] Size of the data being pointed at

bool (*cpuValid)(const ConstAttributeDataHandle attrHandle, const GraphContextObj &contextObj)

Check if the cpu data of the given attribute is currently valid.

Param contextObj

[in] Location of both sets of attribute data

Param attrHandle

[in] Handle to the attribute

bool (*gpuValid)(const ConstAttributeDataHandle attrHandle, const GraphContextObj &contextObj)

Check if the gpu data of the given attribute is currently valid.

Param contextObj

[in] Location of both sets of attribute data

Param attrHandle

[in] Handle to the attribute

void (*getDataRGpuAt)(const void **attrsOut, const GraphContextObj &contextObj, const ConstAttributeDataHandle *attrHandles, size_t attrCount, omni::fabric::PtrToPtrKind whereGpuPtrs)

Gets GPU pointers to the read-only GPU data of some number of attributes.

Any invalid attributes will have null pointers. Array attributes have an extra level of indirection. For example, after requesting int attribute data, attrsOut will effectively be of type const int** upon returning, but after requesting int array attribute data, attrsOut will effectively be of type const int* const**.

If the attribute data is not on the GPU at the time of this call, but is on the CPU, it will be copied to the GPU before returning.

Param attrsOut

[out] Array to be filled in with pointers to data of each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose data are being requested

Param attrCount

[in] Number of attributes whose data are being requested

Param whereGpuPtrs

[in] For array data, the location of the array pointer - either on the CPU or on the GPU

void (*getDataWGpuAt)(void **attrsOut, const GraphContextObj &contextObj, const AttributeDataHandle *attrHandles, size_t attrCount, omni::fabric::PtrToPtrKind whereGpuPtrs)

Gets GPU pointers to the writable GPU data of some number of attributes.

Any invalid attributes will have null pointers. Array attributes have an extra level of indirection. For example, after requesting int attribute data, attrsOut will effectively be of type int** upon returning, but after requesting int array attribute data, attrsOut will effectively be of type int*const**.

If the attribute data is not on the GPU at the time of this call, but is on the CPU, it will be copied to the GPU and invalidated on the CPU before returning.

Param attrsOut

[out] Array to be filled in with pointers to data of each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose data are being requested

Param attrCount

[in] Number of attributes whose data are being requested

Param whereGpuPtrs

[in] For array data, the location of the array pointer - either on the CPU or on the GPU

void (*getDataReferenceRGpuAt)(const ConstAttributeDataHandle attrHandle, const GraphContextObj &contextObj, omni::fabric::PtrToPtrKind whereGpuPtrs, ConstRawPtr &refToData, size_t &refToSize)

Get the location and total number of bytes occupied by the readable attribute data on the GPU.

If the data is not currently valid on the GPU the pointer returned will be nullptr. If it is then it will point to GPU memory, and should not be dereferenced on the CPU side.

Param attrHandle

[in] Handle to the attribute whose size is to be returned

Param contextObj

[in] Location of both sets of attribute data

Param whereGpuPtrs

[in] For array data, the location of the array pointer - either on the CPU or on the GPU

Param refToData

[out] Resulting pointer to the attribute data

Param refToSize

[out] Size of the data being pointed at

void (*getDataReferenceWGpuAt)(AttributeDataHandle attrHandle, const GraphContextObj &contextObj, omni::fabric::PtrToPtrKind whereGpuPtrs, RawPtr &refToData, size_t &refToSize)

Get the location and total number of bytes occupied by the writable attribute data on the GPU.

If the data is not currently valid on the GPU the pointer returned will be nullptr. If it is then it will point to GPU memory, and should not be dereferenced on the CPU side.

Param attrHandle

[in] Handle to the attribute whose size is to be returned

Param contextObj

[in] Location of both sets of attribute data

Param whereGpuPtrs

[in] For array data, the location of the array pointer - either on the CPU or on the GPU

Param refToData

[out] Resulting pointer to the attribute data

Param refToSize

[out] Size of the data being pointed at

bool (*performConversion)(void *dstDataOut, Type dstType, void *srcDataIn, Type srcType)

Perform a conversion between 2 data types.

The actual attribute data may have a different type than an associated attribute on a node, for example, if the upstream source of the data has a different type. This function can be used to perform the conversion from the actual attribute data, to the provided buffer of the type of the attribute

Param dstDataOut

[out] A pointer to the destination buffer to be filled with the result of the conversion

Param dstType

[in] The type the destination buffer

Param srcDataIn

[in] A pointer to the actual attribute data

Param srcType

[in] The type of the attribute data pointer

Return

True if a conversion exists and succeeded, False otherwise.

void (*getDataR)(const void **attrsOut, const GraphContextObj &contextObj, const ConstAttributeDataHandle *attrHandles, size_t attrCount)

Gets CPU pointers to the read-only CPU data of some number of attributes.

Any invalid attributes will have null pointers. Array attributes have an extra level of indirection. For example, after requesting int attribute data, attrsOut will effectively be of type const int** upon returning, but after requesting int array attribute data, attrsOut will effectively be of type const int* const**.

If the attribute data is not on the CPU at the time of this call, but is on the GPU, it will be copied to the CPU before returning.

Param attrsOut

[out] Array to be filled in with pointers to data of each attribute

Param contextObj

[in] The GraphContextObj containing the attribute data

Param attrHandles

[in] Array of attribute data handles whose data are being requested

Param attrCount

[in] Number of attributes whose data are being requested

AttributeDataHandle (*moveToAnotherInstanceW)(const GraphContextObj &contextObj, AttributeDataHandle attrHandle, int offset)

In a vectorized context, retrieve the write handle to another instance from a given one.

Param contextObj

[in] Location of attribute data

Param attrHandle

[in] The source handle to offset

Param offset

[in] An offset to apply to the provided handle. Can be negative.

Return

A handle to the instance located at the provided offset relative to the provided handle

ConstAttributeDataHandle (*moveToAnotherInstanceR)(const GraphContextObj &contextObj, ConstAttributeDataHandle attrHandle, int offset)

In a vectorized context, retrieve the read handle to another instance from a given one.

Param contextObj

[in] Location of attribute data

Param attrHandle

[in] The source handle to offset

Param offset

[in] An offset to apply to the provided handle. Can be negative.

Return

A handle to the instance located at the provided offset relative to the provided handle