implicitSurfaceSceneIndex.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 PXR_IMAGING_HDSI_IMPLICIT_SURFACE_SCENE_INDEX_H
7 #define PXR_IMAGING_HDSI_IMPLICIT_SURFACE_SCENE_INDEX_H
8 
9 #include "pxr/pxr.h"
10 #include "pxr/imaging/hdsi/api.h"
11 #include "pxr/imaging/hd/filteringSceneIndex.h"
12 
13 PXR_NAMESPACE_OPEN_SCOPE
14 
15 #define HDSI_IMPLICIT_SURFACE_SCENE_INDEX_TOKENS \
16  (toMesh) \
17  (axisToTransform) \
18 
19 TF_DECLARE_PUBLIC_TOKENS(HdsiImplicitSurfaceSceneIndexTokens, HDSI_API,
20  HDSI_IMPLICIT_SURFACE_SCENE_INDEX_TOKENS);
21 
23 
34 {
35 public:
36  HDSI_API
37  static HdsiImplicitSurfaceSceneIndexRefPtr
38  New(const HdSceneIndexBaseRefPtr &inputSceneIndex,
39  const HdContainerDataSourceHandle &inputArgs);
40 
41  HDSI_API
42  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
43  HDSI_API
44  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
45 
46 protected:
48  const HdSceneIndexBaseRefPtr &inputSceneIndex,
49  const HdContainerDataSourceHandle &inputArgs);
50 
51  void _PrimsAdded(
52  const HdSceneIndexBase &sender,
53  const HdSceneIndexObserver::AddedPrimEntries &entries) override;
54 
55  void _PrimsRemoved(
56  const HdSceneIndexBase &sender,
57  const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
58 
59  void _PrimsDirtied(
60  const HdSceneIndexBase &sender,
61  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
62 
63 private:
64  const TfToken _capsuleMode;
65  const TfToken _coneMode;
66  const TfToken _cubeMode;
67  const TfToken _cylinderMode;
68  const TfToken _planeMode;
69  const TfToken _sphereMode;
70 };
71 
72 PXR_NAMESPACE_CLOSE_SCOPE
73 
74 #endif //PXR_IMAGING_HDSI_IMPLICIT_SURFACE_SCENE_INDEX_H
An abstract base class for a filtering scene index that observes a single input scene index.
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:35
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:92
Abstract interface to scene data.
Definition: sceneIndex.h:54
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
The implicit surface scene index can be "configured" to either generate the mesh for a given implicit...
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).