HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
planeSchema.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_PLANE_SCHEMA_H
19 #define PXR_IMAGING_HD_PLANE_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_PLANE_SCHEMA_TOKENS \
36  (plane) \
37  (doubleSided) \
38  (axis) \
39  (length) \
40  (width) \
41  (X) \
42  (Y) \
43  (Z) \
44 
45 TF_DECLARE_PUBLIC_TOKENS(HdPlaneSchemaTokens, HD_API,
47 
48 //-----------------------------------------------------------------------------
49 
50 
51 class HdPlaneSchema : public HdSchema
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  HdPlaneSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  /// Retrieves a container data source with the schema's default name token
61  /// "plane" from the parent container and constructs a
62  /// HdPlaneSchema instance.
63  /// Because the requested container data source may not exist, the result
64  /// should be checked with IsDefined() or a bool comparison before use.
65  HD_API
67  const HdContainerDataSourceHandle &fromParentContainer);
68 
69  /// @}
70 
71 // --(BEGIN CUSTOM CODE: Schema Methods)--
72 // --(END CUSTOM CODE: Schema Methods)--
73 
74  /// \name Member accessor
75  /// @{
76 
77  HD_API
79 
80  HD_API
82 
83  HD_API
85 
86  HD_API
88 
89  /// @}
90 
91  /// \name Schema location
92  /// @{
93 
94  /// Returns a token where the container representing this schema is found in
95  /// a container by default.
96  HD_API
97  static const TfToken &GetSchemaToken();
98 
99  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
100  /// where the container representing this schema is found by default.
101  HD_API
102  static const HdDataSourceLocator &GetDefaultLocator();
103 
104  /// @}
105 
106  /// \name Schema construction
107  /// @{
108 
109  /// \deprecated Use Builder instead.
110  ///
111  /// Builds a container data source which includes the provided child data
112  /// sources. Parameters with nullptr values are excluded. This is a
113  /// low-level interface. For cases in which it's desired to define
114  /// the container with a sparse set of child fields, the Builder class
115  /// is often more convenient and readable.
116  HD_API
117  static HdContainerDataSourceHandle
119  const HdBoolDataSourceHandle &doubleSided,
120  const HdTokenDataSourceHandle &axis,
123  );
124 
125  /// \class HdPlaneSchema::Builder
126  ///
127  /// Utility class for setting sparse sets of child data source fields to be
128  /// filled as arguments into BuildRetained. Because all setter methods
129  /// return a reference to the instance, this can be used in the "builder
130  /// pattern" form.
131  class Builder
132  {
133  public:
134  HD_API
136  const HdBoolDataSourceHandle &doubleSided);
137  HD_API
138  Builder &SetAxis(
139  const HdTokenDataSourceHandle &axis);
140  HD_API
143  HD_API
144  Builder &SetWidth(
146 
147  /// Returns a container data source containing the members set thus far.
148  HD_API
149  HdContainerDataSourceHandle Build();
150 
151  private:
152  HdBoolDataSourceHandle _doubleSided;
154  HdDoubleDataSourceHandle _length;
156 
157  };
158 
159  /// Returns token data source for use as axis value.
160  ///
161  /// The following values will be stored statically and reused for future
162  /// calls:
163  /// - HdPlaneSchemaTokens->X
164  /// - HdPlaneSchemaTokens->Y
165  /// - HdPlaneSchemaTokens->Z
166  HD_API
168  const TfToken &axis);
169 
170  /// @}
171 };
172 
174 
175 #endif
HD_API HdTokenDataSourceHandle GetAxis() const
static HD_API HdTokenDataSourceHandle BuildAxisDataSource(const TfToken &axis)
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
static HD_API HdContainerDataSourceHandle BuildRetained(const HdBoolDataSourceHandle &doubleSided, const HdTokenDataSourceHandle &axis, const HdDoubleDataSourceHandle &length, const HdDoubleDataSourceHandle &width)
#define HD_API
Definition: api.h:23
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
static HD_API const TfToken & GetSchemaToken()
#define HD_PLANE_SCHEMA_TOKENS
Definition: planeSchema.h:35
HD_API HdBoolDataSourceHandle GetDoubleSided() const
HD_API Builder & SetAxis(const HdTokenDataSourceHandle &axis)
HD_API HdDoubleDataSourceHandle GetLength() const
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(HdPlaneSchemaTokens, HD_API, HD_PLANE_SCHEMA_TOKENS)
HD_API Builder & SetWidth(const HdDoubleDataSourceHandle &width)
HdBoolDataSource::Handle HdBoolDataSourceHandle
static HD_API HdPlaneSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetDoubleSided(const HdBoolDataSourceHandle &doubleSided)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdPlaneSchema(HdContainerDataSourceHandle container)
Definition: planeSchema.h:57
HD_API Builder & SetLength(const HdDoubleDataSourceHandle &length)
GLint GLsizei width
Definition: glcorearb.h:103
HD_API HdDoubleDataSourceHandle GetWidth() const
HdTokenDataSource::Handle HdTokenDataSourceHandle