HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sphereSchema.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_SPHERE_SCHEMA_H
19 #define PXR_IMAGING_HD_SPHERE_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_SPHERE_SCHEMA_TOKENS \
36  (sphere) \
37  (radius) \
38 
39 TF_DECLARE_PUBLIC_TOKENS(HdSphereSchemaTokens, HD_API,
41 
42 //-----------------------------------------------------------------------------
43 
44 
45 /// \class HdSphereSchema
46 ///
47 class HdSphereSchema : public HdSchema
48 {
49 public:
50  /// \name Schema retrieval
51  /// @{
52 
53  HdSphereSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  /// Retrieves a container data source with the schema's default name token
57  /// "sphere" from the parent container and constructs a
58  /// HdSphereSchema instance.
59  /// Because the requested container data source may not exist, the result
60  /// should be checked with IsDefined() or a bool comparison before use.
61  HD_API
63  const HdContainerDataSourceHandle &fromParentContainer);
64 
65  /// @}
66 
67 // --(BEGIN CUSTOM CODE: Schema Methods)--
68 // --(END CUSTOM CODE: Schema Methods)--
69 
70  /// \name Member accessor
71  /// @{
72 
73  HD_API
75 
76  /// @}
77 
78  /// \name Schema location
79  /// @{
80 
81  /// Returns a token where the container representing this schema is found in
82  /// a container by default.
83  HD_API
84  static const TfToken &GetSchemaToken();
85 
86  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
87  /// where the container representing this schema is found by default.
88  HD_API
89  static const HdDataSourceLocator &GetDefaultLocator();
90 
91  /// @}
92 
93  /// \name Schema construction
94  /// @{
95 
96  /// \deprecated Use Builder instead.
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
106  const HdDoubleDataSourceHandle &radius
107  );
108 
109  /// \class HdSphereSchema::Builder
110  ///
111  /// Utility class for setting sparse sets of child data source fields to be
112  /// filled as arguments into BuildRetained. Because all setter methods
113  /// return a reference to the instance, this can be used in the "builder
114  /// pattern" form.
115  class Builder
116  {
117  public:
118  HD_API
120  const HdDoubleDataSourceHandle &radius);
121 
122  /// Returns a container data source containing the members set thus far.
123  HD_API
124  HdContainerDataSourceHandle Build();
125 
126  private:
127  HdDoubleDataSourceHandle _radius;
128 
129  };
130 
131  /// @}
132 };
133 
135 
136 #endif
static HD_API HdSphereSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
static HD_API const HdDataSourceLocator & GetDefaultLocator()
#define HD_API
Definition: api.h:23
static HD_API const TfToken & GetSchemaToken()
Definition: token.h:70
HD_API HdDoubleDataSourceHandle GetRadius() const
TF_DECLARE_PUBLIC_TOKENS(HdSphereSchemaTokens, HD_API, HD_SPHERE_SCHEMA_TOKENS)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdDoubleDataSourceHandle &radius)
HdSphereSchema(HdContainerDataSourceHandle container)
Definition: sphereSchema.h:53
HD_API Builder & SetRadius(const HdDoubleDataSourceHandle &radius)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define HD_SPHERE_SCHEMA_TOKENS
Definition: sphereSchema.h:35