HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cylinderSchema.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 /* ** This file is generated by a script. Do not edit directly. Edit ** */
28 /* ** defs.py or the (*)Schema.template.h files to make changes. ** */
29 /* ************************************************************************** */
30 
31 #ifndef PXR_IMAGING_HD_CYLINDER_SCHEMA_H
32 #define PXR_IMAGING_HD_CYLINDER_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDCYLINDER_SCHEMA_TOKENS \
43  (cylinder) \
44  (height) \
45  (radius) \
46  (axis) \
47  (X) \
48  (Y) \
49  (Z) \
50 
51 TF_DECLARE_PUBLIC_TOKENS(HdCylinderSchemaTokens, HD_API,
53 
54 //-----------------------------------------------------------------------------
55 
56 class HdCylinderSchema : public HdSchema
57 {
58 public:
59  HdCylinderSchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  //ACCESSORS
63 
64  HD_API
66  HD_API
68  HD_API
70 
71  // RETRIEVING AND CONSTRUCTING
72 
73  /// Builds a container data source which includes the provided child data
74  /// sources. Parameters with nullptr values are excluded. This is a
75  /// low-level interface. For cases in which it's desired to define
76  /// the container with a sparse set of child fields, the Builder class
77  /// is often more convenient and readable.
78  HD_API
79  static HdContainerDataSourceHandle
82  const HdDoubleDataSourceHandle &radius,
83  const HdTokenDataSourceHandle &axis
84  );
85 
86  /// \class HdCylinderSchema::Builder
87  ///
88  /// Utility class for setting sparse sets of child data source fields to be
89  /// filled as arguments into BuildRetained. Because all setter methods
90  /// return a reference to the instance, this can be used in the "builder
91  /// pattern" form.
92  class Builder
93  {
94  public:
95  HD_API
98  HD_API
100  const HdDoubleDataSourceHandle &radius);
101  HD_API
102  Builder &SetAxis(
103  const HdTokenDataSourceHandle &axis);
104 
105  /// Returns a container data source containing the members set thus far.
106  HD_API
107  HdContainerDataSourceHandle Build();
108 
109  private:
110  HdDoubleDataSourceHandle _height;
111  HdDoubleDataSourceHandle _radius;
113  };
114 
115  /// Retrieves a container data source with the schema's default name token
116  /// "cylinder" from the parent container and constructs a
117  /// HdCylinderSchema instance.
118  /// Because the requested container data source may not exist, the result
119  /// should be checked with IsDefined() or a bool comparison before use.
120  HD_API
122  const HdContainerDataSourceHandle &fromParentContainer);
123 
124  /// Returns a token where the container representing this schema is found in
125  /// a container by default.
126  HD_API
127  static const TfToken &GetSchemaToken();
128 
129  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
130  /// where the container representing this schema is found by default.
131  HD_API
132  static const HdDataSourceLocator &GetDefaultLocator();
133 
134 };
135 
137 
138 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdDoubleDataSource::Handle HdDoubleDataSourceHandle
#define HD_API
Definition: api.h:40
HD_API Builder & SetHeight(const HdDoubleDataSourceHandle &height)
TF_DECLARE_PUBLIC_TOKENS(HdCylinderSchemaTokens, HD_API, HDCYLINDER_SCHEMA_TOKENS)
HD_API HdDoubleDataSourceHandle GetRadius()
static HD_API HdContainerDataSourceHandle BuildRetained(const HdDoubleDataSourceHandle &height, const HdDoubleDataSourceHandle &radius, const HdTokenDataSourceHandle &axis)
HD_API Builder & SetAxis(const HdTokenDataSourceHandle &axis)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
Definition: token.h:87
HD_API HdTokenDataSourceHandle GetAxis()
HdCylinderSchema(HdContainerDataSourceHandle container)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
#define HDCYLINDER_SCHEMA_TOKENS
static HD_API const TfToken & GetSchemaToken()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdDoubleDataSourceHandle GetHeight()
static HD_API HdCylinderSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetRadius(const HdDoubleDataSourceHandle &radius)
HdTokenDataSource::Handle HdTokenDataSourceHandle