HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primvarsSchema.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_PRIMVARS_SCHEMA_H
19 #define PXR_IMAGING_HD_PRIMVARS_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
25 
26 #include "pxr/imaging/hd/schema.h"
27 
28 // --(BEGIN CUSTOM CODE: Includes)--
29 // --(END CUSTOM CODE: Includes)--
30 
32 
33 // --(BEGIN CUSTOM CODE: Declares)--
34 // --(END CUSTOM CODE: Declares)--
35 
36 #define HD_PRIMVARS_SCHEMA_TOKENS \
37  (primvars) \
38  (points) \
39  (normals) \
40  (widths) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(HdPrimvarsSchemaTokens, HD_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 
48 class HdPrimvarsSchema : public HdSchema
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  HdPrimvarsSchema(HdContainerDataSourceHandle container)
55  : HdSchema(container) {}
56 
57  /// Retrieves a container data source with the schema's default name token
58  /// "primvars" from the parent container and constructs a
59  /// HdPrimvarsSchema instance.
60  /// Because the requested container data source may not exist, the result
61  /// should be checked with IsDefined() or a bool comparison before use.
62  HD_API
64  const HdContainerDataSourceHandle &fromParentContainer);
65 
66  /// @}
67 
68 // --(BEGIN CUSTOM CODE: Schema Methods)--
69 // --(END CUSTOM CODE: Schema Methods)--
70 
71  /// \name Member accessor
72  /// @{
73 
74  HD_API
76 
77  HD_API
78  HdPrimvarSchema GetPrimvar(const TfToken &name) const;
79 
80  /// @}
81 
82  /// \name Schema location
83  /// @{
84 
85  /// Returns a token where the container representing this schema is found in
86  /// a container by default.
87  HD_API
88  static const TfToken &GetSchemaToken();
89 
90  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
91  /// where the container representing this schema is found by default.
92  HD_API
93  static const HdDataSourceLocator &GetDefaultLocator();
94 
95  /// @}
96 
97  /// \name Data source locators for members
98  ///
99  /// The following methods return an HdDataSourceLocator (relative to the
100  /// prim-level data source) where the data source for a member can be found.
101  ///
102  /// This is often useful for checking intersection against the
103  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
104  /// @{
105 
106  /// Prim-level relative data source locator to locate points.
107  HD_API
108  static const HdDataSourceLocator &GetPointsLocator();
109 
110  /// Prim-level relative data source locator to locate normals.
111  HD_API
112  static const HdDataSourceLocator &GetNormalsLocator();
113 
114  /// Prim-level relative data source locator to locate widths.
115  HD_API
116  static const HdDataSourceLocator &GetWidthsLocator();
117  /// @}
118 
119  /// \name Schema construction
120  /// @{
121  HD_API
122  static HdContainerDataSourceHandle
124  size_t count,
125  const TfToken *names,
126  const HdDataSourceBaseHandle *values);
127 
128  /// @}
129 };
130 
132 
133 #endif
static HD_API HdContainerDataSourceHandle BuildRetained(size_t count, const TfToken *names, const HdDataSourceBaseHandle *values)
#define HD_PRIMVARS_SCHEMA_TOKENS
static HD_API const HdDataSourceLocator & GetPointsLocator()
Prim-level relative data source locator to locate points.
static HD_API const TfToken & GetSchemaToken()
#define HD_API
Definition: api.h:23
static HD_API const HdDataSourceLocator & GetNormalsLocator()
Prim-level relative data source locator to locate normals.
HD_API TfTokenVector GetPrimvarNames() const
HdPrimvarsSchema(HdContainerDataSourceHandle container)
TF_DECLARE_PUBLIC_TOKENS(HdPrimvarsSchemaTokens, HD_API, HD_PRIMVARS_SCHEMA_TOKENS)
Definition: token.h:70
HD_API HdPrimvarSchema GetPrimvar(const TfToken &name) const
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
GLuint const GLchar * name
Definition: glcorearb.h:786
static HD_API HdPrimvarsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
static HD_API const HdDataSourceLocator & GetWidthsLocator()
Prim-level relative data source locator to locate widths.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
GLint GLsizei count
Definition: glcorearb.h:405
static HD_API const HdDataSourceLocator & GetDefaultLocator()