HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
meshSchema.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 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_MESH_SCHEMA_H
36 #define PXR_IMAGING_HD_MESH_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
43 
44 
45 // --(BEGIN CUSTOM CODE: Includes)--
46 // --(END CUSTOM CODE: Includes)--
47 
49 
50 //-----------------------------------------------------------------------------
51 
52 #define HD_MESH_SCHEMA_TOKENS \
53  (mesh) \
54  (topology) \
55  (subdivisionScheme) \
56  (subdivisionTags) \
57  (geomSubsets) \
58  (doubleSided) \
59 
60 TF_DECLARE_PUBLIC_TOKENS(HdMeshSchemaTokens, HD_API,
62 
63 //-----------------------------------------------------------------------------
64 
65 class HdMeshSchema : public HdSchema
66 {
67 public:
68  HdMeshSchema(HdContainerDataSourceHandle container)
69  : HdSchema(container) {}
70 
71 // --(BEGIN CUSTOM CODE: Schema Methods)--
72 // --(END CUSTOM CODE: Schema Methods)--
73 
74  //ACCESSORS
75 
76 
77  HD_API
79 
80  HD_API
82 
83  HD_API
85 
86  HD_API
88 
89  HD_API
91 
92  // RETRIEVING AND CONSTRUCTING
93 
94  /// Builds a container data source which includes the provided child data
95  /// sources. Parameters with nullptr values are excluded. This is a
96  /// low-level interface. For cases in which it's desired to define
97  /// the container with a sparse set of child fields, the Builder class
98  /// is often more convenient and readable.
99  HD_API
100  static HdContainerDataSourceHandle
102  const HdContainerDataSourceHandle &topology,
103  const HdTokenDataSourceHandle &subdivisionScheme,
104  const HdContainerDataSourceHandle &subdivisionTags,
105  const HdContainerDataSourceHandle &geomSubsets,
106  const HdBoolDataSourceHandle &doubleSided
107  );
108 
109  /// \class HdMeshSchema::Builder
110  ///
111  /// Utility class for setting sparse sets of child data source fields to be
112  /// filled as arguments into BuildRetained. Because all setter methods
113  /// return a reference to the instance, this can be used in the "builder
114  /// pattern" form.
115  class Builder
116  {
117  public:
118  HD_API
120  const HdContainerDataSourceHandle &topology);
121  HD_API
123  const HdTokenDataSourceHandle &subdivisionScheme);
124  HD_API
126  const HdContainerDataSourceHandle &subdivisionTags);
127  HD_API
129  const HdContainerDataSourceHandle &geomSubsets);
130  HD_API
132  const HdBoolDataSourceHandle &doubleSided);
133 
134  /// Returns a container data source containing the members set thus far.
135  HD_API
136  HdContainerDataSourceHandle Build();
137 
138  private:
139  HdContainerDataSourceHandle _topology;
140  HdTokenDataSourceHandle _subdivisionScheme;
141  HdContainerDataSourceHandle _subdivisionTags;
142  HdContainerDataSourceHandle _geomSubsets;
143  HdBoolDataSourceHandle _doubleSided;
144  };
145 
146  /// Retrieves a container data source with the schema's default name token
147  /// "mesh" from the parent container and constructs a
148  /// HdMeshSchema instance.
149  /// Because the requested container data source may not exist, the result
150  /// should be checked with IsDefined() or a bool comparison before use.
151  HD_API
153  const HdContainerDataSourceHandle &fromParentContainer);
154 
155  /// Returns a token where the container representing this schema is found in
156  /// a container by default.
157  HD_API
158  static const TfToken &GetSchemaToken();
159 
160  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
161  /// where the container representing this schema is found by default.
162  HD_API
163  static const HdDataSourceLocator &GetDefaultLocator();
164 
165  // DATA SOURCE LOCATORS FOR MEMBERS
166  //
167  // The following methods return an HdDataSourceLocator (relative to the
168  // prim-level data source) where the data source for a member can be found.
169  //
170  // This is often useful for checking intersection against the
171  // HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
172 
173 
174  /// Prim-level relative data source locator to locate topology.
175  HD_API
176  static const HdDataSourceLocator &GetTopologyLocator();
177 
178  /// Prim-level relative data source locator to locate subdivisionScheme.
179  HD_API
181 
182  /// Prim-level relative data source locator to locate subdivisionTags.
183  HD_API
185 
186  /// Prim-level relative data source locator to locate geomSubsets.
187  HD_API
189 
190  /// Prim-level relative data source locator to locate doubleSided.
191  HD_API
193 
194 
195 };
196 
198 
199 #endif
static HD_API const HdDataSourceLocator & GetSubdivisionTagsLocator()
Prim-level relative data source locator to locate subdivisionTags.
HdMeshSchema(HdContainerDataSourceHandle container)
Definition: meshSchema.h:68
HD_API Builder & SetSubdivisionTags(const HdContainerDataSourceHandle &subdivisionTags)
#define HD_API
Definition: api.h:40
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &topology, const HdTokenDataSourceHandle &subdivisionScheme, const HdContainerDataSourceHandle &subdivisionTags, const HdContainerDataSourceHandle &geomSubsets, const HdBoolDataSourceHandle &doubleSided)
HD_API Builder & SetSubdivisionScheme(const HdTokenDataSourceHandle &subdivisionScheme)
Definition: token.h:87
GT_API const UT_StringHolder topology
HD_API HdGeomSubsetsSchema GetGeomSubsets()
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API Builder & SetDoubleSided(const HdBoolDataSourceHandle &doubleSided)
static HD_API const TfToken & GetSchemaToken()
HD_API HdTokenDataSourceHandle GetSubdivisionScheme()
static HD_API const HdDataSourceLocator & GetDoubleSidedLocator()
Prim-level relative data source locator to locate doubleSided.
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetGeomSubsets(const HdContainerDataSourceHandle &geomSubsets)
static HD_API HdMeshSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdBoolDataSourceHandle GetDoubleSided()
TF_DECLARE_PUBLIC_TOKENS(HdMeshSchemaTokens, HD_API, HD_MESH_SCHEMA_TOKENS)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HD_API HdSubdivisionTagsSchema GetSubdivisionTags()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdMeshTopologySchema GetTopology()
static HD_API const HdDataSourceLocator & GetGeomSubsetsLocator()
Prim-level relative data source locator to locate geomSubsets.
static HD_API const HdDataSourceLocator & GetSubdivisionSchemeLocator()
Prim-level relative data source locator to locate subdivisionScheme.
HD_API Builder & SetTopology(const HdContainerDataSourceHandle &topology)
#define HD_MESH_SCHEMA_TOKENS
Definition: meshSchema.h:52
HdTokenDataSource::Handle HdTokenDataSourceHandle
static HD_API const HdDataSourceLocator & GetTopologyLocator()
Prim-level relative data source locator to locate topology.