HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extComputationPrimvarSchema.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_EXT_COMPUTATION_PRIMVAR_SCHEMA_H
19 #define PXR_IMAGING_HD_EXT_COMPUTATION_PRIMVAR_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_EXT_COMPUTATION_PRIMVAR_SCHEMA_TOKENS \
37  (interpolation) \
38  (role) \
39  (sourceComputation) \
40  (sourceComputationOutputName) \
41  (valueType) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdExtComputationPrimvarSchemaTokens, HD_API,
45 
46 //-----------------------------------------------------------------------------
47 
48 
50 {
51 public:
52  /// \name Schema retrieval
53  /// @{
54 
55  HdExtComputationPrimvarSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  /// @}
59 
60 // --(BEGIN CUSTOM CODE: Schema Methods)--
61 
62  // these return statically allocated instances for the common cases.
64  TfToken interpolation) {
66  }
67 
70  }
71 
72 // --(END CUSTOM CODE: Schema Methods)--
73 
74  /// \name Member accessor
75  /// @{
76 
77  HD_API
79 
80  HD_API
82 
83  HD_API
85 
86  HD_API
88 
89  HD_API
91 
92  /// @}
93 
94  /// \name Schema construction
95  /// @{
96 
97  /// \deprecated Use Builder instead.
98  ///
99  /// Builds a container data source which includes the provided child data
100  /// sources. Parameters with nullptr values are excluded. This is a
101  /// low-level interface. For cases in which it's desired to define
102  /// the container with a sparse set of child fields, the Builder class
103  /// is often more convenient and readable.
104  HD_API
105  static HdContainerDataSourceHandle
107  const HdTokenDataSourceHandle &interpolation,
108  const HdTokenDataSourceHandle &role,
109  const HdPathDataSourceHandle &sourceComputation,
110  const HdTokenDataSourceHandle &sourceComputationOutputName,
111  const HdTupleTypeDataSourceHandle &valueType
112  );
113 
114  /// \class HdExtComputationPrimvarSchema::Builder
115  ///
116  /// Utility class for setting sparse sets of child data source fields to be
117  /// filled as arguments into BuildRetained. Because all setter methods
118  /// return a reference to the instance, this can be used in the "builder
119  /// pattern" form.
120  class Builder
121  {
122  public:
123  HD_API
125  const HdTokenDataSourceHandle &interpolation);
126  HD_API
127  Builder &SetRole(
128  const HdTokenDataSourceHandle &role);
129  HD_API
131  const HdPathDataSourceHandle &sourceComputation);
132  HD_API
134  const HdTokenDataSourceHandle &sourceComputationOutputName);
135  HD_API
137  const HdTupleTypeDataSourceHandle &valueType);
138 
139  /// Returns a container data source containing the members set thus far.
140  HD_API
141  HdContainerDataSourceHandle Build();
142 
143  private:
144  HdTokenDataSourceHandle _interpolation;
146  HdPathDataSourceHandle _sourceComputation;
147  HdTokenDataSourceHandle _sourceComputationOutputName;
148  HdTupleTypeDataSourceHandle _valueType;
149 
150  };
151 
152  /// @}
153 };
154 
156 
157 #endif
HdTupleTypeDataSource::Handle HdTupleTypeDataSourceHandle
HD_API Builder & SetInterpolation(const HdTokenDataSourceHandle &interpolation)
static HD_API HdTokenDataSourceHandle BuildInterpolationDataSource(const TfToken &interpolation)
HD_API Builder & SetSourceComputation(const HdPathDataSourceHandle &sourceComputation)
#define HD_API
Definition: api.h:23
HD_API Builder & SetValueType(const HdTupleTypeDataSourceHandle &valueType)
HD_API HdTokenDataSourceHandle GetInterpolation() const
HD_API HdTupleTypeDataSourceHandle GetValueType() const
#define HD_EXT_COMPUTATION_PRIMVAR_SCHEMA_TOKENS
HD_API HdPathDataSourceHandle GetSourceComputation() const
Definition: token.h:70
HD_API HdTokenDataSourceHandle GetSourceComputationOutputName() const
HD_API HdTokenDataSourceHandle GetRole() const
HdExtComputationPrimvarSchema(HdContainerDataSourceHandle container)
static HD_API HdTokenDataSourceHandle BuildRoleDataSource(const TfToken &role)
HD_API Builder & SetRole(const HdTokenDataSourceHandle &role)
static HdTokenDataSourceHandle BuildRoleDataSource(TfToken role)
static HdTokenDataSourceHandle BuildInterpolationDataSource(TfToken interpolation)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &interpolation, const HdTokenDataSourceHandle &role, const HdPathDataSourceHandle &sourceComputation, const HdTokenDataSourceHandle &sourceComputationOutputName, const HdTupleTypeDataSourceHandle &valueType)
HD_API Builder & SetSourceComputationOutputName(const HdTokenDataSourceHandle &sourceComputationOutputName)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdPathDataSource::Handle HdPathDataSourceHandle
TF_DECLARE_PUBLIC_TOKENS(HdExtComputationPrimvarSchemaTokens, HD_API, HD_EXT_COMPUTATION_PRIMVAR_SCHEMA_TOKENS)
HdTokenDataSource::Handle HdTokenDataSourceHandle