HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
implicitSurfaceSceneIndex.h
Go to the documentation of this file.
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"
12 
14 
15 #define HDSI_IMPLICIT_SURFACE_SCENE_INDEX_TOKENS \
16  (toMesh) \
17  (axisToTransform) \
18 
19 TF_DECLARE_PUBLIC_TOKENS(HdsiImplicitSurfaceSceneIndexTokens, HDSI_API,
21 
23 
24 ///
25 /// \class HdsiImplicitSurfaceSceneIndex
26 ///
27 /// The implicit surface scene index can be "configured" to either generate
28 /// the mesh for a given implicit primitive (for renderers that don't
29 /// natively support it) or overload the transform to account for a different
30 /// "spine" axis (relevant for cones, capsules and cylinders) for those that
31 /// do.
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 
73 
74 #endif //PXR_IMAGING_HDSI_IMPLICIT_SURFACE_SCENE_INDEX_H
static HDSI_API HdsiImplicitSurfaceSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex, const HdContainerDataSourceHandle &inputArgs)
void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
Definition: token.h:70
std::vector< class SdfPath > SdfPathVector
TF_DECLARE_PUBLIC_TOKENS(HdsiImplicitSurfaceSceneIndexTokens, HDSI_API, HDSI_IMPLICIT_SURFACE_SCENE_INDEX_TOKENS)
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Definition: path.h:273
#define HDSI_API
Definition: api.h:23
void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
TF_DECLARE_REF_PTRS(HdsiImplicitSurfaceSceneIndex)
void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
HdsiImplicitSurfaceSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex, const HdContainerDataSourceHandle &inputArgs)
#define HDSI_IMPLICIT_SURFACE_SCENE_INDEX_TOKENS