8#ifndef PXR_IMAGING_HD_UTILS_H
9#define PXR_IMAGING_HD_UTILS_H
12#include "pxr/imaging/hd/api.h"
13#include "pxr/imaging/hd/dataSource.h"
14#include "pxr/imaging/hd/material.h"
15#include "pxr/imaging/cameraUtil/conformWindow.h"
18#include "pxr/usd/sdf/path.h"
23#include <unordered_map>
25PXR_NAMESPACE_OPEN_SCOPE
61class RenderInstanceTracker
64 using TWeakPtr = std::weak_ptr<T>;
65 using TSharedPtr = std::shared_ptr<T>;
67 void RegisterInstance(
68 std::string
const &renderInstanceId,
75 auto res = idInstanceMap.insert({renderInstanceId, sp});
77 TWeakPtr &wp = res.first->second;
78 if (
auto handle = wp.lock()) {
83 "An instance with renderInstanceId %s was already "
84 "registered previously.", renderInstanceId.c_str());
87 res.first->second = sp;
91 void UnregisterInstance(
92 std::string
const &renderInstanceId)
94 idInstanceMap.erase(renderInstanceId);
97 TSharedPtr GetInstance(
98 std::string
const &
id)
100 const auto it = idInstanceMap.find(
id);
101 if (it != idInstanceMap.end()) {
102 if (TSharedPtr sp = it->second.lock()) {
111 using _IdToInstanceMap = std::unordered_map<std::string, TWeakPtr>;
112 _IdToInstanceMap idInstanceMap;
121HasActiveRenderSettingsPrim(
122 const HdSceneIndexBaseRefPtr &si,
131GetCurrentFrame(
const HdSceneIndexBaseRefPtr &si,
double *frame);
137CameraUtilConformWindowPolicy
138ToConformWindowPolicy(
const TfToken &token);
147 const HdSceneIndexBaseRefPtr &si,
154HdContainerDataSourceHandle
155ConvertHdMaterialNetworkToHdMaterialNetworkSchema(
162HdContainerDataSourceHandle
163ConvertHdMaterialNetworkToHdMaterialSchema(
168PXR_NAMESPACE_CLOSE_SCOPE
Abstract interface to scene data.
A path value used to locate objects in layers or scenegraphs.
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
Token for efficient comparison, assignment, and hashing of known strings.
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
#define TF_WARN(...)
Issue a warning, but continue execution.
Describes a map from network type to network.