HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nurbsCurvesSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_IMAGING_HD_NURBS_CURVES_SCHEMA_H
19 #define PXR_IMAGING_HD_NURBS_CURVES_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_NURBS_CURVES_SCHEMA_TOKENS \
36  (nurbsCurves) \
37  (curveVertexCounts) \
38  (order) \
39  (knots) \
40  (ranges) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(HdNurbsCurvesSchemaTokens, HD_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 
48 /// \class HdNurbsCurvesSchema
49 ///
51 {
52 public:
53  /// \name Schema retrieval
54  /// @{
55 
56  HdNurbsCurvesSchema(HdContainerDataSourceHandle container)
57  : HdSchema(container) {}
58 
59  /// Retrieves a container data source with the schema's default name token
60  /// "nurbsCurves" from the parent container and constructs a
61  /// HdNurbsCurvesSchema instance.
62  /// Because the requested container data source may not exist, the result
63  /// should be checked with IsDefined() or a bool comparison before use.
64  HD_API
66  const HdContainerDataSourceHandle &fromParentContainer);
67 
68  /// @}
69 
70 // --(BEGIN CUSTOM CODE: Schema Methods)--
71 // --(END CUSTOM CODE: Schema Methods)--
72 
73  /// \name Member accessor
74  /// @{
75 
76  HD_API
78 
79  HD_API
81 
82  HD_API
84 
85  HD_API
87 
88  /// @}
89 
90  /// \name Schema location
91  /// @{
92 
93  /// Returns a token where the container representing this schema is found in
94  /// a container by default.
95  HD_API
96  static const TfToken &GetSchemaToken();
97 
98  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
99  /// where the container representing this schema is found by default.
100  HD_API
101  static const HdDataSourceLocator &GetDefaultLocator();
102 
103  /// @}
104 
105  /// \name Schema construction
106  /// @{
107 
108  /// \deprecated Use Builder instead.
109  ///
110  /// Builds a container data source which includes the provided child data
111  /// sources. Parameters with nullptr values are excluded. This is a
112  /// low-level interface. For cases in which it's desired to define
113  /// the container with a sparse set of child fields, the Builder class
114  /// is often more convenient and readable.
115  HD_API
116  static HdContainerDataSourceHandle
118  const HdIntArrayDataSourceHandle &curveVertexCounts,
120  const HdDoubleArrayDataSourceHandle &knots,
121  const HdVec2dArrayDataSourceHandle &ranges
122  );
123 
124  /// \class HdNurbsCurvesSchema::Builder
125  ///
126  /// Utility class for setting sparse sets of child data source fields to be
127  /// filled as arguments into BuildRetained. Because all setter methods
128  /// return a reference to the instance, this can be used in the "builder
129  /// pattern" form.
130  class Builder
131  {
132  public:
133  HD_API
135  const HdIntArrayDataSourceHandle &curveVertexCounts);
136  HD_API
137  Builder &SetOrder(
139  HD_API
140  Builder &SetKnots(
141  const HdDoubleArrayDataSourceHandle &knots);
142  HD_API
144  const HdVec2dArrayDataSourceHandle &ranges);
145 
146  /// Returns a container data source containing the members set thus far.
147  HD_API
148  HdContainerDataSourceHandle Build();
149 
150  private:
151  HdIntArrayDataSourceHandle _curveVertexCounts;
155 
156  };
157 
158  /// @}
159 };
160 
162 
163 #endif
HD_API HdVec2dArrayDataSourceHandle GetRanges() const
static HD_API const HdDataSourceLocator & GetDefaultLocator()
static HD_API const TfToken & GetSchemaToken()
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
TF_DECLARE_PUBLIC_TOKENS(HdNurbsCurvesSchemaTokens, HD_API, HD_NURBS_CURVES_SCHEMA_TOKENS)
#define HD_API
Definition: api.h:23
HD_API Builder & SetRanges(const HdVec2dArrayDataSourceHandle &ranges)
HD_API Builder & SetKnots(const HdDoubleArrayDataSourceHandle &knots)
HdNurbsCurvesSchema(HdContainerDataSourceHandle container)
HdDoubleArrayDataSource::Handle HdDoubleArrayDataSourceHandle
HD_API HdIntArrayDataSourceHandle GetCurveVertexCounts() const
Definition: token.h:70
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
#define HD_NURBS_CURVES_SCHEMA_TOKENS
HD_API Builder & SetOrder(const HdIntArrayDataSourceHandle &order)
GLdouble GLdouble GLint GLint order
Definition: glad.h:2676
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdIntArrayDataSourceHandle GetOrder() const
HdVec2dArrayDataSource::Handle HdVec2dArrayDataSourceHandle
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntArrayDataSourceHandle &curveVertexCounts, const HdIntArrayDataSourceHandle &order, const HdDoubleArrayDataSourceHandle &knots, const HdVec2dArrayDataSourceHandle &ranges)
static HD_API HdNurbsCurvesSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdDoubleArrayDataSourceHandle GetKnots() const
HD_API Builder & SetCurveVertexCounts(const HdIntArrayDataSourceHandle &curveVertexCounts)