Main Page Class List Class Members

# Nv::Blast::TkFramework Class Reference

`#include <NvBlastTkFramework.h>`

List of all members.

## Public Member Functions
virtual TkActor * | createActor (const TkActorDesc &desc)=0
virtual TkAsset * | createAsset (const NvBlastAsset *assetLL, Nv::Blast::TkAssetJointDesc *jointDescs=nullptr, uint32_t jointDescCount=0, bool ownsAsset=false)=0
virtual TkAsset * | createAsset (const TkAssetDesc &desc)=0
virtual TkGroup * | createGroup (const TkGroupDesc &desc)=0
virtual TkJoint * | createJoint (const TkJointDesc &desc)=0
virtual bool | ensureAssetExactSupportCoverage (NvBlastChunkDesc *chunkDescs, uint32_t chunkCount) const =0
virtual TkIdentifiable * | findObjectByID (const NvBlastID &id) const =0
virtual uint32_t | getObjectCount (const TkType &type) const =0
virtual uint32_t | getObjects (TkIdentifiable **buffer, uint32_t bufferSize, const TkType &type, uint32_t indexStart=0) const =0
virtual const TkType * | getType (TkTypeIndex::Enum typeIndex) const =0
virtual void | release ()=0
virtual bool | reorderAssetDescChunks (NvBlastChunkDesc *chunkDescs, uint32_t chunkCount, NvBlastBondDesc *bondDescs, uint32_t bondCount, uint32_t *chunkReorderMap=nullptr, bool keepBondNormalChunkOrder=false) const =0
## Protected Member Functions
virtual | ~TkFramework ()

## Detailed Description

BlastTk Framework.

The framework exists as a singleton and is used to create objects, deserialize object streams, and hold references to identified objects (TkAsset, TkFamily, and TkGroup) which may be recalled by their GUIDs.

## Constructor & Destructor Documentation

virtual Nv::Blast::TkFramework::~TkFramework | ( |  | ) | `[inline, protected, virtual]`

Destructor is virtual and not public - use the release() method instead of explicitly deleting the TkFramework

## Member Function Documentation

virtual TkActor* Nv::Blast::TkFramework::createActor | ( | const TkActorDesc & | desc | ) | `[pure virtual]`

Create an actor from the given descriptor. The actor will be the first member of a new TkFamily.

Parameters:

  `[in]` | desc | The actor descriptor (see TkActorDesc).

Returns:
  the created actor, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

virtual TkAsset* Nv::Blast::TkFramework::createAsset | ( | const NvBlastAsset * | assetLL,
|  | Nv::Blast::TkAssetJointDesc * | jointDescs = `nullptr`,
|  | uint32_t | jointDescCount = `0`,
|  | bool | ownsAsset = `false` |
| ) |  |  | `[pure virtual]`

Create an asset from a low-level NvBlastAsset.

Parameters:

  `[in]` | assetLL | The low-level NvBlastAsset to encapsulate.
  `[in]` | jointDescs | Optional joint descriptors to add to the new asset.
  `[in]` | jointDescCount | The number of joint descriptors in the jointDescs array. If non-zero, jointDescs cannot be NULL.
  `[in]` | ownsAsset | Does this TkAsset own the NvBlastAsset and thus is responsible for freeing it.

Returns:
  the created asset, if memory was available for the operation. Otherwise, returns NULL.

virtual TkAsset* Nv::Blast::TkFramework::createAsset | ( | const TkAssetDesc & | desc | ) | `[pure virtual]`

Create an asset from the given descriptor.

Parameters:

  `[in]` | desc | The asset descriptor (see TkAssetDesc).

Returns:
  the created asset, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

virtual TkGroup* Nv::Blast::TkFramework::createGroup | ( | const TkGroupDesc & | desc | ) | `[pure virtual]`

Create a group from the given descriptor. A group is a processing unit, to which the user may add TkActors. New actors generated from splitting a TkActor are automatically put into the same group. However, any actor may be removed from its group and optionally placed into another group, or left groupless.

Parameters:

  `[in]` | desc | The group descriptor (see TkGroupDesc).

Returns:
  the created group, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

virtual TkJoint* Nv::Blast::TkFramework::createJoint | ( | const TkJointDesc & | desc | ) | `[pure virtual]`

Create a joint from the given descriptor. The following restrictions apply:

Only one joint may be created between any two support chunks.

A joint cannot be created between chunks within the same actor using this method. See TkAssetDesc for a description of bond joint flags, which will create internal joints within an actor.

