25 #ifndef PXR_IMAGING_HD_UTILS_H
26 #define PXR_IMAGING_HD_UTILS_H
35 #include <unordered_map>
87 auto res = idInstanceMap.insert({renderInstanceId, sp});
90 if (
auto handle = wp.lock()) {
95 "An instance with renderInstanceId %s was already "
96 "registered previously.", renderInstanceId.c_str());
99 res.first->second = sp;
106 idInstanceMap.erase(renderInstanceId);
112 const auto it = idInstanceMap.find(
id);
113 if (it != idInstanceMap.end()) {
123 using _IdToInstanceMap = std::unordered_map<std::string, TWeakPtr>;
124 _IdToInstanceMap idInstanceMap;
134 const HdSceneIndexBaseRefPtr &si,
141 #endif // PXR_IMAGING_HD_UTILS_H
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(HdSceneIndexBase)
TSharedPtr GetInstance(std::string const &id)
GLsizei const GLchar *const * string
std::weak_ptr< T > TWeakPtr
void RegisterInstance(std::string const &renderInstanceId, TSharedPtr const &sp)
std::shared_ptr< T > TSharedPtr
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
void UnregisterInstance(std::string const &renderInstanceId)
HD_API bool HasActiveRenderSettingsPrim(const HdSceneIndexBaseRefPtr &si, SdfPath *primPath=nullptr)
#define PXR_NAMESPACE_CLOSE_SCOPE