omni::graph::core::IAttributeType

Defined in omni/graph/core/IAttributeType.h

struct IAttributeType

Interface class managing various features of attribute types.

Public Members

Type (*typeFromOgnTypeName)(const char *ognTypeName)

Returns an attribute type object corresponding to the OGN-style type name.

The type name is assumed to contain no whitespace for efficiency, so prune it before calling if necessary.

Param ognTypeName

[in] Attribute type name in the format used by the .ogn files

Return

The attribute type description corresponding to the type name

Type (*typeFromSdfTypeName)(const char *sdfTypeName)

Returns an attribute type object corresponding to the Sdf-style type name.

The type name is assumed to contain no whitespace for efficiency, so prune it before calling if necessary. Note that some types cannot be expressed in this form (e.g. the extended types such as “union” and “any”, and OGn-only types such as “bundle”) so where possible use the typeFromOgnTypeName() method.

Param sdfTypeName

[in] Attribute type name in the format used by pxr::SdfValueTypeNames

Return

The attribute type description corresponding to the type name

size_t (*baseDataSize)(Type const &type)

Returns the size of the base data (without tuples or array counts) for the given attribute type.

Param type

[in] Attribute type whose size is to be returned

Return

Size of the base data stored by the attribute type, 0 if none is stored

bool (*inspect)(Type const &type, void const *data, size_t arrayElementCount, inspect::IInspector *inspector)

Runs the inspector on the attribute data with the given type.

Param type

[in] The attribute type of the raw data

Param data

[in] Pointer to the raw data of the given type.

Param elementCount

[in] Number of array elements in the data (1 if not an array)

Param inspector

[in] The inspector class

Return

true if the inspection ran successfully, false if the inspection type is not supported

NameToken (*sdfTypeNameFromType)(Type const &type)

Returns the SdfValueTypeName corresponding to the given type.

For example Type(BaseDataType::UInt64, 1, 0, AttributeRole::eObjectId) is an OGN “objectId” which will return just “uint64” from this function.

Note

Not all OGN Types are fully represented in the Sdf schema since they have additional semantics in OGN which do not exist in USD. In that case the SdfValueTypeName of the base type will be returned, which is what is used to serialize the attribute.

Param type

[in] The Type in question

Return

The token of the corresponding SdfTypeName

bool (*isLegalOgnType)(Type const &type)

Checks to see if the Type passed in corresponds to a legal OGN type.

Param type

[in] Type to be checked

Return

true if the Type can be fully represented by OGN

Return

false if the Type does not correspond exactly to an OGN type

size_t (*getUnionTypeCount)()

Retrieves the number of attribute unions.

Return

The number of attribute union types.

size_t (*getUnionTypes)(const char **buffer, size_t bufferSize)

Retrieves the name of the available union types.

Param buffer

[in] The array of pointers to fill in with names of the union types. The values returned are only valid while the list of unions is not changing.

Param bufferSize

[in] The number of entries to retrieve. Use getUnionTypeCount to retrieve the number available.

Return

The number of entries written to buffer.

size_t (*getUnionTypeEntryCount)(const char *unionType)

Retrieves the number of entries for the attribute union of the given name.

Param unionType

[in] The name of the attribute union to retrieve.

Return

The number of entries associated with unionType. If unionType is not valid, 0 is returned.

size_t (*getUnionTypeEntries)(const char *unionType, const char **buffer, size_t bufferSize)

Gets the list of ogn type names associated with an attribute union.

The list of returned types is fully expanded. This means if an attribute union is defined in terms of other attributes unions, the entries returned will have recursively expanded each entry and the final list will only contain ogn type names and not other attribute unions names.

Param unionType

[in] The name of the attribute union to retrieve.

Param buffer

[in] The array of pointers to fill in with names of the ogn types names. The values returned are only valid while the list of unions is not changing.

Param bufferSize

[in] The number of entries to retrieve. Use getUnionTypeEntryCount to find the maximum available.

Return

The number of items written to buffer. If unionType is not valid, 0 is returned.