HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
subdivisionTagsSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 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 
26 /* ************************************************************************** */
27 /* ** This file is generated by a script. Do not edit directly. Edit ** */
28 /* ** defs.py or the (*)Schema.template.h files to make changes. ** */
29 /* ************************************************************************** */
30 
31 #ifndef PXR_IMAGING_HD_SUBDIVISION_TAGS_SCHEMA_H
32 #define PXR_IMAGING_HD_SUBDIVISION_TAGS_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDSUBDIVISIONTAGS_SCHEMA_TOKENS \
43  (subdivisionTags) \
44  (faceVaryingLinearInterpolation) \
45  (interpolateBoundary) \
46  (triangleSubdivisionRule) \
47  (cornerIndices) \
48  (cornerSharpnesses) \
49  (creaseIndices) \
50  (creaseLengths) \
51  (creaseSharpnesses) \
52 
53 TF_DECLARE_PUBLIC_TOKENS(HdSubdivisionTagsSchemaTokens, HD_API,
55 
56 //-----------------------------------------------------------------------------
57 
59 {
60 public:
61  HdSubdivisionTagsSchema(HdContainerDataSourceHandle container)
62  : HdSchema(container) {}
63 
64  //ACCESSORS
65 
66  HD_API
68  HD_API
70  HD_API
72  HD_API
74  HD_API
76  HD_API
78  HD_API
80  HD_API
82 
83  // RETRIEVING AND CONSTRUCTING
84 
85  /// Builds a container data source which includes the provided child data
86  /// sources. Parameters with nullptr values are excluded. This is a
87  /// low-level interface. For cases in which it's desired to define
88  /// the container with a sparse set of child fields, the Builder class
89  /// is often more convenient and readable.
90  HD_API
91  static HdContainerDataSourceHandle
93  const HdTokenDataSourceHandle &faceVaryingLinearInterpolation,
94  const HdTokenDataSourceHandle &interpolateBoundary,
95  const HdTokenDataSourceHandle &triangleSubdivisionRule,
96  const HdIntArrayDataSourceHandle &cornerIndices,
97  const HdFloatArrayDataSourceHandle &cornerSharpnesses,
98  const HdIntArrayDataSourceHandle &creaseIndices,
99  const HdIntArrayDataSourceHandle &creaseLengths,
100  const HdFloatArrayDataSourceHandle &creaseSharpnesses
101  );
102 
103  /// \class HdSubdivisionTagsSchema::Builder
104  ///
105  /// Utility class for setting sparse sets of child data source fields to be
106  /// filled as arguments into BuildRetained. Because all setter methods
107  /// return a reference to the instance, this can be used in the "builder
108  /// pattern" form.
109  class Builder
110  {
111  public:
112  HD_API
114  const HdTokenDataSourceHandle &faceVaryingLinearInterpolation);
115  HD_API
117  const HdTokenDataSourceHandle &interpolateBoundary);
118  HD_API
120  const HdTokenDataSourceHandle &triangleSubdivisionRule);
121  HD_API
123  const HdIntArrayDataSourceHandle &cornerIndices);
124  HD_API
126  const HdFloatArrayDataSourceHandle &cornerSharpnesses);
127  HD_API
129  const HdIntArrayDataSourceHandle &creaseIndices);
130  HD_API
132  const HdIntArrayDataSourceHandle &creaseLengths);
133  HD_API
135  const HdFloatArrayDataSourceHandle &creaseSharpnesses);
136 
137  /// Returns a container data source containing the members set thus far.
138  HD_API
139  HdContainerDataSourceHandle Build();
140 
141  private:
142  HdTokenDataSourceHandle _faceVaryingLinearInterpolation;
143  HdTokenDataSourceHandle _interpolateBoundary;
144  HdTokenDataSourceHandle _triangleSubdivisionRule;
145  HdIntArrayDataSourceHandle _cornerIndices;
146  HdFloatArrayDataSourceHandle _cornerSharpnesses;
147  HdIntArrayDataSourceHandle _creaseIndices;
148  HdIntArrayDataSourceHandle _creaseLengths;
149  HdFloatArrayDataSourceHandle _creaseSharpnesses;
150  };
151 
152  /// Retrieves a container data source with the schema's default name token
153  /// "subdivisionTags" from the parent container and constructs a
154  /// HdSubdivisionTagsSchema instance.
155  /// Because the requested container data source may not exist, the result
156  /// should be checked with IsDefined() or a bool comparison before use.
157  HD_API
159  const HdContainerDataSourceHandle &fromParentContainer);
160 
161  /// Returns a token where the container representing this schema is found in
162  /// a container by default.
163  HD_API
164  static const TfToken &GetSchemaToken();
165 
166  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
167  /// where the container representing this schema is found by default.
168  HD_API
169  static const HdDataSourceLocator &GetDefaultLocator();
170 
171 };
172 
174 
175 #endif
HD_API HdTokenDataSourceHandle GetInterpolateBoundary()
#define HDSUBDIVISIONTAGS_SCHEMA_TOKENS
HD_API HdTokenDataSourceHandle GetFaceVaryingLinearInterpolation()
static HD_API const TfToken & GetSchemaToken()
#define HD_API
Definition: api.h:40
HD_API Builder & SetCreaseLengths(const HdIntArrayDataSourceHandle &creaseLengths)
HD_API Builder & SetCornerSharpnesses(const HdFloatArrayDataSourceHandle &cornerSharpnesses)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API HdFloatArrayDataSourceHandle GetCreaseSharpnesses()
HD_API Builder & SetCornerIndices(const HdIntArrayDataSourceHandle &cornerIndices)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &faceVaryingLinearInterpolation, const HdTokenDataSourceHandle &interpolateBoundary, const HdTokenDataSourceHandle &triangleSubdivisionRule, const HdIntArrayDataSourceHandle &cornerIndices, const HdFloatArrayDataSourceHandle &cornerSharpnesses, const HdIntArrayDataSourceHandle &creaseIndices, const HdIntArrayDataSourceHandle &creaseLengths, const HdFloatArrayDataSourceHandle &creaseSharpnesses)
Definition: token.h:87
HD_API HdFloatArrayDataSourceHandle GetCornerSharpnesses()
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
HD_API Builder & SetCreaseIndices(const HdIntArrayDataSourceHandle &creaseIndices)
HD_API Builder & SetCreaseSharpnesses(const HdFloatArrayDataSourceHandle &creaseSharpnesses)
HD_API Builder & SetTriangleSubdivisionRule(const HdTokenDataSourceHandle &triangleSubdivisionRule)
TF_DECLARE_PUBLIC_TOKENS(HdSubdivisionTagsSchemaTokens, HD_API, HDSUBDIVISIONTAGS_SCHEMA_TOKENS)
HdFloatArrayDataSource::Handle HdFloatArrayDataSourceHandle
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HD_API HdTokenDataSourceHandle GetTriangleSubdivisionRule()
HD_API Builder & SetInterpolateBoundary(const HdTokenDataSourceHandle &interpolateBoundary)
HD_API HdIntArrayDataSourceHandle GetCreaseLengths()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetFaceVaryingLinearInterpolation(const HdTokenDataSourceHandle &faceVaryingLinearInterpolation)
HD_API HdIntArrayDataSourceHandle GetCreaseIndices()
static HD_API HdSubdivisionTagsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdIntArrayDataSourceHandle GetCornerIndices()
HdSubdivisionTagsSchema(HdContainerDataSourceHandle container)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.