HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primOriginSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_IMAGING_HD_PRIM_ORIGIN_SCHEMA_H
19 #define PXR_IMAGING_HD_PRIM_ORIGIN_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_PRIM_ORIGIN_SCHEMA_TOKENS \
36  (primOrigin) \
37  (scenePath) \
38 
39 TF_DECLARE_PUBLIC_TOKENS(HdPrimOriginSchemaTokens, HD_API,
41 
42 //-----------------------------------------------------------------------------
43 
44 
46 {
47 public:
48  /// \name Schema retrieval
49  /// @{
50 
51  HdPrimOriginSchema(HdContainerDataSourceHandle container)
52  : HdSchema(container) {}
53 
54  /// Retrieves a container data source with the schema's default name token
55  /// "primOrigin" from the parent container and constructs a
56  /// HdPrimOriginSchema instance.
57  /// Because the requested container data source may not exist, the result
58  /// should be checked with IsDefined() or a bool comparison before use.
59  HD_API
61  const HdContainerDataSourceHandle &fromParentContainer);
62 
63  /// @}
64 
65 // --(BEGIN CUSTOM CODE: Schema Methods)--
66  /// Wraps an SdfPath so that it is not affected by the
67  /// prefixing scene index.
68  class OriginPath {
69  public:
71  : _path(path)
72  {
73  }
74 
75  const SdfPath &GetPath() const { return _path; }
76 
77  bool operator==(const OriginPath &other) const {
78  return _path == other._path;
79  }
80 
81  private:
82  HD_API
83  friend std::ostream &operator <<(std::ostream &stream,
84  OriginPath const &p);
85 
86  SdfPath _path;
87  };
88 
90 
91  /// Extracts SdfPath from container that was added via
92  /// OriginPathDataSource.
93  HD_API SdfPath GetOriginPath(const TfToken &name) const;
94 
95 // --(END CUSTOM CODE: Schema Methods)--
96 
97  /// \name Member accessor
98  /// @{
99 
100  /// @}
101 
102  /// \name Schema location
103  /// @{
104 
105  /// Returns a token where the container representing this schema is found in
106  /// a container by default.
107  HD_API
108  static const TfToken &GetSchemaToken();
109 
110  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
111  /// where the container representing this schema is found by default.
112  HD_API
113  static const HdDataSourceLocator &GetDefaultLocator();
114 
115  /// @}
116 
117  /// \name Data source locators for members
118  ///
119  /// The following methods return an HdDataSourceLocator (relative to the
120  /// prim-level data source) where the data source for a member can be found.
121  ///
122  /// This is often useful for checking intersection against the
123  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
124  /// @{
125 
126  /// Additional prim-level relative data source locator to locate
127  /// scenePath.
128  HD_API
130  /// @}
131 
132  /// \name Schema construction
133  /// @{
134 
135  /// @}
136 };
137 
139 
140 #endif
GLuint GLuint stream
Definition: glcorearb.h:1832
bool operator==(const OriginPath &other) const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
OriginPath(const SdfPath &path)
#define HD_API
Definition: api.h:23
HdPrimOriginSchema(HdContainerDataSourceHandle container)
HD_API SdfPath GetOriginPath(const TfToken &name) const
static HD_API const HdDataSourceLocator & GetDefaultLocator()
static HD_API const TfToken & GetSchemaToken()
Definition: token.h:70
const SdfPath & GetPath() const
TF_DECLARE_PUBLIC_TOKENS(HdPrimOriginSchemaTokens, HD_API, HD_PRIM_ORIGIN_SCHEMA_TOKENS)
GLuint const GLchar * name
Definition: glcorearb.h:786
Definition: path.h:273
HD_API friend std::ostream & operator<<(std::ostream &stream, OriginPath const &p)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static HD_API HdPrimOriginSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API const HdDataSourceLocator & GetScenePathLocator()
#define HD_PRIM_ORIGIN_SCHEMA_TOKENS