HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils.h File Reference
#include "pxr/pxr.h"
#include "pxr/imaging/hd/api.h"
#include "pxr/base/tf/declarePtrs.h"
#include <memory>
#include <string>
#include <unordered_map>
+ Include dependency graph for utils.h:

Go to the source code of this file.

Classes

class  HdUtils::RenderInstanceTracker< T >
 

Namespaces

 HdUtils
 

Functions

PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS (HdSceneIndexBase)
 
RenderInstanceTracker facility below provides a simple way

A simple facility to associate an application object managed by std::shared_ptr with a render instance id.

This is useful when using the scene index callback registration facility. The callback is registered only once, but may be invoked each time the scene index graph is created (this currently happens during the render index construction). Futhermore, an application may spawn several render index instances and thus the (same) callback may be invoked several times, necessitating a way to map the callback back to the associated scene index instance.

The to register, unregister and query an object that is tied to a render instance id, which is provided as a callback argument.

Note
The RegisterInstance method should be invoked before the scene index callback is invoked (i.e., prior to render index construction).

The UnregisterInstance method is typically invoked prior to render index destruction.

Note
This facility isn't thread-safe.
See Also
HdSceneIndexPluginRegistry::SceneIndexAppendCallback
HdSceneIndexPluginRegistry::RegisterSceneIndexForRenderer
HD_API bool HdUtils::HasActiveRenderSettingsPrim (const HdSceneIndexBaseRefPtr &si, SdfPath *primPath=nullptr)
 

Function Documentation

PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS ( HdSceneIndexBase  )