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
49 ///
50 class HdPrimvarsSchema : public HdSchema
51 {
52 public:
53  /// \name Schema retrieval
54  /// @{
55 
56  HdPrimvarsSchema(HdContainerDataSourceHandle container)
57  : HdSchema(container) {}
58 
59  /// Retrieves a container data source with the schema's default name token
60  /// "primvars" from the parent container and constructs a
61  /// HdPrimvarsSchema instance.
62  /// Because the requested container data source may not exist, the result
63  /// should be checked with IsDefined() or a bool comparison before use.
64  HD_API
66  const HdContainerDataSourceHandle &fromParentContainer);
67 
68  /// @}
69 
70 // --(BEGIN CUSTOM CODE: Schema Methods)--
71 // --(END CUSTOM CODE: Schema Methods)--
72 
73  /// \name Member accessor
74  /// @{
75 
76  HD_API
78 
79  HD_API
80  HdPrimvarSchema GetPrimvar(const TfToken &name) const;
81 
82  /// @}
83 
84  /// \name Schema location
85  /// @{
86 
87  /// Returns a token where the container representing this schema is found in
88  /// a container by default.
89  HD_API
90  static const TfToken &GetSchemaToken();
91 
92  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
93  /// where the container representing this schema is found by default.
94  HD_API
95  static const HdDataSourceLocator &GetDefaultLocator();
96 
97  /// @}
98 
99  /// \name Data source locators for members
100  ///
101  /// The following methods return an HdDataSourceLocator (relative to the
102  /// prim-level data source) where the data source for a member can be found.
103  ///
104  /// This is often useful for checking intersection against the
105  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
106  /// @{
107 
108  /// Prim-level relative data source locator to locate points.
109  HD_API
110  static const HdDataSourceLocator &GetPointsLocator();
111 
112  /// Prim-level relative data source locator to locate normals.
113  HD_API
114  static const HdDataSourceLocator &GetNormalsLocator();
115 
116  /// Prim-level relative data source locator to locate widths.
117  HD_API
118  static const HdDataSourceLocator &GetWidthsLocator();
119  /// @}
120 
121  /// \name Schema construction
122  /// @{
123  HD_API
124  static HdContainerDataSourceHandle
126  size_t count,
127  const TfToken *names,
128  const HdDataSourceBaseHandle *values);
129 
130  /// @}
131 };
132 
134 
135 #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 PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#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.
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()