HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
coneSchema.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_CONE_SCHEMA_H
19 #define PXR_IMAGING_HD_CONE_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_CONE_SCHEMA_TOKENS \
36  (cone) \
37  (height) \
38  (radius) \
39  (axis) \
40  (X) \
41  (Y) \
42  (Z) \
43 
44 TF_DECLARE_PUBLIC_TOKENS(HdConeSchemaTokens, HD_API,
46 
47 //-----------------------------------------------------------------------------
48 
49 
50 class HdConeSchema : public HdSchema
51 {
52 public:
53  /// \name Schema retrieval
54  /// @{
55 
56  HdConeSchema(HdContainerDataSourceHandle container)
57  : HdSchema(container) {}
58 
59  /// Retrieves a container data source with the schema's default name token
60  /// "cone" from the parent container and constructs a
61  /// HdConeSchema 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  /// @}
86 
87  /// \name Schema location
88  /// @{
89 
90  /// Returns a token where the container representing this schema is found in
91  /// a container by default.
92  HD_API
93  static const TfToken &GetSchemaToken();
94 
95  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
96  /// where the container representing this schema is found by default.
97  HD_API
98  static const HdDataSourceLocator &GetDefaultLocator();
99 
100  /// @}
101 
102  /// \name Schema construction
103  /// @{
104 
105  /// \deprecated Use Builder instead.
106  ///
107  /// Builds a container data source which includes the provided child data
108  /// sources. Parameters with nullptr values are excluded. This is a
109  /// low-level interface. For cases in which it's desired to define
110  /// the container with a sparse set of child fields, the Builder class
111  /// is often more convenient and readable.
112  HD_API
113  static HdContainerDataSourceHandle
116  const HdDoubleDataSourceHandle &radius,
117  const HdTokenDataSourceHandle &axis
118  );
119 
120  /// \class HdConeSchema::Builder
121  ///
122  /// Utility class for setting sparse sets of child data source fields to be
123  /// filled as arguments into BuildRetained. Because all setter methods
124  /// return a reference to the instance, this can be used in the "builder
125  /// pattern" form.
126  class Builder
127  {
128  public:
129  HD_API
132  HD_API
134  const HdDoubleDataSourceHandle &radius);
135  HD_API
136  Builder &SetAxis(
137  const HdTokenDataSourceHandle &axis);
138 
139  /// Returns a container data source containing the members set thus far.
140  HD_API
141  HdContainerDataSourceHandle Build();
142 
143  private:
144  HdDoubleDataSourceHandle _height;
145  HdDoubleDataSourceHandle _radius;
147 
148  };
149 
150  /// Returns token data source for use as axis value.
151  ///
152  /// The following values will be stored statically and reused for future
153  /// calls:
154  /// - HdConeSchemaTokens->X
155  /// - HdConeSchemaTokens->Y
156  /// - HdConeSchemaTokens->Z
157  HD_API
159  const TfToken &axis);
160 
161  /// @}
162 };
163 
165 
166 #endif
static HD_API const TfToken & GetSchemaToken()
static HD_API HdContainerDataSourceHandle BuildRetained(const HdDoubleDataSourceHandle &height, const HdDoubleDataSourceHandle &radius, const HdTokenDataSourceHandle &axis)
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
HD_API HdTokenDataSourceHandle GetAxis() const
#define HD_API
Definition: api.h:23
HD_API Builder & SetRadius(const HdDoubleDataSourceHandle &radius)
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
Definition: token.h:70
HD_API Builder & SetHeight(const HdDoubleDataSourceHandle &height)
HD_API HdDoubleDataSourceHandle GetHeight() const
static HD_API HdConeSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
TF_DECLARE_PUBLIC_TOKENS(HdConeSchemaTokens, HD_API, HD_CONE_SCHEMA_TOKENS)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static HD_API HdTokenDataSourceHandle BuildAxisDataSource(const TfToken &axis)
#define HD_CONE_SCHEMA_TOKENS
Definition: coneSchema.h:35
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdConeSchema(HdContainerDataSourceHandle container)
Definition: coneSchema.h:56
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdDoubleDataSourceHandle GetRadius() const
HD_API Builder & SetAxis(const HdTokenDataSourceHandle &axis)
static HD_API const HdDataSourceLocator & GetDefaultLocator()