Loading...
Searching...
No Matches
meshLightResolvingSceneIndex.h
1//
2// Copyright 2022 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6#ifndef EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H
7#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H
8
9#include "pxr/pxr.h"
10#include "pxr/imaging/hd/filteringSceneIndex.h"
11
12
13PXR_NAMESPACE_OPEN_SCOPE
14
15TF_DECLARE_REF_PTRS(HdPrmanMeshLightResolvingSceneIndex);
16
17// Pixar-only, Prman-specific Hydra scene index to resolve mesh lights.
18class HdPrmanMeshLightResolvingSceneIndex :
20{
21public:
22 static HdPrmanMeshLightResolvingSceneIndexRefPtr
23 New(const HdSceneIndexBaseRefPtr& inputSceneIndex);
24
25 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
26 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
27
28protected:
29 HdPrmanMeshLightResolvingSceneIndex(
30 const HdSceneIndexBaseRefPtr& inputSceneIndex);
31 ~HdPrmanMeshLightResolvingSceneIndex();
32
33 void _PrimsAdded(
34 const HdSceneIndexBase &sender,
35 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
36
37 void _PrimsRemoved(
38 const HdSceneIndexBase &sender,
39 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
40
41 void _PrimsDirtied(
42 const HdSceneIndexBase &sender,
43 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
44
45private:
46 void _AddMeshLight(
47 const SdfPath& primPath,
48 const HdSceneIndexPrim& prim,
50
51 void _RemoveMeshLight(
52 const SdfPath& primPath,
54
55private:
56 std::unordered_map<SdfPath, bool, SdfPath::Hash> _meshLights;
57};
58
59PXR_NAMESPACE_CLOSE_SCOPE
60
61#endif //EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_MESHLIGHT_RESOLVING_SCENE_INDEX_H
Abstract interface to scene data.
Definition: sceneIndex.h:54
virtual SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const =0
Returns the paths of all scene index prims located immediately below primPath.
virtual HdSceneIndexPrim GetPrim(const SdfPath &primPath) const =0
Returns a pair of (prim type, datasource).
An abstract base class for a filtering scene index that observes a single input scene index.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:35