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 2021 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_EXT_COMPUTATION_PRIMVAR_SCHEMA_H
29 #define PXR_IMAGING_HD_EXT_COMPUTATION_PRIMVAR_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
34 
35 
37 
38 //-----------------------------------------------------------------------------
39 
40 #define HDEXTCOMPUTATIONPRIMVAR_SCHEMA_TOKENS \
41  (interpolation) \
42  (role) \
43  (sourceComputation) \
44  (sourceComputationOutputName) \
45  (valueType) \
46 
47 TF_DECLARE_PUBLIC_TOKENS(HdExtComputationPrimvarSchemaTokens, HD_API,
49 
50 //-----------------------------------------------------------------------------
51 
53 {
54 public:
55  HdExtComputationPrimvarSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  //ACCESSORS
59 
60  HD_API
62  HD_API
64  HD_API
66  HD_API
68  HD_API
70 
71  // RETRIEVING AND CONSTRUCTING
72 
73  /// Builds a container data source which includes the provided child data
74  /// sources. Parameters with nullptr values are excluded. This is a
75  /// low-level interface. For cases in which it's desired to define
76  /// the container with a sparse set of child fields, the Builder class
77  /// is often more convenient and readable.
78  HD_API
79  static HdContainerDataSourceHandle
81  const HdTokenDataSourceHandle &interpolation,
82  const HdTokenDataSourceHandle &role,
83  const HdPathDataSourceHandle &sourceComputation,
84  const HdTokenDataSourceHandle &sourceComputationOutputName,
85  const HdTupleTypeDataSourceHandle &valueType
86  );
87 
88  /// \class HdExtComputationPrimvarSchema::Builder
89  ///
90  /// Utility class for setting sparse sets of child data source fields to be
91  /// filled as arguments into BuildRetained. Because all setter methods
92  /// return a reference to the instance, this can be used in the "builder
93  /// pattern" form.
94  class Builder
95  {
96  public:
97  HD_API
99  const HdTokenDataSourceHandle &interpolation);
100  HD_API
101  Builder &SetRole(
102  const HdTokenDataSourceHandle &role);
103  HD_API
105  const HdPathDataSourceHandle &sourceComputation);
106  HD_API
108  const HdTokenDataSourceHandle &sourceComputationOutputName);
109  HD_API
111  const HdTupleTypeDataSourceHandle &valueType);
112 
113  /// Returns a container data source containing the members set thus far.
114  HD_API
115  HdContainerDataSourceHandle Build();
116 
117  private:
118  HdTokenDataSourceHandle _interpolation;
120  HdPathDataSourceHandle _sourceComputation;
121  HdTokenDataSourceHandle _sourceComputationOutputName;
122  HdTupleTypeDataSourceHandle _valueType;
123  };
124 
125  // these return statically allocated instances for the common cases.
127  TfToken interpolation) {
128  return HdPrimvarSchema::BuildInterpolationDataSource(interpolation);
129  }
130 
133  }
134 
135 
136 };
137 
139 
140 #endif
HdTupleTypeDataSource::Handle HdTupleTypeDataSourceHandle
HD_API Builder & SetInterpolation(const HdTokenDataSourceHandle &interpolation)
static HD_API HdTokenDataSourceHandle BuildInterpolationDataSource(const TfToken &interpolation)
#define HDEXTCOMPUTATIONPRIMVAR_SCHEMA_TOKENS
HD_API Builder & SetSourceComputation(const HdPathDataSourceHandle &sourceComputation)
#define HD_API
Definition: api.h:40
HD_API Builder & SetValueType(const HdTupleTypeDataSourceHandle &valueType)
HD_API HdTupleTypeDataSourceHandle GetValueType()
HD_API HdPathDataSourceHandle GetSourceComputation()
TF_DECLARE_PUBLIC_TOKENS(HdExtComputationPrimvarSchemaTokens, HD_API, HDEXTCOMPUTATIONPRIMVAR_SCHEMA_TOKENS)
Definition: token.h:87
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 HdTokenDataSourceHandle GetRole()
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:1441
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdTokenDataSourceHandle GetSourceComputationOutputName()
HD_API HdTokenDataSourceHandle GetInterpolation()
HdPathDataSource::Handle HdPathDataSourceHandle
HdTokenDataSource::Handle HdTokenDataSourceHandle