HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nurbsPatchSchema.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 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_NURBS_PATCH_SCHEMA_H
36 #define PXR_IMAGING_HD_NURBS_PATCH_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
41 
42 
43 // --(BEGIN CUSTOM CODE: Includes)--
44 // --(END CUSTOM CODE: Includes)--
45 
47 
48 //-----------------------------------------------------------------------------
49 
50 // --(BEGIN CUSTOM CODE: Declares)--
51 // --(END CUSTOM CODE: Declares)--
52 
53 //-----------------------------------------------------------------------------
54 
55 #define HD_NURBS_PATCH_SCHEMA_TOKENS \
56  (nurbsPatch) \
57  (uVertexCount) \
58  (vVertexCount) \
59  (uOrder) \
60  (vOrder) \
61  (uKnots) \
62  (vKnots) \
63  (uForm) \
64  (vForm) \
65  (uRange) \
66  (vRange) \
67  (trimCurve) \
68  (orientation) \
69  (doubleSided) \
70  (open) \
71  (closed) \
72  (periodic) \
73  (leftHanded) \
74  (rightHanded) \
75 
76 TF_DECLARE_PUBLIC_TOKENS(HdNurbsPatchSchemaTokens, HD_API,
78 
79 //-----------------------------------------------------------------------------
81 {
82 public:
83  HdNurbsPatchSchema(HdContainerDataSourceHandle container)
84  : HdSchema(container) {}
85 
86 // --(BEGIN CUSTOM CODE: Schema Methods)--
87 // --(END CUSTOM CODE: Schema Methods)--
88 
89  //ACCESSORS
90 
91 
92  HD_API
94 
95  HD_API
97 
98  HD_API
100 
101  HD_API
103 
104  HD_API
106 
107  HD_API
109 
110  HD_API
112 
113  HD_API
115 
116  HD_API
118 
119  HD_API
121 
122  HD_API
124 
125  HD_API
127 
128  HD_API
130 
131  // RETRIEVING AND CONSTRUCTING
132 
133  /// Builds a container data source which includes the provided child data
134  /// sources. Parameters with nullptr values are excluded. This is a
135  /// low-level interface. For cases in which it's desired to define
136  /// the container with a sparse set of child fields, the Builder class
137  /// is often more convenient and readable.
138  HD_API
139  static HdContainerDataSourceHandle
141  const HdIntDataSourceHandle &uVertexCount,
142  const HdIntDataSourceHandle &vVertexCount,
143  const HdIntDataSourceHandle &uOrder,
144  const HdIntDataSourceHandle &vOrder,
145  const HdDoubleArrayDataSourceHandle &uKnots,
146  const HdDoubleArrayDataSourceHandle &vKnots,
147  const HdTokenDataSourceHandle &uForm,
148  const HdTokenDataSourceHandle &vForm,
149  const HdVec2dDataSourceHandle &uRange,
150  const HdVec2dDataSourceHandle &vRange,
151  const HdContainerDataSourceHandle &trimCurve,
152  const HdTokenDataSourceHandle &orientation,
153  const HdBoolDataSourceHandle &doubleSided
154  );
155 
156  /// \class HdNurbsPatchSchema::Builder
157  ///
158  /// Utility class for setting sparse sets of child data source fields to be
159  /// filled as arguments into BuildRetained. Because all setter methods
160  /// return a reference to the instance, this can be used in the "builder
161  /// pattern" form.
162  class Builder
163  {
164  public:
165  HD_API
167  const HdIntDataSourceHandle &uVertexCount);
168  HD_API
170  const HdIntDataSourceHandle &vVertexCount);
171  HD_API
173  const HdIntDataSourceHandle &uOrder);
174  HD_API
176  const HdIntDataSourceHandle &vOrder);
177  HD_API
179  const HdDoubleArrayDataSourceHandle &uKnots);
180  HD_API
182  const HdDoubleArrayDataSourceHandle &vKnots);
183  HD_API
184  Builder &SetUForm(
185  const HdTokenDataSourceHandle &uForm);
186  HD_API
187  Builder &SetVForm(
188  const HdTokenDataSourceHandle &vForm);
189  HD_API
191  const HdVec2dDataSourceHandle &uRange);
192  HD_API
194  const HdVec2dDataSourceHandle &vRange);
195  HD_API
197  const HdContainerDataSourceHandle &trimCurve);
198  HD_API
200  const HdTokenDataSourceHandle &orientation);
201  HD_API
203  const HdBoolDataSourceHandle &doubleSided);
204 
205  /// Returns a container data source containing the members set thus far.
206  HD_API
207  HdContainerDataSourceHandle Build();
208 
209  private:
210  HdIntDataSourceHandle _uVertexCount;
211  HdIntDataSourceHandle _vVertexCount;
212  HdIntDataSourceHandle _uOrder;
213  HdIntDataSourceHandle _vOrder;
218  HdVec2dDataSourceHandle _uRange;
219  HdVec2dDataSourceHandle _vRange;
220  HdContainerDataSourceHandle _trimCurve;
221  HdTokenDataSourceHandle _orientation;
222  HdBoolDataSourceHandle _doubleSided;
223  };
224 
225  /// Retrieves a container data source with the schema's default name token
226  /// "nurbsPatch" from the parent container and constructs a
227  /// HdNurbsPatchSchema instance.
228  /// Because the requested container data source may not exist, the result
229  /// should be checked with IsDefined() or a bool comparison before use.
230  HD_API
232  const HdContainerDataSourceHandle &fromParentContainer);
233 
234  /// Returns a token where the container representing this schema is found in
235  /// a container by default.
236  HD_API
237  static const TfToken &GetSchemaToken();
238 
239  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
240  /// where the container representing this schema is found by default.
241  HD_API
242  static const HdDataSourceLocator &GetDefaultLocator();
243 
244  /// Returns token data source for use as form value.
245  /// Values of...
246  /// - HdNurbsPatchSchemaTokens->open
247  /// - HdNurbsPatchSchemaTokens->closed
248  /// - HdNurbsPatchSchemaTokens->periodic
249  /// ...will be stored statically and reused for future calls.
250  HD_API
252  const TfToken &form);
253  /// Returns token data source for use as orientation value.
254  /// Values of...
255  /// - HdNurbsPatchSchemaTokens->leftHanded
256  /// - HdNurbsPatchSchemaTokens->rightHanded
257  /// ...will be stored statically and reused for future calls.
258  HD_API
260  const TfToken &orientation);
261 
262 };
263 
265 
266 #endif
HD_API Builder & SetDoubleSided(const HdBoolDataSourceHandle &doubleSided)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetUVertexCount(const HdIntDataSourceHandle &uVertexCount)
HD_API HdDoubleArrayDataSourceHandle GetVKnots()
HD_API Builder & SetOrientation(const HdTokenDataSourceHandle &orientation)
HD_API HdTokenDataSourceHandle GetUForm()
HD_API Builder & SetUForm(const HdTokenDataSourceHandle &uForm)
#define HD_API
Definition: api.h:40
#define HD_NURBS_PATCH_SCHEMA_TOKENS
HD_API Builder & SetVOrder(const HdIntDataSourceHandle &vOrder)
static HD_API HdTokenDataSourceHandle BuildFormDataSource(const TfToken &form)
HD_API Builder & SetVVertexCount(const HdIntDataSourceHandle &vVertexCount)
HD_API HdDoubleArrayDataSourceHandle GetUKnots()
HdDoubleArrayDataSource::Handle HdDoubleArrayDataSourceHandle
HD_API HdNurbsPatchTrimCurveSchema GetTrimCurve()
HD_API Builder & SetUKnots(const HdDoubleArrayDataSourceHandle &uKnots)
static HD_API HdTokenDataSourceHandle BuildOrientationDataSource(const TfToken &orientation)
HD_API Builder & SetURange(const HdVec2dDataSourceHandle &uRange)
HD_API Builder & SetVRange(const HdVec2dDataSourceHandle &vRange)
Definition: token.h:87
HD_API HdIntDataSourceHandle GetVVertexCount()
HD_API HdIntDataSourceHandle GetUVertexCount()
HD_API Builder & SetUOrder(const HdIntDataSourceHandle &uOrder)
HD_API HdIntDataSourceHandle GetVOrder()
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdVec2dDataSourceHandle GetVRange()
HD_API Builder & SetVKnots(const HdDoubleArrayDataSourceHandle &vKnots)
HD_API HdTokenDataSourceHandle GetVForm()
static HD_API HdNurbsPatchSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdVec2dDataSourceHandle GetURange()
HD_API Builder & SetVForm(const HdTokenDataSourceHandle &vForm)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
static HD_API const TfToken & GetSchemaToken()
HD_API HdTokenDataSourceHandle GetOrientation()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdBoolDataSourceHandle GetDoubleSided()
HD_API Builder & SetTrimCurve(const HdContainerDataSourceHandle &trimCurve)
HdIntDataSource::Handle HdIntDataSourceHandle
HD_API HdIntDataSourceHandle GetUOrder()
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntDataSourceHandle &uVertexCount, const HdIntDataSourceHandle &vVertexCount, const HdIntDataSourceHandle &uOrder, const HdIntDataSourceHandle &vOrder, const HdDoubleArrayDataSourceHandle &uKnots, const HdDoubleArrayDataSourceHandle &vKnots, const HdTokenDataSourceHandle &uForm, const HdTokenDataSourceHandle &vForm, const HdVec2dDataSourceHandle &uRange, const HdVec2dDataSourceHandle &vRange, const HdContainerDataSourceHandle &trimCurve, const HdTokenDataSourceHandle &orientation, const HdBoolDataSourceHandle &doubleSided)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HdTokenDataSource::Handle HdTokenDataSourceHandle
TF_DECLARE_PUBLIC_TOKENS(HdNurbsPatchSchemaTokens, HD_API, HD_NURBS_PATCH_SCHEMA_TOKENS)
HdNurbsPatchSchema(HdContainerDataSourceHandle container)
HdVec2dDataSource::Handle HdVec2dDataSourceHandle