HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
capsuleSchema.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_CAPSULE_SCHEMA_H
19 #define PXR_IMAGING_HD_CAPSULE_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_CAPSULE_SCHEMA_TOKENS \
36  (capsule) \
37  (height) \
38  (radius) \
39  (radiusTop) \
40  (radiusBottom) \
41  (axis) \
42  (X) \
43  (Y) \
44  (Z) \
45 
46 TF_DECLARE_PUBLIC_TOKENS(HdCapsuleSchemaTokens, HD_API,
48 
49 //-----------------------------------------------------------------------------
50 
51 
52 /// \class HdCapsuleSchema
53 ///
54 class HdCapsuleSchema : public HdSchema
55 {
56 public:
57  /// \name Schema retrieval
58  /// @{
59 
60  HdCapsuleSchema(HdContainerDataSourceHandle container)
61  : HdSchema(container) {}
62 
63  /// Retrieves a container data source with the schema's default name token
64  /// "capsule" from the parent container and constructs a
65  /// HdCapsuleSchema instance.
66  /// Because the requested container data source may not exist, the result
67  /// should be checked with IsDefined() or a bool comparison before use.
68  HD_API
70  const HdContainerDataSourceHandle &fromParentContainer);
71 
72  /// @}
73 
74 // --(BEGIN CUSTOM CODE: Schema Methods)--
75 // --(END CUSTOM CODE: Schema Methods)--
76 
77  /// \name Member accessor
78  /// @{
79 
80  HD_API
82 
83  /// Deprecated. Only use if no radiusTop or radiusBottom data source.
84  /// Comes from UsdGeom Capsule which has been deprecated in favor of
85  /// Capsule_1.
86  HD_API
88 
89  HD_API
91 
92  HD_API
94 
95  HD_API
97 
98  /// @}
99 
100  /// \name Schema location
101  /// @{
102 
103  /// Returns a token where the container representing this schema is found in
104  /// a container by default.
105  HD_API
106  static const TfToken &GetSchemaToken();
107 
108  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
109  /// where the container representing this schema is found by default.
110  HD_API
111  static const HdDataSourceLocator &GetDefaultLocator();
112 
113  /// @}
114 
115  /// \name Schema construction
116  /// @{
117 
118  /// \deprecated Use Builder instead.
119  ///
120  /// Builds a container data source which includes the provided child data
121  /// sources. Parameters with nullptr values are excluded. This is a
122  /// low-level interface. For cases in which it's desired to define
123  /// the container with a sparse set of child fields, the Builder class
124  /// is often more convenient and readable.
125  HD_API
126  static HdContainerDataSourceHandle
129  const HdDoubleDataSourceHandle &radius,
130  const HdDoubleDataSourceHandle &radiusTop,
131  const HdDoubleDataSourceHandle &radiusBottom,
132  const HdTokenDataSourceHandle &axis
133  );
134 
135  /// \class HdCapsuleSchema::Builder
136  ///
137  /// Utility class for setting sparse sets of child data source fields to be
138  /// filled as arguments into BuildRetained. Because all setter methods
139  /// return a reference to the instance, this can be used in the "builder
140  /// pattern" form.
141  class Builder
142  {
143  public:
144  HD_API
147  HD_API
149  const HdDoubleDataSourceHandle &radius);
150  HD_API
152  const HdDoubleDataSourceHandle &radiusTop);
153  HD_API
155  const HdDoubleDataSourceHandle &radiusBottom);
156  HD_API
157  Builder &SetAxis(
158  const HdTokenDataSourceHandle &axis);
159 
160  /// Returns a container data source containing the members set thus far.
161  HD_API
162  HdContainerDataSourceHandle Build();
163 
164  private:
165  HdDoubleDataSourceHandle _height;
166  HdDoubleDataSourceHandle _radius;
167  HdDoubleDataSourceHandle _radiusTop;
168  HdDoubleDataSourceHandle _radiusBottom;
170 
171  };
172 
173  /// Returns token data source for use as axis value.
174  ///
175  /// The following values will be stored statically and reused for future
176  /// calls:
177  /// - HdCapsuleSchemaTokens->X
178  /// - HdCapsuleSchemaTokens->Y
179  /// - HdCapsuleSchemaTokens->Z
180  HD_API
182  const TfToken &axis);
183 
184  /// @}
185 };
186 
188 
189 #endif
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
HD_API HdDoubleDataSourceHandle GetRadius() const
HdCapsuleSchema(HdContainerDataSourceHandle container)
Definition: capsuleSchema.h:60
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API HdCapsuleSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
static HD_API const HdDataSourceLocator & GetDefaultLocator()
#define HD_API
Definition: api.h:23
HD_API Builder & SetRadius(const HdDoubleDataSourceHandle &radius)
static HD_API HdTokenDataSourceHandle BuildAxisDataSource(const TfToken &axis)
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(HdCapsuleSchemaTokens, HD_API, HD_CAPSULE_SCHEMA_TOKENS)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdDoubleDataSourceHandle &height, const HdDoubleDataSourceHandle &radius, const HdDoubleDataSourceHandle &radiusTop, const HdDoubleDataSourceHandle &radiusBottom, const HdTokenDataSourceHandle &axis)
HD_API Builder & SetAxis(const HdTokenDataSourceHandle &axis)
HD_API HdDoubleDataSourceHandle GetRadiusTop() const
HD_API Builder & SetHeight(const HdDoubleDataSourceHandle &height)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdDoubleDataSourceHandle GetRadiusBottom() const
HD_API Builder & SetRadiusBottom(const HdDoubleDataSourceHandle &radiusBottom)
#define HD_CAPSULE_SCHEMA_TOKENS
Definition: capsuleSchema.h:35
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetRadiusTop(const HdDoubleDataSourceHandle &radiusTop)
HD_API HdDoubleDataSourceHandle GetHeight() const
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdTokenDataSourceHandle GetAxis() const