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 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 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_CAPSULE_SCHEMA_H
36 #define PXR_IMAGING_HD_CAPSULE_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
40 #include "pxr/imaging/hd/schema.h"
41 
42 // --(BEGIN CUSTOM CODE: Includes)--
43 // --(END CUSTOM CODE: Includes)--
44 
46 
47 //-----------------------------------------------------------------------------
48 
49 // --(BEGIN CUSTOM CODE: Declares)--
50 // --(END CUSTOM CODE: Declares)--
51 
52 //-----------------------------------------------------------------------------
53 
54 #define HD_CAPSULE_SCHEMA_TOKENS \
55  (capsule) \
56  (height) \
57  (radius) \
58  (radiusTop) \
59  (radiusBottom) \
60  (axis) \
61  (X) \
62  (Y) \
63  (Z) \
64 
65 TF_DECLARE_PUBLIC_TOKENS(HdCapsuleSchemaTokens, HD_API,
67 
68 //-----------------------------------------------------------------------------
69 class HdCapsuleSchema : public HdSchema
70 {
71 public:
72  HdCapsuleSchema(HdContainerDataSourceHandle container)
73  : HdSchema(container) {}
74 
75 // --(BEGIN CUSTOM CODE: Schema Methods)--
76 // --(END CUSTOM CODE: Schema Methods)--
77 
78  //ACCESSORS
79 
80 
81  HD_API
83 
84  HD_API
86 
87  HD_API
89 
90  HD_API
92 
93  HD_API
95 
96  // RETRIEVING AND CONSTRUCTING
97 
98  /// Builds a container data source which includes the provided child data
99  /// sources. Parameters with nullptr values are excluded. This is a
100  /// low-level interface. For cases in which it's desired to define
101  /// the container with a sparse set of child fields, the Builder class
102  /// is often more convenient and readable.
103  HD_API
104  static HdContainerDataSourceHandle
107  const HdDoubleDataSourceHandle &radius,
108  const HdDoubleDataSourceHandle &radiusTop,
109  const HdDoubleDataSourceHandle &radiusBottom,
110  const HdTokenDataSourceHandle &axis
111  );
112 
113  /// \class HdCapsuleSchema::Builder
114  ///
115  /// Utility class for setting sparse sets of child data source fields to be
116  /// filled as arguments into BuildRetained. Because all setter methods
117  /// return a reference to the instance, this can be used in the "builder
118  /// pattern" form.
119  class Builder
120  {
121  public:
122  HD_API
125  HD_API
127  const HdDoubleDataSourceHandle &radius);
128  HD_API
130  const HdDoubleDataSourceHandle &radiusTop);
131  HD_API
133  const HdDoubleDataSourceHandle &radiusBottom);
134  HD_API
135  Builder &SetAxis(
136  const HdTokenDataSourceHandle &axis);
137 
138  /// Returns a container data source containing the members set thus far.
139  HD_API
140  HdContainerDataSourceHandle Build();
141 
142  private:
143  HdDoubleDataSourceHandle _height;
144  HdDoubleDataSourceHandle _radius;
145  HdDoubleDataSourceHandle _radiusTop;
146  HdDoubleDataSourceHandle _radiusBottom;
148  };
149 
150  /// Retrieves a container data source with the schema's default name token
151  /// "capsule" from the parent container and constructs a
152  /// HdCapsuleSchema instance.
153  /// Because the requested container data source may not exist, the result
154  /// should be checked with IsDefined() or a bool comparison before use.
155  HD_API
157  const HdContainerDataSourceHandle &fromParentContainer);
158 
159  /// Returns a token where the container representing this schema is found in
160  /// a container by default.
161  HD_API
162  static const TfToken &GetSchemaToken();
163 
164  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
165  /// where the container representing this schema is found by default.
166  HD_API
167  static const HdDataSourceLocator &GetDefaultLocator();
168 
169  /// Returns token data source for use as axis value.
170  /// Values of...
171  /// - HdCapsuleSchemaTokens->X
172  /// - HdCapsuleSchemaTokens->Y
173  /// - HdCapsuleSchemaTokens->Z
174  /// ...will be stored statically and reused for future calls.
175  HD_API
177  const TfToken &axis);
178 
179 };
180 
182 
183 #endif
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
HdCapsuleSchema(HdContainerDataSourceHandle container)
Definition: capsuleSchema.h:72
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()
HD_API HdDoubleDataSourceHandle GetRadiusBottom()
#define HD_API
Definition: api.h:40
HD_API Builder & SetRadius(const HdDoubleDataSourceHandle &radius)
HD_API HdTokenDataSourceHandle GetAxis()
static HD_API HdTokenDataSourceHandle BuildAxisDataSource(const TfToken &axis)
HD_API HdDoubleDataSourceHandle GetHeight()
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
Definition: token.h:87
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 Builder & SetHeight(const HdDoubleDataSourceHandle &height)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetRadiusBottom(const HdDoubleDataSourceHandle &radiusBottom)
#define HD_CAPSULE_SCHEMA_TOKENS
Definition: capsuleSchema.h:54
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetRadiusTop(const HdDoubleDataSourceHandle &radiusTop)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdDoubleDataSourceHandle GetRadius()
HD_API HdDoubleDataSourceHandle GetRadiusTop()