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 : public HdSchema
53 {
54 public:
55  /// \name Schema retrieval
56  /// @{
57 
58  HdCapsuleSchema(HdContainerDataSourceHandle container)
59  : HdSchema(container) {}
60 
61  /// Retrieves a container data source with the schema's default name token
62  /// "capsule" from the parent container and constructs a
63  /// HdCapsuleSchema instance.
64  /// Because the requested container data source may not exist, the result
65  /// should be checked with IsDefined() or a bool comparison before use.
66  HD_API
68  const HdContainerDataSourceHandle &fromParentContainer);
69 
70  /// @}
71 
72 // --(BEGIN CUSTOM CODE: Schema Methods)--
73 // --(END CUSTOM CODE: Schema Methods)--
74 
75  /// \name Member accessor
76  /// @{
77 
78  HD_API
80 
81  HD_API
83 
84  HD_API
86 
87  HD_API
89 
90  HD_API
92 
93  /// @}
94 
95  /// \name Schema location
96  /// @{
97 
98  /// Returns a token where the container representing this schema is found in
99  /// a container by default.
100  HD_API
101  static const TfToken &GetSchemaToken();
102 
103  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
104  /// where the container representing this schema is found by default.
105  HD_API
106  static const HdDataSourceLocator &GetDefaultLocator();
107 
108  /// @}
109 
110  /// \name Schema construction
111  /// @{
112 
113  /// \deprecated Use Builder instead.
114  ///
115  /// Builds a container data source which includes the provided child data
116  /// sources. Parameters with nullptr values are excluded. This is a
117  /// low-level interface. For cases in which it's desired to define
118  /// the container with a sparse set of child fields, the Builder class
119  /// is often more convenient and readable.
120  HD_API
121  static HdContainerDataSourceHandle
124  const HdDoubleDataSourceHandle &radius,
125  const HdDoubleDataSourceHandle &radiusTop,
126  const HdDoubleDataSourceHandle &radiusBottom,
127  const HdTokenDataSourceHandle &axis
128  );
129 
130  /// \class HdCapsuleSchema::Builder
131  ///
132  /// Utility class for setting sparse sets of child data source fields to be
133  /// filled as arguments into BuildRetained. Because all setter methods
134  /// return a reference to the instance, this can be used in the "builder
135  /// pattern" form.
136  class Builder
137  {
138  public:
139  HD_API
142  HD_API
144  const HdDoubleDataSourceHandle &radius);
145  HD_API
147  const HdDoubleDataSourceHandle &radiusTop);
148  HD_API
150  const HdDoubleDataSourceHandle &radiusBottom);
151  HD_API
152  Builder &SetAxis(
153  const HdTokenDataSourceHandle &axis);
154 
155  /// Returns a container data source containing the members set thus far.
156  HD_API
157  HdContainerDataSourceHandle Build();
158 
159  private:
160  HdDoubleDataSourceHandle _height;
161  HdDoubleDataSourceHandle _radius;
162  HdDoubleDataSourceHandle _radiusTop;
163  HdDoubleDataSourceHandle _radiusBottom;
165 
166  };
167 
168  /// Returns token data source for use as axis value.
169  ///
170  /// The following values will be stored statically and reused for future
171  /// calls:
172  /// - HdCapsuleSchemaTokens->X
173  /// - HdCapsuleSchemaTokens->Y
174  /// - HdCapsuleSchemaTokens->Z
175  HD_API
177  const TfToken &axis);
178 
179  /// @}
180 };
181 
183 
184 #endif
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
HD_API HdDoubleDataSourceHandle GetRadius() const
HdCapsuleSchema(HdContainerDataSourceHandle container)
Definition: capsuleSchema.h:58
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API HdCapsuleSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
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)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#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