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
52 ///
53 class HdPlaneSchema : public HdSchema
54 {
55 public:
56  /// \name Schema retrieval
57  /// @{
58 
59  HdPlaneSchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  /// Retrieves a container data source with the schema's default name token
63  /// "plane" from the parent container and constructs a
64  /// HdPlaneSchema instance.
65  /// Because the requested container data source may not exist, the result
66  /// should be checked with IsDefined() or a bool comparison before use.
67  HD_API
69  const HdContainerDataSourceHandle &fromParentContainer);
70 
71  /// @}
72 
73 // --(BEGIN CUSTOM CODE: Schema Methods)--
74 // --(END CUSTOM CODE: Schema Methods)--
75 
76  /// \name Member accessor
77  /// @{
78 
79  HD_API
81 
82  HD_API
84 
85  HD_API
87 
88  HD_API
90 
91  /// @}
92 
93  /// \name Schema location
94  /// @{
95 
96  /// Returns a token where the container representing this schema is found in
97  /// a container by default.
98  HD_API
99  static const TfToken &GetSchemaToken();
100 
101  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
102  /// where the container representing this schema is found by default.
103  HD_API
104  static const HdDataSourceLocator &GetDefaultLocator();
105 
106  /// @}
107 
108  /// \name Schema construction
109  /// @{
110 
111  /// \deprecated Use Builder instead.
112  ///
113  /// Builds a container data source which includes the provided child data
114  /// sources. Parameters with nullptr values are excluded. This is a
115  /// low-level interface. For cases in which it's desired to define
116  /// the container with a sparse set of child fields, the Builder class
117  /// is often more convenient and readable.
118  HD_API
119  static HdContainerDataSourceHandle
121  const HdBoolDataSourceHandle &doubleSided,
122  const HdTokenDataSourceHandle &axis,
125  );
126 
127  /// \class HdPlaneSchema::Builder
128  ///
129  /// Utility class for setting sparse sets of child data source fields to be
130  /// filled as arguments into BuildRetained. Because all setter methods
131  /// return a reference to the instance, this can be used in the "builder
132  /// pattern" form.
133  class Builder
134  {
135  public:
136  HD_API
138  const HdBoolDataSourceHandle &doubleSided);
139  HD_API
140  Builder &SetAxis(
141  const HdTokenDataSourceHandle &axis);
142  HD_API
145  HD_API
146  Builder &SetWidth(
148 
149  /// Returns a container data source containing the members set thus far.
150  HD_API
151  HdContainerDataSourceHandle Build();
152 
153  private:
154  HdBoolDataSourceHandle _doubleSided;
156  HdDoubleDataSourceHandle _length;
158 
159  };
160 
161  /// Returns token data source for use as axis value.
162  ///
163  /// The following values will be stored statically and reused for future
164  /// calls:
165  /// - HdPlaneSchemaTokens->X
166  /// - HdPlaneSchemaTokens->Y
167  /// - HdPlaneSchemaTokens->Z
168  HD_API
170  const TfToken &axis);
171 
172  /// @}
173 };
174 
176 
177 #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 PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#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.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdPlaneSchema(HdContainerDataSourceHandle container)
Definition: planeSchema.h:59
HD_API Builder & SetLength(const HdDoubleDataSourceHandle &length)
GLint GLsizei width
Definition: glcorearb.h:103
HD_API HdDoubleDataSourceHandle GetWidth() const
HdTokenDataSource::Handle HdTokenDataSourceHandle