HDK
|
#include <primTypeIndex.h>
This class is only used by the render index. It provides functionality to manage and store one class of prim such as a Sprim or Bprim.
Definition at line 50 of file primTypeIndex.h.
Hd_PrimTypeIndex< PrimType >::Hd_PrimTypeIndex | ( | ) |
Hd_PrimTypeIndex< PrimType >::~Hd_PrimTypeIndex | ( | ) |
void Hd_PrimTypeIndex< PrimType >::Clear | ( | HdChangeTracker & | tracker, |
HdRenderDelegate * | renderDelegate | ||
) |
Removes and frees all prims in this index. The render delegate is responsible for freeing the actual memory allocated to the prim. The prim is also removed from the change tracker.
bool Hd_PrimTypeIndex< PrimType >::CreateFallbackPrims | ( | HdRenderDelegate * | renderDelegate | ) |
Uses the provided render delegate to create the fallback prims for use by the index. The prim types created are based on those specified by InitPrimTypes.
If the render delegate fails to create a prim, this function returns false and the index is remain uninitialized and shouldn't be used.
void Hd_PrimTypeIndex< PrimType >::DestroyFallbackPrims | ( | HdRenderDelegate * | renderDelegate | ) |
Clean-up function for the index. Uses the delegate to deallocate the memory used by the fallback prims. The index is returned to an uninitialized state and shouldn't be used, unless reinitialized.
PrimType* Hd_PrimTypeIndex< PrimType >::GetFallbackPrim | ( | TfToken const & | typeId | ) | const |
Obtain a prim, that implements the schema given by type id, that can be used as a substitute for any prim of that type in the event of an error.
Hydra guarantees that the prim is not null for any type that is supported by the back-end.
PrimType* Hd_PrimTypeIndex< PrimType >::GetPrim | ( | const TfToken & | typeId, |
const SdfPath & | primId | ||
) | const |
Obtains a modifiable pointer the prim with the given type and id. If no prim with the given id is in the index or the type id is incorrect, then nullptr is returned.
void Hd_PrimTypeIndex< PrimType >::GetPrimSubtree | ( | const TfToken & | typeId, |
const SdfPath & | rootPath, | ||
SdfPathVector * | outPaths | ||
) |
Returns a list of Prim Ids in outPaths of prims that type match typeId who are namespace children of rootPath. rootPath does not need to match any prim in the index or it may point to a prim of a different type.
const HdSceneDelegatePtrVector& Hd_PrimTypeIndex< PrimType >::GetSceneDelegatesForDirtyPrims | ( | ) |
Returns a vector of unique scene delegates corresponding to the dirty prims that were sync'd in SyncPrims.
void Hd_PrimTypeIndex< PrimType >::InitPrimTypes | ( | const TfTokenVector & | primTypes | ) |
Initialize this prim index, specifying the typeId tokens that should be supported by this index.
void Hd_PrimTypeIndex< PrimType >::InsertPrim | ( | const TfToken & | typeId, |
HdSceneDelegate * | sceneDelegate, | ||
const SdfPath & | primId, | ||
HdChangeTracker & | tracker, | ||
HdRenderDelegate * | renderDelegate | ||
) |
Add a new a prim to the render index identified by the globally unique identifier, primId. typeId is the type of the prim to create, which is allocated using the provided render delegate. The Scene delegate provided is associated with the prim and is the one used to pull the data for the prim during sync processing. As well as being inserted into this index, the prim is added to the change tracker, with the initial dirty state provided by the prim itself.
void Hd_PrimTypeIndex< PrimType >::RemovePrim | ( | const TfToken & | typeId, |
const SdfPath & | primId, | ||
HdChangeTracker & | tracker, | ||
HdRenderDelegate * | renderDelegate | ||
) |
Removes the prim identifier by primId. TypeId is the type of that prim. Memory for the prim is deallocated using the render delegate. The prim is also removed from the change tracker.
void Hd_PrimTypeIndex< PrimType >::RemoveSubtree | ( | const SdfPath & | root, |
HdSceneDelegate * | sceneDelegate, | ||
HdChangeTracker & | tracker, | ||
HdRenderDelegate * | renderDelegate | ||
) |
Removes the subtree of prims identifier by root that are owned by the given scene delegate. This function affects all prim types. Memory for the prim is deallocated using the render delegate. The prim is also removed from the change tracker.
void Hd_PrimTypeIndex< PrimType >::SyncPrims | ( | HdChangeTracker & | tracker, |
HdRenderParam * | renderParam, | ||
HdRenderDelegate * | renderDelegate | ||
) |
Main Sync Processing function.
Will call the Sync function on all prims in the index that are marked dirty in the specified change tracker. Also updates an internal list of scene delegates for the dirty prims.