HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
volumeFieldSchema.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_VOLUME_FIELD_SCHEMA_H
19 #define PXR_IMAGING_HD_VOLUME_FIELD_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_VOLUME_FIELD_SCHEMA_TOKENS \
36  (volumeField) \
37  (filePath) \
38  (fieldName) \
39  (fieldIndex) \
40  (fieldDataType) \
41  (vectorDataRoleHint) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdVolumeFieldSchemaTokens, HD_API,
45 
46 //-----------------------------------------------------------------------------
47 
48 
49 /// \class HdVolumeFieldSchema
50 ///
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  HdVolumeFieldSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  /// Retrieves a container data source with the schema's default name token
61  /// "volumeField" from the parent container and constructs a
62  /// HdVolumeFieldSchema 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  HD_API
91 
92  /// @}
93 
94  /// \name Schema location
95  /// @{
96 
97  /// Returns a token where the container representing this schema is found in
98  /// a container by default.
99  HD_API
100  static const TfToken &GetSchemaToken();
101 
102  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
103  /// where the container representing this schema is found by default.
104  HD_API
105  static const HdDataSourceLocator &GetDefaultLocator();
106 
107  /// @}
108 
109  /// \name Schema construction
110  /// @{
111 
112  /// \deprecated Use Builder instead.
113  ///
114  /// Builds a container data source which includes the provided child data
115  /// sources. Parameters with nullptr values are excluded. This is a
116  /// low-level interface. For cases in which it's desired to define
117  /// the container with a sparse set of child fields, the Builder class
118  /// is often more convenient and readable.
119  HD_API
120  static HdContainerDataSourceHandle
122  const HdAssetPathDataSourceHandle &filePath,
123  const HdTokenDataSourceHandle &fieldName,
124  const HdIntDataSourceHandle &fieldIndex,
125  const HdTokenDataSourceHandle &fieldDataType,
126  const HdTokenDataSourceHandle &vectorDataRoleHint
127  );
128 
129  /// \class HdVolumeFieldSchema::Builder
130  ///
131  /// Utility class for setting sparse sets of child data source fields to be
132  /// filled as arguments into BuildRetained. Because all setter methods
133  /// return a reference to the instance, this can be used in the "builder
134  /// pattern" form.
135  class Builder
136  {
137  public:
138  HD_API
140  const HdAssetPathDataSourceHandle &filePath);
141  HD_API
143  const HdTokenDataSourceHandle &fieldName);
144  HD_API
146  const HdIntDataSourceHandle &fieldIndex);
147  HD_API
149  const HdTokenDataSourceHandle &fieldDataType);
150  HD_API
152  const HdTokenDataSourceHandle &vectorDataRoleHint);
153 
154  /// Returns a container data source containing the members set thus far.
155  HD_API
156  HdContainerDataSourceHandle Build();
157 
158  private:
159  HdAssetPathDataSourceHandle _filePath;
160  HdTokenDataSourceHandle _fieldName;
161  HdIntDataSourceHandle _fieldIndex;
162  HdTokenDataSourceHandle _fieldDataType;
163  HdTokenDataSourceHandle _vectorDataRoleHint;
164 
165  };
166 
167  /// @}
168 };
169 
171 
172 #endif
HD_API HdTokenDataSourceHandle GetVectorDataRoleHint() const
#define HD_VOLUME_FIELD_SCHEMA_TOKENS
HdVolumeFieldSchema(HdContainerDataSourceHandle container)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
HD_API Builder & SetFieldDataType(const HdTokenDataSourceHandle &fieldDataType)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdIntDataSourceHandle GetFieldIndex() const
HdAssetPathDataSource::Handle HdAssetPathDataSourceHandle
Definition: token.h:70
static HD_API const TfToken & GetSchemaToken()
HD_API HdTokenDataSourceHandle GetFieldName() const
TF_DECLARE_PUBLIC_TOKENS(HdVolumeFieldSchemaTokens, HD_API, HD_VOLUME_FIELD_SCHEMA_TOKENS)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdAssetPathDataSourceHandle &filePath, const HdTokenDataSourceHandle &fieldName, const HdIntDataSourceHandle &fieldIndex, const HdTokenDataSourceHandle &fieldDataType, const HdTokenDataSourceHandle &vectorDataRoleHint)
HD_API HdTokenDataSourceHandle GetFieldDataType() const
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetFieldName(const HdTokenDataSourceHandle &fieldName)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HdIntDataSource::Handle HdIntDataSourceHandle
HD_API Builder & SetVectorDataRoleHint(const HdTokenDataSourceHandle &vectorDataRoleHint)
HD_API Builder & SetFieldIndex(const HdIntDataSourceHandle &fieldIndex)
HD_API HdAssetPathDataSourceHandle GetFilePath() const
static HD_API HdVolumeFieldSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetFilePath(const HdAssetPathDataSourceHandle &filePath)