HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
prim.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 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_EXEC_ESF_PRIM_H
8 #define PXR_EXEC_ESF_PRIM_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/esf/api.h"
16 #include "pxr/exec/esf/object.h"
17 
18 #include "pxr/base/tf/token.h"
19 #include "pxr/base/tf/type.h"
20 #include "pxr/usd/sdf/path.h"
21 
23 
24 class EsfJournal;
25 class EsfPrim;
26 class EsfAttribute;
27 
28 /// Prim abstraction for scene adapter implementations.
29 ///
30 /// The prim abstraction closely resembles the read-only interface of UsdPrim.
31 ///
32 /// The public methods of this class are called by the exec network compiler.
33 /// Each method takes an argument of type EsfJournal* which captures the
34 /// conditions for recompilation.
35 ///
37 {
38 public:
39  ESF_API ~EsfPrimInterface() override;
40 
41  /// \see UsdPrim::GetAppliedSchemas
42  ESF_API const TfTokenVector &GetAppliedSchemas(EsfJournal *journal) const;
43 
44  /// \see UsdPrim::GetAttribute
45  ESF_API EsfAttribute GetAttribute(
46  const TfToken &attributeName,
47  EsfJournal *journal) const;
48 
49  /// \see UsdPrim::GetRelationship
50  ESF_API EsfRelationship GetRelationship(
51  const TfToken &relationshipName,
52  EsfJournal *journal) const;
53 
54  /// \see UsdPrim::GetParent
55  ESF_API EsfPrim GetParent(EsfJournal *journal) const;
56 
57  /// \see UsdPrim::GetPrimTypeInfo and \see UsdPrimTypeInfo::GetSchemaType
58  ESF_API TfType GetType(EsfJournal *journal) const;
59 
60  /// \see UsdPrim::IsPseudoRoot
61  virtual bool IsPseudoRoot() const = 0;
62 
63 protected:
64  /// This constructor may only be called by the scene adapter implementation.
66 
67 private:
68  // These methods must be implemented by the scene adapter implementation.
69  virtual const TfTokenVector &_GetAppliedSchemas() const = 0;
70  virtual EsfAttribute _GetAttribute(
71  const TfToken &attributeName) const = 0;
72  virtual EsfPrim _GetParent() const = 0;
73  virtual EsfRelationship _GetRelationship(
74  const TfToken &relationshipName) const = 0;
75  virtual TfType _GetType() const = 0;
76 };
77 
78 /// Holds an implementation of EsfPrimInterface in a fixed-size buffer.
79 ///
80 /// The buffer is large enough to fit an implementation that wraps a UsdPrim.
81 /// The size is specified as an integer literal to prevent introducing Usd as
82 /// a dependency.
83 ///
84 class EsfPrim : public EsfFixedSizePolymorphicHolder<EsfPrimInterface, 48>
85 {
86 public:
88 };
89 
91 
92 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define ESF_API_TYPE
Definition: api.h:26
Definition: prim.h:84
Definition: token.h:70
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:280
EsfPrimInterface(const SdfPath &path)
This constructor may only be called by the scene adapter implementation.
Definition: prim.h:65
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
#define ESF_API
Definition: api.h:25