24 #ifndef PXR_IMAGING_HD_SCENE_INDEX_H 25 #define PXR_IMAGING_HD_SCENE_INDEX_H 30 #include <unordered_map> 35 #include "pxr/usd/sdf/path.h" 37 #include "pxr/imaging/hd/api.h" 38 #include "pxr/imaging/hd/dataSource.h" 39 #include "pxr/imaging/hd/dataSourceLocator.h" 40 #include "pxr/imaging/hd/sceneIndexObserver.h" 42 PXR_NAMESPACE_OPEN_SCOPE
52 HdContainerDataSourceHandle dataSource;
80 void AddObserver(
const HdSceneIndexObserverPtr &observer);
117 GetPrim(primPath).dataSource, locator);
161 using _ObserverSet = std::set<HdSceneIndexObserverPtr>;
162 _ObserverSet _observers;
193 const std::string &name, HdSceneIndexBasePtr instance);
207 using _NamedInstanceMap =
208 std::unordered_map<std::string, HdSceneIndexBasePtr>;
210 _NamedInstanceMap _namedInstances;
213 PXR_NAMESPACE_CLOSE_SCOPE
215 #endif // PXR_IMAGING_HD_SCENE_INDEX_H Manage a single instance of an object.
virtual HdDataSourceBaseHandle Get(const TfToken &name)=0
Returns the child datasource of the given name.
Manage a single instance of an object (see.
virtual HdSceneIndexPrim GetPrim(const SdfPath &primPath) const =0
Returns a pair of (prim type, datasource) for the object at primPath.
Standard pointer typedefs.
Enable a concrete base class for use with TfRefPtr.
Small struct representing a 'prim' in the Hydra scene index.
Token for efficient comparison, assignment, and hashing of known strings.
virtual SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const =0
Returns the paths of all scene index prims located immediately below primPath.
Represents an object that can identify the location of a data source.
A registry containing named instances of Hydra indexes.
HD_API void RegisterNamedSceneIndex(const std::string &name, HdSceneIndexBasePtr instance)
Registers an instance of a scene index with a given name.
Abstract interface to scene data.
HD_API bool _IsObserved() const
Returns whether the scene index has any registered observers; this information can be used to skip wo...
HdDataSourceBaseHandle GetDataSource(const SdfPath &primPath, const HdDataSourceLocator &locator) const
A convenience function: look up the object at primPath, and if successful return the datasource at lo...
A path value used to locate objects in layers or scenegraphs.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
HD_API void RemoveObserver(const HdSceneIndexObserverPtr &observer)
Removes an observer from this scene index; the given observer will no longer be forwarded notices.
HD_API void _SendPrimsAdded(const HdSceneIndexObserver::AddedPrimEntries &entries)
Notify attached observers of prims added to the scene.
HD_API void _SendPrimsDirtied(const HdSceneIndexObserver::DirtiedPrimEntries &entries)
Notify attached observers of datasource invalidations from the scene.
HD_API void AddObserver(const HdSceneIndexObserverPtr &observer)
Adds an observer to this scene index.
static HD_API HdSceneIndexNameRegistry & GetInstance()
Returns the singleton-instance of this registry.
HD_API HdSceneIndexBaseRefPtr GetNamedSceneIndex(const std::string &name)
Returns the scene index that was registered with the given name.
HD_API std::vector< std::string > GetRegisteredNames()
Returns the names of all registered scene indexes.
Enable a concrete base class for use with TfWeakPtr.
HD_API void _SendPrimsRemoved(const HdSceneIndexObserver::RemovedPrimEntries &entries)
Notify attached observers of prims removed from the scene.