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 
50 {
51 public:
52  /// \name Schema retrieval
53  /// @{
54 
55  HdGeomSubsetSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  /// Retrieves a container data source with the schema's default name token
59  /// "geomSubset" from the parent container and constructs a
60  /// HdGeomSubsetSchema instance.
61  /// Because the requested container data source may not exist, the result
62  /// should be checked with IsDefined() or a bool comparison before use.
63  HD_API
65  const HdContainerDataSourceHandle &fromParentContainer);
66 
67  /// @}
68 
69 // --(BEGIN CUSTOM CODE: Schema Methods)--
70 // --(END CUSTOM CODE: Schema Methods)--
71 
72  /// \name Member accessor
73  /// @{
74 
75  HD_API
77 
78  HD_API
80 
81  /// @}
82 
83  /// \name Schema location
84  /// @{
85 
86  /// Returns a token where the container representing this schema is found in
87  /// a container by default.
88  HD_API
89  static const TfToken &GetSchemaToken();
90 
91  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
92  /// where the container representing this schema is found by default.
93  HD_API
94  static const HdDataSourceLocator &GetDefaultLocator();
95 
96  /// @}
97 
98  /// \name Schema construction
99  /// @{
100 
101  /// \deprecated Use Builder instead.
102  ///
103  /// Builds a container data source which includes the provided child data
104  /// sources. Parameters with nullptr values are excluded. This is a
105  /// low-level interface. For cases in which it's desired to define
106  /// the container with a sparse set of child fields, the Builder class
107  /// is often more convenient and readable.
108  HD_API
109  static HdContainerDataSourceHandle
113  );
114 
115  /// \class HdGeomSubsetSchema::Builder
116  ///
117  /// Utility class for setting sparse sets of child data source fields to be
118  /// filled as arguments into BuildRetained. Because all setter methods
119  /// return a reference to the instance, this can be used in the "builder
120  /// pattern" form.
121  class Builder
122  {
123  public:
124  HD_API
125  Builder &SetType(
127  HD_API
130 
131  /// Returns a container data source containing the members set thus far.
132  HD_API
133  HdContainerDataSourceHandle Build();
134 
135  private:
138 
139  };
140 
141  /// Returns token data source for use as type value.
142  ///
143  /// The following values will be stored statically and reused for future
144  /// calls:
145  /// - HdGeomSubsetSchemaTokens->typeFaceSet
146  /// - HdGeomSubsetSchemaTokens->typePointSet
147  /// - HdGeomSubsetSchemaTokens->typeCurveSet
148  HD_API
150  const TfToken &type);
151 
152  /// @}
153 };
154 
156 
157 #endif
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
#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
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
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)