HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
splitDiopterSchema.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_SPLIT_DIOPTER_SCHEMA_H
32 #define PXR_IMAGING_HD_SPLIT_DIOPTER_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDSPLITDIOPTER_SCHEMA_TOKENS \
43  (splitDiopter) \
44  (count) \
45  (angle) \
46  (offset1) \
47  (width1) \
48  (focusDistance1) \
49  (offset2) \
50  (width2) \
51  (focusDistance2) \
52 
53 TF_DECLARE_PUBLIC_TOKENS(HdSplitDiopterSchemaTokens, HD_API,
55 
56 //-----------------------------------------------------------------------------
57 
59 {
60 public:
61  HdSplitDiopterSchema(HdContainerDataSourceHandle container)
62  : HdSchema(container) {}
63 
64  //ACCESSORS
65 
66  HD_API
68  HD_API
70  HD_API
72  HD_API
74  HD_API
76  HD_API
78  HD_API
80  HD_API
82 
83  // RETRIEVING AND CONSTRUCTING
84 
85  /// Builds a container data source which includes the provided child data
86  /// sources. Parameters with nullptr values are excluded. This is a
87  /// low-level interface. For cases in which it's desired to define
88  /// the container with a sparse set of child fields, the Builder class
89  /// is often more convenient and readable.
90  HD_API
91  static HdContainerDataSourceHandle
95  const HdFloatDataSourceHandle &offset1,
96  const HdFloatDataSourceHandle &width1,
97  const HdFloatDataSourceHandle &focusDistance1,
98  const HdFloatDataSourceHandle &offset2,
99  const HdFloatDataSourceHandle &width2,
100  const HdFloatDataSourceHandle &focusDistance2
101  );
102 
103  /// \class HdSplitDiopterSchema::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
113  Builder &SetCount(
115  HD_API
116  Builder &SetAngle(
118  HD_API
120  const HdFloatDataSourceHandle &offset1);
121  HD_API
123  const HdFloatDataSourceHandle &width1);
124  HD_API
126  const HdFloatDataSourceHandle &focusDistance1);
127  HD_API
129  const HdFloatDataSourceHandle &offset2);
130  HD_API
132  const HdFloatDataSourceHandle &width2);
133  HD_API
135  const HdFloatDataSourceHandle &focusDistance2);
136 
137  /// Returns a container data source containing the members set thus far.
138  HD_API
139  HdContainerDataSourceHandle Build();
140 
141  private:
142  HdIntDataSourceHandle _count;
144  HdFloatDataSourceHandle _offset1;
145  HdFloatDataSourceHandle _width1;
146  HdFloatDataSourceHandle _focusDistance1;
147  HdFloatDataSourceHandle _offset2;
148  HdFloatDataSourceHandle _width2;
149  HdFloatDataSourceHandle _focusDistance2;
150  };
151 
152  /// Retrieves a container data source with the schema's default name token
153  /// "splitDiopter" from the parent container and constructs a
154  /// HdSplitDiopterSchema instance.
155  /// Because the requested container data source may not exist, the result
156  /// should be checked with IsDefined() or a bool comparison before use.
157  HD_API
159  const HdContainerDataSourceHandle &fromParentContainer);
160 
161  /// Returns a token where the container representing this schema is found in
162  /// a container by default.
163  HD_API
164  static const TfToken &GetSchemaToken();
165 
166  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
167  /// where the container representing this schema is found by default.
168  HD_API
169  static const HdDataSourceLocator &GetDefaultLocator();
170 
171 };
172 
174 
175 #endif
HdFloatDataSource::Handle HdFloatDataSourceHandle
HD_API HdFloatDataSourceHandle GetOffset1()
HD_API Builder & SetWidth1(const HdFloatDataSourceHandle &width1)
SIM_API const UT_StringHolder angle
HD_API HdFloatDataSourceHandle GetOffset2()
HD_API HdFloatDataSourceHandle GetFocusDistance1()
HD_API Builder & SetOffset2(const HdFloatDataSourceHandle &offset2)
#define HD_API
Definition: api.h:40
HD_API HdFloatDataSourceHandle GetWidth2()
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdIntDataSourceHandle GetCount()
HD_API HdFloatDataSourceHandle GetWidth1()
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetAngle(const HdFloatDataSourceHandle &angle)
Definition: token.h:87
#define HDSPLITDIOPTER_SCHEMA_TOKENS
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntDataSourceHandle &count, const HdFloatDataSourceHandle &angle, const HdFloatDataSourceHandle &offset1, const HdFloatDataSourceHandle &width1, const HdFloatDataSourceHandle &focusDistance1, const HdFloatDataSourceHandle &offset2, const HdFloatDataSourceHandle &width2, const HdFloatDataSourceHandle &focusDistance2)
HD_API Builder & SetWidth2(const HdFloatDataSourceHandle &width2)
static HD_API HdSplitDiopterSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetCount(const HdIntDataSourceHandle &count)
static HD_API const TfToken & GetSchemaToken()
HD_API HdFloatDataSourceHandle GetAngle()
HD_API Builder & SetOffset1(const HdFloatDataSourceHandle &offset1)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HD_API Builder & SetFocusDistance2(const HdFloatDataSourceHandle &focusDistance2)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HdIntDataSource::Handle HdIntDataSourceHandle
TF_DECLARE_PUBLIC_TOKENS(HdSplitDiopterSchemaTokens, HD_API, HDSPLITDIOPTER_SCHEMA_TOKENS)
HD_API Builder & SetFocusDistance1(const HdFloatDataSourceHandle &focusDistance1)
HD_API HdFloatDataSourceHandle GetFocusDistance2()
GLint GLsizei count
Definition: glcorearb.h:405
HdSplitDiopterSchema(HdContainerDataSourceHandle container)