HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geomSubsetSchema.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_GEOM_SUBSET_SCHEMA_H
19 #define PXR_IMAGING_HD_GEOM_SUBSET_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_GEOM_SUBSET_SCHEMA_TOKENS \
36  (geomSubset) \
37  (type) \
38  (indices) \
39  (typeFaceSet) \
40  (typePointSet) \
41  (typeCurveSet) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdGeomSubsetSchemaTokens, HD_API,
45 
46 //-----------------------------------------------------------------------------
47 
48 
49 /// \class HdGeomSubsetSchema
50 ///
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  HdGeomSubsetSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  /// Retrieves a container data source with the schema's default name token
61  /// "geomSubset" from the parent container and constructs a
62  /// HdGeomSubsetSchema instance.
63  /// Because the requested container data source may not exist, the result
64  /// should be checked with IsDefined() or a bool comparison before use.
65  HD_API
67  const HdContainerDataSourceHandle &fromParentContainer);
68 
69  /// @}
70 
71 // --(BEGIN CUSTOM CODE: Schema Methods)--
72 // --(END CUSTOM CODE: Schema Methods)--
73 
74  /// \name Member accessor
75  /// @{
76 
77  HD_API
79 
80  HD_API
82 
83  /// @}
84 
85  /// \name Schema location
86  /// @{
87 
88  /// Returns a token where the container representing this schema is found in
89  /// a container by default.
90  HD_API
91  static const TfToken &GetSchemaToken();
92 
93  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
94  /// where the container representing this schema is found by default.
95  HD_API
96  static const HdDataSourceLocator &GetDefaultLocator();
97 
98  /// @}
99 
100  /// \name Schema construction
101  /// @{
102 
103  /// \deprecated Use Builder instead.
104  ///
105  /// Builds a container data source which includes the provided child data
106  /// sources. Parameters with nullptr values are excluded. This is a
107  /// low-level interface. For cases in which it's desired to define
108  /// the container with a sparse set of child fields, the Builder class
109  /// is often more convenient and readable.
110  HD_API
111  static HdContainerDataSourceHandle
115  );
116 
117  /// \class HdGeomSubsetSchema::Builder
118  ///
119  /// Utility class for setting sparse sets of child data source fields to be
120  /// filled as arguments into BuildRetained. Because all setter methods
121  /// return a reference to the instance, this can be used in the "builder
122  /// pattern" form.
123  class Builder
124  {
125  public:
126  HD_API
127  Builder &SetType(
129  HD_API
132 
133  /// Returns a container data source containing the members set thus far.
134  HD_API
135  HdContainerDataSourceHandle Build();
136 
137  private:
140 
141  };
142 
143  /// Returns token data source for use as type value.
144  ///
145  /// The following values will be stored statically and reused for future
146  /// calls:
147  /// - HdGeomSubsetSchemaTokens->typeFaceSet
148  /// - HdGeomSubsetSchemaTokens->typePointSet
149  /// - HdGeomSubsetSchemaTokens->typeCurveSet
150  HD_API
152  const TfToken &type);
153 
154  /// @}
155 };
156 
158 
159 #endif
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
HD_API HdIntArrayDataSourceHandle GetIndices() const
TF_DECLARE_PUBLIC_TOKENS(HdGeomSubsetSchemaTokens, HD_API, HD_GEOM_SUBSET_SCHEMA_TOKENS)
#define HD_GEOM_SUBSET_SCHEMA_TOKENS
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
Definition: token.h:70
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
HD_API Builder & SetType(const HdTokenDataSourceHandle &type)
HD_API HdTokenDataSourceHandle GetType() const
static HD_API HdGeomSubsetSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &type, const HdIntArrayDataSourceHandle &indices)
static HD_API const TfToken & GetSchemaToken()
static HD_API HdTokenDataSourceHandle BuildTypeDataSource(const TfToken &type)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetIndices(const HdIntArrayDataSourceHandle &indices)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdTokenDataSource::Handle HdTokenDataSourceHandle
HdGeomSubsetSchema(HdContainerDataSourceHandle container)