velocityMotionResolvingSceneIndex.h
1 //
2 // Copyright 2024 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HDSI_VELOCITY_MOTION_RESOLVING_SCENE_INDEX_H
8 #define PXR_IMAGING_HDSI_VELOCITY_MOTION_RESOLVING_SCENE_INDEX_H
9 
10 #include "pxr/imaging/hd/dataSource.h"
11 #include "pxr/imaging/hd/filteringSceneIndex.h"
12 #include "pxr/imaging/hd/sceneIndex.h"
13 #include "pxr/imaging/hd/sceneIndexObserver.h"
14 #include "pxr/imaging/hdsi/api.h"
15 
16 #include "pxr/usd/sdf/path.h"
17 
18 #include "pxr/base/tf/debug.h"
21 #include "pxr/base/tf/token.h"
22 
23 #include "pxr/pxr.h"
24 
25 PXR_NAMESPACE_OPEN_SCOPE
26 
28  HDSI_VELOCITY_MOTION);
29 
30 #define HDSI_VELOCITY_MOTION_RESOLVING_SCENE_INDEX_TOKENS \
31  (disable) \
32  (enable) \
33  (ignore) \
34  (noAcceleration) \
35  (timeCodesPerSecond) \
36  ((velocityMotionMode, "__velocityMotionMode"))
37 
38 TF_DECLARE_PUBLIC_TOKENS(HdsiVelocityMotionResolvingSceneIndexTokens,
39  HDSI_API, HDSI_VELOCITY_MOTION_RESOLVING_SCENE_INDEX_TOKENS);
40 
42 
97 {
98 public:
99  HDSI_API
100  static HdsiVelocityMotionResolvingSceneIndexRefPtr
101  New(
102  const HdSceneIndexBaseRefPtr& inputSceneIndex,
103  const HdContainerDataSourceHandle& inputArgs = nullptr);
104 
105  HDSI_API
107  GetPrim(const SdfPath& primPath) const override;
108 
109  HDSI_API
110  SdfPathVector
111  GetChildPrimPaths(const SdfPath& primPath) const override;
112 
113  HDSI_API
114  static bool
115  PrimTypeSupportsVelocityMotion(const TfToken& primType);
116 
117 protected:
119  const HdSceneIndexBaseRefPtr& inputSceneIndex,
120  const HdContainerDataSourceHandle& inputArgs = nullptr);
121 
122  void
123  _PrimsAdded(
124  const HdSceneIndexBase& sender,
125  const HdSceneIndexObserver::AddedPrimEntries& entries) override;
126 
127  void
128  _PrimsRemoved(
129  const HdSceneIndexBase& sender,
130  const HdSceneIndexObserver::RemovedPrimEntries& entries) override;
131 
132  void
133  _PrimsDirtied(
134  const HdSceneIndexBase& sender,
135  const HdSceneIndexObserver::DirtiedPrimEntries& entries) override;
136 };
137 
138 PXR_NAMESPACE_CLOSE_SCOPE
139 
140 #endif // PXR_IMAGING_HDSI_VELOCITY_MOTION_RESOLVING_SCENE_INDEX_H
An abstract base class for a filtering scene index that observes a single input scene index.
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
Standard pointer typedefs.
Conditional debugging output class and macros.
TF_DEBUG_CODES(VDF_MUNG_BUFFER_LOCKING, VDF_SPARSE_INPUT_PATH_FINDER, VDF_SCHEDULING)
TF_DEBUG codes for Vdf execution.
Scene index that resolves velocity-based motion for all prims that support it.
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
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...