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 
50 {
51 public:
52  /// \name Schema retrieval
53  /// @{
54 
55  HdVolumeFieldSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  /// Retrieves a container data source with the schema's default name token
59  /// "volumeField" from the parent container and constructs a
60  /// HdVolumeFieldSchema instance.
61  /// Because the requested container data source may not exist, the result
62  /// should be checked with IsDefined() or a bool comparison before use.
63  HD_API
65  const HdContainerDataSourceHandle &fromParentContainer);
66 
67  /// @}
68 
69 // --(BEGIN CUSTOM CODE: Schema Methods)--
70 // --(END CUSTOM CODE: Schema Methods)--
71 
72  /// \name Member accessor
73  /// @{
74 
75  HD_API
77 
78  HD_API
80 
81  HD_API
83 
84  HD_API
86 
87  HD_API
89 
90  /// @}
91 
92  /// \name Schema location
93  /// @{
94 
95  /// Returns a token where the container representing this schema is found in
96  /// a container by default.
97  HD_API
98  static const TfToken &GetSchemaToken();
99 
100  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
101  /// where the container representing this schema is found by default.
102  HD_API
103  static const HdDataSourceLocator &GetDefaultLocator();
104 
105  /// @}
106 
107  /// \name Schema construction
108  /// @{
109 
110  /// \deprecated Use Builder instead.
111  ///
112  /// Builds a container data source which includes the provided child data
113  /// sources. Parameters with nullptr values are excluded. This is a
114  /// low-level interface. For cases in which it's desired to define
115  /// the container with a sparse set of child fields, the Builder class
116  /// is often more convenient and readable.
117  HD_API
118  static HdContainerDataSourceHandle
120  const HdAssetPathDataSourceHandle &filePath,
121  const HdTokenDataSourceHandle &fieldName,
122  const HdIntDataSourceHandle &fieldIndex,
123  const HdTokenDataSourceHandle &fieldDataType,
124  const HdTokenDataSourceHandle &vectorDataRoleHint
125  );
126 
127  /// \class HdVolumeFieldSchema::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 HdAssetPathDataSourceHandle &filePath);
139  HD_API
141  const HdTokenDataSourceHandle &fieldName);
142  HD_API
144  const HdIntDataSourceHandle &fieldIndex);
145  HD_API
147  const HdTokenDataSourceHandle &fieldDataType);
148  HD_API
150  const HdTokenDataSourceHandle &vectorDataRoleHint);
151 
152  /// Returns a container data source containing the members set thus far.
153  HD_API
154  HdContainerDataSourceHandle Build();
155 
156  private:
157  HdAssetPathDataSourceHandle _filePath;
158  HdTokenDataSourceHandle _fieldName;
159  HdIntDataSourceHandle _fieldIndex;
160  HdTokenDataSourceHandle _fieldDataType;
161  HdTokenDataSourceHandle _vectorDataRoleHint;
162 
163  };
164 
165  /// @}
166 };
167 
169 
170 #endif
HD_API HdTokenDataSourceHandle GetVectorDataRoleHint() const
#define HD_VOLUME_FIELD_SCHEMA_TOKENS
HdVolumeFieldSchema(HdContainerDataSourceHandle container)
#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()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
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)