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
51 ///
52 class HdConeSchema : public HdSchema
53 {
54 public:
55  /// \name Schema retrieval
56  /// @{
57 
58  HdConeSchema(HdContainerDataSourceHandle container)
59  : HdSchema(container) {}
60 
61  /// Retrieves a container data source with the schema's default name token
62  /// "cone" from the parent container and constructs a
63  /// HdConeSchema 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  /// @}
88 
89  /// \name Schema location
90  /// @{
91 
92  /// Returns a token where the container representing this schema is found in
93  /// a container by default.
94  HD_API
95  static const TfToken &GetSchemaToken();
96 
97  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
98  /// where the container representing this schema is found by default.
99  HD_API
100  static const HdDataSourceLocator &GetDefaultLocator();
101 
102  /// @}
103 
104  /// \name Schema construction
105  /// @{
106 
107  /// \deprecated Use Builder instead.
108  ///
109  /// Builds a container data source which includes the provided child data
110  /// sources. Parameters with nullptr values are excluded. This is a
111  /// low-level interface. For cases in which it's desired to define
112  /// the container with a sparse set of child fields, the Builder class
113  /// is often more convenient and readable.
114  HD_API
115  static HdContainerDataSourceHandle
118  const HdDoubleDataSourceHandle &radius,
119  const HdTokenDataSourceHandle &axis
120  );
121 
122  /// \class HdConeSchema::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
134  HD_API
136  const HdDoubleDataSourceHandle &radius);
137  HD_API
138  Builder &SetAxis(
139  const HdTokenDataSourceHandle &axis);
140 
141  /// Returns a container data source containing the members set thus far.
142  HD_API
143  HdContainerDataSourceHandle Build();
144 
145  private:
146  HdDoubleDataSourceHandle _height;
147  HdDoubleDataSourceHandle _radius;
149 
150  };
151 
152  /// Returns token data source for use as axis value.
153  ///
154  /// The following values will be stored statically and reused for future
155  /// calls:
156  /// - HdConeSchemaTokens->X
157  /// - HdConeSchemaTokens->Y
158  /// - HdConeSchemaTokens->Z
159  HD_API
161  const TfToken &axis);
162 
163  /// @}
164 };
165 
167 
168 #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 PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#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)
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:58
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdDoubleDataSourceHandle GetRadius() const
HD_API Builder & SetAxis(const HdTokenDataSourceHandle &axis)
static HD_API const HdDataSourceLocator & GetDefaultLocator()