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 Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 /* ************************************************************************** */
27 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_CONE_SCHEMA_H
36 #define PXR_IMAGING_HD_CONE_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
40 #include "pxr/imaging/hd/schema.h"
41 
42 // --(BEGIN CUSTOM CODE: Includes)--
43 // --(END CUSTOM CODE: Includes)--
44 
46 
47 //-----------------------------------------------------------------------------
48 
49 // --(BEGIN CUSTOM CODE: Declares)--
50 // --(END CUSTOM CODE: Declares)--
51 
52 //-----------------------------------------------------------------------------
53 
54 #define HD_CONE_SCHEMA_TOKENS \
55  (cone) \
56  (height) \
57  (radius) \
58  (axis) \
59  (X) \
60  (Y) \
61  (Z) \
62 
63 TF_DECLARE_PUBLIC_TOKENS(HdConeSchemaTokens, HD_API,
65 
66 //-----------------------------------------------------------------------------
67 class HdConeSchema : public HdSchema
68 {
69 public:
70  HdConeSchema(HdContainerDataSourceHandle container)
71  : HdSchema(container) {}
72 
73 // --(BEGIN CUSTOM CODE: Schema Methods)--
74 // --(END CUSTOM CODE: Schema Methods)--
75 
76  //ACCESSORS
77 
78 
79  HD_API
81 
82  HD_API
84 
85  HD_API
87 
88  // RETRIEVING AND CONSTRUCTING
89 
90  /// Builds a container data source which includes the provided child data
91  /// sources. Parameters with nullptr values are excluded. This is a
92  /// low-level interface. For cases in which it's desired to define
93  /// the container with a sparse set of child fields, the Builder class
94  /// is often more convenient and readable.
95  HD_API
96  static HdContainerDataSourceHandle
99  const HdDoubleDataSourceHandle &radius,
100  const HdTokenDataSourceHandle &axis
101  );
102 
103  /// \class HdConeSchema::Builder
104  ///
105  /// Utility class for setting sparse sets of child data source fields to be
106  /// filled as arguments into BuildRetained. Because all setter methods
107  /// return a reference to the instance, this can be used in the "builder
108  /// pattern" form.
109  class Builder
110  {
111  public:
112  HD_API
115  HD_API
117  const HdDoubleDataSourceHandle &radius);
118  HD_API
119  Builder &SetAxis(
120  const HdTokenDataSourceHandle &axis);
121 
122  /// Returns a container data source containing the members set thus far.
123  HD_API
124  HdContainerDataSourceHandle Build();
125 
126  private:
127  HdDoubleDataSourceHandle _height;
128  HdDoubleDataSourceHandle _radius;
130  };
131 
132  /// Retrieves a container data source with the schema's default name token
133  /// "cone" from the parent container and constructs a
134  /// HdConeSchema instance.
135  /// Because the requested container data source may not exist, the result
136  /// should be checked with IsDefined() or a bool comparison before use.
137  HD_API
139  const HdContainerDataSourceHandle &fromParentContainer);
140 
141  /// Returns a token where the container representing this schema is found in
142  /// a container by default.
143  HD_API
144  static const TfToken &GetSchemaToken();
145 
146  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
147  /// where the container representing this schema is found by default.
148  HD_API
149  static const HdDataSourceLocator &GetDefaultLocator();
150 
151  /// Returns token data source for use as axis value.
152  /// Values of...
153  /// - HdConeSchemaTokens->X
154  /// - HdConeSchemaTokens->Y
155  /// - HdConeSchemaTokens->Z
156  /// ...will be stored statically and reused for future calls.
157  HD_API
159  const TfToken &axis);
160 
161 };
162 
164 
165 #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 HdDoubleDataSourceHandle GetRadius()
#define HD_API
Definition: api.h:40
HD_API Builder & SetRadius(const HdDoubleDataSourceHandle &radius)
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
Definition: token.h:87
HD_API HdDoubleDataSourceHandle GetHeight()
HD_API Builder & SetHeight(const HdDoubleDataSourceHandle &height)
static HD_API HdConeSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdTokenDataSourceHandle GetAxis()
TF_DECLARE_PUBLIC_TOKENS(HdConeSchemaTokens, HD_API, HD_CONE_SCHEMA_TOKENS)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
static HD_API HdTokenDataSourceHandle BuildAxisDataSource(const TfToken &axis)
#define HD_CONE_SCHEMA_TOKENS
Definition: coneSchema.h:54
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdConeSchema(HdContainerDataSourceHandle container)
Definition: coneSchema.h:70
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetAxis(const HdTokenDataSourceHandle &axis)
static HD_API const HdDataSourceLocator & GetDefaultLocator()