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 
45 /// \class HdPrimOriginSchema
46 ///
48 {
49 public:
50  /// \name Schema retrieval
51  /// @{
52 
53  HdPrimOriginSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  /// Retrieves a container data source with the schema's default name token
57  /// "primOrigin" from the parent container and constructs a
58  /// HdPrimOriginSchema instance.
59  /// Because the requested container data source may not exist, the result
60  /// should be checked with IsDefined() or a bool comparison before use.
61  HD_API
63  const HdContainerDataSourceHandle &fromParentContainer);
64 
65  /// @}
66 
67 // --(BEGIN CUSTOM CODE: Schema Methods)--
68  /// Wraps an SdfPath so that it is not affected by the
69  /// prefixing scene index.
70  class OriginPath {
71  public:
73  : _path(path)
74  {
75  }
76 
77  const SdfPath &GetPath() const { return _path; }
78 
79  bool operator==(const OriginPath &other) const {
80  return _path == other._path;
81  }
82 
83  private:
84  HD_API
85  friend std::ostream &operator <<(std::ostream &stream,
86  OriginPath const &p);
87 
88  SdfPath _path;
89  };
90 
92 
93  /// Extracts SdfPath from container that was added via
94  /// OriginPathDataSource.
95  HD_API SdfPath GetOriginPath(const TfToken &name) const;
96 
97 // --(END CUSTOM CODE: Schema Methods)--
98 
99  /// \name Member accessor
100  /// @{
101 
102  /// @}
103 
104  /// \name Schema location
105  /// @{
106 
107  /// Returns a token where the container representing this schema is found in
108  /// a container by default.
109  HD_API
110  static const TfToken &GetSchemaToken();
111 
112  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
113  /// where the container representing this schema is found by default.
114  HD_API
115  static const HdDataSourceLocator &GetDefaultLocator();
116 
117  /// @}
118 
119  /// \name Data source locators for members
120  ///
121  /// The following methods return an HdDataSourceLocator (relative to the
122  /// prim-level data source) where the data source for a member can be found.
123  ///
124  /// This is often useful for checking intersection against the
125  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
126  /// @{
127 
128  /// Additional prim-level relative data source locator to locate
129  /// scenePath.
130  HD_API
132  /// @}
133 
134  /// \name Schema construction
135  /// @{
136 
137  /// @}
138 };
139 
141 
142 #endif
GLuint GLuint stream
Definition: glcorearb.h:1832
bool operator==(const OriginPath &other) const
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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:280
HD_API friend std::ostream & operator<<(std::ostream &stream, OriginPath const &p)
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