HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nurbsPatchTrimCurveSchema.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_TRIM_CURVE_SCHEMA_H
32 #define PXR_IMAGING_HD_NURBS_PATCH_TRIM_CURVE_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDNURBSPATCHTRIMCURVE_SCHEMA_TOKENS \
43  (trimCurve) \
44  (counts) \
45  (orders) \
46  (vertexCounts) \
47  (knots) \
48  (ranges) \
49  (points) \
50 
51 TF_DECLARE_PUBLIC_TOKENS(HdNurbsPatchTrimCurveSchemaTokens, HD_API,
53 
54 //-----------------------------------------------------------------------------
55 
57 {
58 public:
59  HdNurbsPatchTrimCurveSchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  //ACCESSORS
63 
64  HD_API
66  HD_API
68  HD_API
70  HD_API
72  HD_API
74  HD_API
76 
77  // RETRIEVING AND CONSTRUCTING
78 
79  /// Builds a container data source which includes the provided child data
80  /// sources. Parameters with nullptr values are excluded. This is a
81  /// low-level interface. For cases in which it's desired to define
82  /// the container with a sparse set of child fields, the Builder class
83  /// is often more convenient and readable.
84  HD_API
85  static HdContainerDataSourceHandle
87  const HdIntArrayDataSourceHandle &counts,
88  const HdIntArrayDataSourceHandle &orders,
89  const HdIntArrayDataSourceHandle &vertexCounts,
90  const HdDoubleArrayDataSourceHandle &knots,
91  const HdVec2dArrayDataSourceHandle &ranges,
93  );
94 
95  /// \class HdNurbsPatchTrimCurveSchema::Builder
96  ///
97  /// Utility class for setting sparse sets of child data source fields to be
98  /// filled as arguments into BuildRetained. Because all setter methods
99  /// return a reference to the instance, this can be used in the "builder
100  /// pattern" form.
101  class Builder
102  {
103  public:
104  HD_API
106  const HdIntArrayDataSourceHandle &counts);
107  HD_API
109  const HdIntArrayDataSourceHandle &orders);
110  HD_API
112  const HdIntArrayDataSourceHandle &vertexCounts);
113  HD_API
114  Builder &SetKnots(
115  const HdDoubleArrayDataSourceHandle &knots);
116  HD_API
118  const HdVec2dArrayDataSourceHandle &ranges);
119  HD_API
122 
123  /// Returns a container data source containing the members set thus far.
124  HD_API
125  HdContainerDataSourceHandle Build();
126 
127  private:
130  HdIntArrayDataSourceHandle _vertexCounts;
134  };
135 
136  /// Retrieves a container data source with the schema's default name token
137  /// "trimCurve" from the parent container and constructs a
138  /// HdNurbsPatchTrimCurveSchema instance.
139  /// Because the requested container data source may not exist, the result
140  /// should be checked with IsDefined() or a bool comparison before use.
141  HD_API
143  const HdContainerDataSourceHandle &fromParentContainer);
144 
145  /// Returns a token where the container representing this schema is found in
146  /// a container by default.
147  HD_API
148  static const TfToken &GetSchemaToken();
149 
150  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
151  /// where the container representing this schema is found by default.
152  HD_API
153  static const HdDataSourceLocator &GetDefaultLocator();
154 
155 };
156 
158 
159 #endif
HD_API HdDoubleArrayDataSourceHandle GetKnots()
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetVertexCounts(const HdIntArrayDataSourceHandle &vertexCounts)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntArrayDataSourceHandle &counts, const HdIntArrayDataSourceHandle &orders, const HdIntArrayDataSourceHandle &vertexCounts, const HdDoubleArrayDataSourceHandle &knots, const HdVec2dArrayDataSourceHandle &ranges, const HdVec3dArrayDataSourceHandle &points)
HD_API HdIntArrayDataSourceHandle GetOrders()
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
HdVec3dArrayDataSource::Handle HdVec3dArrayDataSourceHandle
#define HD_API
Definition: api.h:40
HD_API HdIntArrayDataSourceHandle GetCounts()
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetKnots(const HdDoubleArrayDataSourceHandle &knots)
HdDoubleArrayDataSource::Handle HdDoubleArrayDataSourceHandle
Definition: token.h:87
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
HD_API Builder & SetOrders(const HdIntArrayDataSourceHandle &orders)
TF_DECLARE_PUBLIC_TOKENS(HdNurbsPatchTrimCurveSchemaTokens, HD_API, HDNURBSPATCHTRIMCURVE_SCHEMA_TOKENS)
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetRanges(const HdVec2dArrayDataSourceHandle &ranges)
HD_API HdVec2dArrayDataSourceHandle GetRanges()
HdVec2dArrayDataSource::Handle HdVec2dArrayDataSourceHandle
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HD_API Builder & SetCounts(const HdIntArrayDataSourceHandle &counts)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
static HD_API HdNurbsPatchTrimCurveSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdVec3dArrayDataSourceHandle GetPoints()
HdNurbsPatchTrimCurveSchema(HdContainerDataSourceHandle container)
HD_API HdIntArrayDataSourceHandle GetVertexCounts()
HD_API Builder & SetPoints(const HdVec3dArrayDataSourceHandle &points)
#define HDNURBSPATCHTRIMCURVE_SCHEMA_TOKENS