Parameters:

  `[in]` | desc | The joint descriptor (see TkJointDesc).

Returns:
  the created joint, if the descriptor was valid and memory was available for the operation. Otherwise, returns NULL.

virtual bool Nv::Blast::TkFramework::ensureAssetExactSupportCoverage | ( | NvBlastChunkDesc * | chunkDescs,
|  | uint32_t | chunkCount |
| ) |  |  | const`[pure virtual]`

Helper function to ensure (check and update) support coverage of chunks, required for asset creation via the createAsset function.

This is a convenience wrapper for the low-level NvBlastEnsureAssetExactSupportCoverage function.

The chunk descriptors may have their support flags be modified to ensure exact coverage.

Parameters:

  `[in]` | chunkDescs | An array of chunk descriptors.
  `[in]` | chunkCount | The size of the chunkDescs array.

Returns:
  true iff coverage was already exact.

virtual TkIdentifiable* Nv::Blast::TkFramework::findObjectByID | ( | const NvBlastID & | id | ) | const`[pure virtual]`

Look up an object derived from TkIdentifiable by its ID.

Parameters:

  `[in]` | id | The ID of the object to look up (see NvBlastID).

Returns:
  pointer the object if it exists, NULL otherwise.

virtual uint32_t Nv::Blast::TkFramework::getObjectCount | ( | const TkType & | type | ) | const`[pure virtual]`

The number of TkIdentifiable-derived objects in the framework of the given type.

Parameters:

  `[in]` | type | The type object for the given type.

Returns:
  the number of objects that currently exist of the given type.

virtual uint32_t Nv::Blast::TkFramework::getObjects | ( | TkIdentifiable ** | buffer,
|  | uint32_t | bufferSize,
|  | const TkType & | type,
|  | uint32_t | indexStart = `0` |
| ) |  |  | const`[pure virtual]`

Retrieve an array of pointers (into the user-supplied buffer) to TkIdentifiable-derived objects of the given type.

Parameters:

  `[out]` | buffer | A user-supplied array of TkIdentifiable pointers.
  `[in]` | bufferSize | The number of elements available to write into buffer.
  `[in]` | type | The type object for the given type.
  `[in]` | indexStart | The starting index of the object.

Returns:
  the number of TkIdentifiable pointers written to the buffer.

virtual const TkType* Nv::Blast::TkFramework::getType | ( | TkTypeIndex::Enum | typeIndex | ) | const`[pure virtual]`

To find the type information for a given TkIdentifiable-derived class, use this funtion with the TkTypeIndex::Enum corresponding to the desired class name.

Parameters:

  `[in]` | typeIndex | Enumerated object type (see TkTypeIndex).

Returns:
  type object associated with the object's class.

virtual void Nv::Blast::TkFramework::release | ( |  | ) | `[pure virtual]`

Release this framework and all contained objects. Global singleton is set to NULL.

virtual bool Nv::Blast::TkFramework::reorderAssetDescChunks | ( | NvBlastChunkDesc * | chunkDescs,
|  | uint32_t | chunkCount,
|  | NvBlastBondDesc * | bondDescs,
|  | uint32_t | bondCount,
|  | uint32_t * | chunkReorderMap = `nullptr`,
|  | bool | keepBondNormalChunkOrder = `false` |
| ) |  |  | const`[pure virtual]`

Helper function to build and apply chunk reorder map, so that chunk descriptors are properly ordered for the createAsset function.

This is a convenience wrapper for the low-level NvBlastReorderAssetDescChunks function.

This function may modify both the chunkDescs and bondDescs array, since rearranging chunk descriptors requires re-indexing within the bond descriptors.

Parameters:

  `[in]` | chunkDescs | Array of chunk descriptors of size chunkCount. It will be updated accordingly.
  `[in]` | chunkCount | The number of chunk descriptors.
  `[in]` | bondDescs | Array of bond descriptors of size chunkCount. It will be updated accordingly.
  `[in]` | bondCount | The number of bond descriptors.
  `[in]` | chunkReorderMap | If not NULL, must be a pointer to a uint32_t array of size desc.chunkCount. Maps old chunk indices to the reordered chunk indices.
  `[in]` | keepBondNormalChunkOrder | If true, bond normals will be flipped if their chunk index order was reveresed by the reorder map.

Returns:
  true iff the chunks did not require reordering (chunkReorderMap is the identity map).

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

- sdk/toolkit/include/NvBlastTkFramework.h