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 
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  HdNurbsCurvesSchema(HdContainerDataSourceHandle container)
55  : HdSchema(container) {}
56 
57  /// Retrieves a container data source with the schema's default name token
58  /// "nurbsCurves" from the parent container and constructs a
59  /// HdNurbsCurvesSchema instance.
60  /// Because the requested container data source may not exist, the result
61  /// should be checked with IsDefined() or a bool comparison before use.
62  HD_API
64  const HdContainerDataSourceHandle &fromParentContainer);
65 
66  /// @}
67 
68 // --(BEGIN CUSTOM CODE: Schema Methods)--
69 // --(END CUSTOM CODE: Schema Methods)--
70 
71  /// \name Member accessor
72  /// @{
73 
74  HD_API
76 
77  HD_API
79 
80  HD_API
82 
83  HD_API
85 
86  /// @}
87 
88  /// \name Schema location
89  /// @{
90 
91  /// Returns a token where the container representing this schema is found in
92  /// a container by default.
93  HD_API
94  static const TfToken &GetSchemaToken();
95 
96  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
97  /// where the container representing this schema is found by default.
98  HD_API
99  static const HdDataSourceLocator &GetDefaultLocator();
100 
101  /// @}
102 
103  /// \name Schema construction
104  /// @{
105 
106  /// \deprecated Use Builder instead.
107  ///
108  /// Builds a container data source which includes the provided child data
109  /// sources. Parameters with nullptr values are excluded. This is a
110  /// low-level interface. For cases in which it's desired to define
111  /// the container with a sparse set of child fields, the Builder class
112  /// is often more convenient and readable.
113  HD_API
114  static HdContainerDataSourceHandle
116  const HdIntArrayDataSourceHandle &curveVertexCounts,
118  const HdDoubleArrayDataSourceHandle &knots,
119  const HdVec2dArrayDataSourceHandle &ranges
120  );
121 
122  /// \class HdNurbsCurvesSchema::Builder
123  ///
124  /// Utility class for setting sparse sets of child data source fields to be
125  /// filled as arguments into BuildRetained. Because all setter methods
126  /// return a reference to the instance, this can be used in the "builder
127  /// pattern" form.
128  class Builder
129  {
130  public:
131  HD_API
133  const HdIntArrayDataSourceHandle &curveVertexCounts);
134  HD_API
135  Builder &SetOrder(
137  HD_API
138  Builder &SetKnots(
139  const HdDoubleArrayDataSourceHandle &knots);
140  HD_API
142  const HdVec2dArrayDataSourceHandle &ranges);
143 
144  /// Returns a container data source containing the members set thus far.
145  HD_API
146  HdContainerDataSourceHandle Build();
147 
148  private:
149  HdIntArrayDataSourceHandle _curveVertexCounts;
153 
154  };
155 
156  /// @}
157 };
158 
160 
161 #endif
HD_API HdVec2dArrayDataSourceHandle GetRanges() const
static HD_API const HdDataSourceLocator & GetDefaultLocator()
static HD_API const TfToken & GetSchemaToken()
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)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdDoubleArrayDataSourceHandle GetKnots() const
HD_API Builder & SetCurveVertexCounts(const HdIntArrayDataSourceHandle &curveVertexCounts)