volumeFieldSchema.h
1 //
2 // Copyright 2021 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 //
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_VOLUME_FIELD_SCHEMA_H
29 #define PXR_IMAGING_HD_VOLUME_FIELD_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
33 #include "pxr/imaging/hd/schema.h"
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 //-----------------------------------------------------------------------------
38 
39 #define HDVOLUMEFIELD_SCHEMA_TOKENS \
40  (volumeField) \
41  (filePath) \
42  (fieldName) \
43  (fieldIndex) \
44  (fieldDataType) \
45  (vectorDataRoleHint) \
46 
47 TF_DECLARE_PUBLIC_TOKENS(HdVolumeFieldSchemaTokens, HD_API,
48  HDVOLUMEFIELD_SCHEMA_TOKENS);
49 
50 //-----------------------------------------------------------------------------
51 
52 class HdVolumeFieldSchema : public HdSchema
53 {
54 public:
55  HdVolumeFieldSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  //ACCESSORS
59 
60  HD_API
61  HdAssetPathDataSourceHandle GetFilePath();
62  HD_API
63  HdTokenDataSourceHandle GetFieldName();
64  HD_API
65  HdIntDataSourceHandle GetFieldIndex();
66  HD_API
67  HdTokenDataSourceHandle GetFieldDataType();
68  HD_API
69  HdTokenDataSourceHandle GetVectorDataRoleHint();
70 
71  // RETRIEVING AND CONSTRUCTING
72 
78  HD_API
79  static HdContainerDataSourceHandle
80  BuildRetained(
81  const HdAssetPathDataSourceHandle &filePath,
82  const HdTokenDataSourceHandle &fieldName,
83  const HdIntDataSourceHandle &fieldIndex,
84  const HdTokenDataSourceHandle &fieldDataType,
85  const HdTokenDataSourceHandle &vectorDataRoleHint
86  );
87 
94  class Builder
95  {
96  public:
97  HD_API
98  Builder &SetFilePath(
99  const HdAssetPathDataSourceHandle &filePath);
100  HD_API
101  Builder &SetFieldName(
102  const HdTokenDataSourceHandle &fieldName);
103  HD_API
104  Builder &SetFieldIndex(
105  const HdIntDataSourceHandle &fieldIndex);
106  HD_API
107  Builder &SetFieldDataType(
108  const HdTokenDataSourceHandle &fieldDataType);
109  HD_API
110  Builder &SetVectorDataRoleHint(
111  const HdTokenDataSourceHandle &vectorDataRoleHint);
112 
114  HD_API
115  HdContainerDataSourceHandle Build();
116 
117  private:
118  HdAssetPathDataSourceHandle _filePath;
119  HdTokenDataSourceHandle _fieldName;
120  HdIntDataSourceHandle _fieldIndex;
121  HdTokenDataSourceHandle _fieldDataType;
122  HdTokenDataSourceHandle _vectorDataRoleHint;
123  };
124 
130  HD_API
131  static HdVolumeFieldSchema GetFromParent(
132  const HdContainerDataSourceHandle &fromParentContainer);
133 
136  HD_API
137  static const HdDataSourceLocator &GetDefaultLocator();
138 
139 };
140 
141 PXR_NAMESPACE_CLOSE_SCOPE
142 
143 #endif
Represents an object that can identify the location of a data source.
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:42