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 /* ** 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_NURBS_PATCH_SCHEMA_H
32 #define PXR_IMAGING_HD_NURBS_PATCH_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
37 
38 
40 
41 //-----------------------------------------------------------------------------
42 
43 #define HDNURBSPATCH_SCHEMA_TOKENS \
44  (nurbsPatch) \
45  (uVertexCount) \
46  (vVertexCount) \
47  (uOrder) \
48  (vOrder) \
49  (uKnots) \
50  (vKnots) \
51  (uForm) \
52  (vForm) \
53  (uRange) \
54  (vRange) \
55  (trimCurve) \
56  (orientation) \
57  (doubleSided) \
58  (open) \
59  (closed) \
60  (periodic) \
61  (leftHanded) \
62  (rightHanded) \
63 
64 TF_DECLARE_PUBLIC_TOKENS(HdNurbsPatchSchemaTokens, HD_API,
66 
67 //-----------------------------------------------------------------------------
68 
70 {
71 public:
72  HdNurbsPatchSchema(HdContainerDataSourceHandle container)
73  : HdSchema(container) {}
74 
75  //ACCESSORS
76 
77  HD_API
79  HD_API
81  HD_API
83  HD_API
85  HD_API
87  HD_API
89  HD_API
91  HD_API
93  HD_API
95  HD_API
97  HD_API
99  HD_API
101  HD_API
103 
104  // RETRIEVING AND CONSTRUCTING
105 
106  /// Builds a container data source which includes the provided child data
107  /// sources. Parameters with nullptr values are excluded. This is a
108  /// low-level interface. For cases in which it's desired to define
109  /// the container with a sparse set of child fields, the Builder class
110  /// is often more convenient and readable.
111  HD_API
112  static HdContainerDataSourceHandle
114  const HdIntDataSourceHandle &uVertexCount,
115  const HdIntDataSourceHandle &vVertexCount,
116  const HdIntDataSourceHandle &uOrder,
117  const HdIntDataSourceHandle &vOrder,
118  const HdDoubleArrayDataSourceHandle &uKnots,
119  const HdDoubleArrayDataSourceHandle &vKnots,
120  const HdTokenDataSourceHandle &uForm,
121  const HdTokenDataSourceHandle &vForm,
122  const HdVec2dDataSourceHandle &uRange,
123  const HdVec2dDataSourceHandle &vRange,
124  const HdContainerDataSourceHandle &trimCurve,
125  const HdTokenDataSourceHandle &orientation,
126  const HdBoolDataSourceHandle &doubleSided
127  );
128 
129  /// \class HdNurbsPatchSchema::Builder
130  ///
131  /// Utility class for setting sparse sets of child data source fields to be
132  /// filled as arguments into BuildRetained. Because all setter methods
133  /// return a reference to the instance, this can be used in the "builder
134  /// pattern" form.
135  class Builder
136  {
137  public:
138  HD_API
140  const HdIntDataSourceHandle &uVertexCount);
141  HD_API
143  const HdIntDataSourceHandle &vVertexCount);
144  HD_API
146  const HdIntDataSourceHandle &uOrder);
147  HD_API
149  const HdIntDataSourceHandle &vOrder);
150  HD_API
152  const HdDoubleArrayDataSourceHandle &uKnots);
153  HD_API
155  const HdDoubleArrayDataSourceHandle &vKnots);
156  HD_API
157  Builder &SetUForm(
158  const HdTokenDataSourceHandle &uForm);
159  HD_API
160  Builder &SetVForm(
161  const HdTokenDataSourceHandle &vForm);
162  HD_API
164  const HdVec2dDataSourceHandle &uRange);
165  HD_API
167  const HdVec2dDataSourceHandle &vRange);
168  HD_API
170  const HdContainerDataSourceHandle &trimCurve);
171  HD_API
173  const HdTokenDataSourceHandle &orientation);
174  HD_API
176  const HdBoolDataSourceHandle &doubleSided);
177 
178  /// Returns a container data source containing the members set thus far.
179  HD_API
180  HdContainerDataSourceHandle Build();
181 
182  private:
183  HdIntDataSourceHandle _uVertexCount;
184  HdIntDataSourceHandle _vVertexCount;
185  HdIntDataSourceHandle _uOrder;
186  HdIntDataSourceHandle _vOrder;
191  HdVec2dDataSourceHandle _uRange;
192  HdVec2dDataSourceHandle _vRange;
193  HdContainerDataSourceHandle _trimCurve;
194  HdTokenDataSourceHandle _orientation;
195  HdBoolDataSourceHandle _doubleSided;
196  };
197 
198  /// Retrieves a container data source with the schema's default name token
199  /// "nurbsPatch" from the parent container and constructs a
200  /// HdNurbsPatchSchema instance.
201  /// Because the requested container data source may not exist, the result
202  /// should be checked with IsDefined() or a bool comparison before use.
203  HD_API
205  const HdContainerDataSourceHandle &fromParentContainer);
206 
207  /// Returns a token where the container representing this schema is found in
208  /// a container by default.
209  HD_API
210  static const TfToken &GetSchemaToken();
211 
212  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
213  /// where the container representing this schema is found by default.
214  HD_API
215  static const HdDataSourceLocator &GetDefaultLocator();
216 
217  /// Returns token data source for use as form value.
218  /// Values of...
219  /// - HdNurbsPatchSchemaTokens->open
220  /// - HdNurbsPatchSchemaTokens->closed
221  /// - HdNurbsPatchSchemaTokens->periodic
222  /// ...will be stored statically and reused for future calls.
223  HD_API
225  const TfToken &form);
226 
227 };
228 
230 
231 #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
TF_DECLARE_PUBLIC_TOKENS(HdNurbsPatchSchemaTokens, HD_API, HDNURBSPATCH_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)
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:1441
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
HdNurbsPatchSchema(HdContainerDataSourceHandle container)
#define HDNURBSPATCH_SCHEMA_TOKENS
HdVec2dDataSource::Handle HdVec2dDataSourceHandle