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 /* ** 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_MESH_SCHEMA_H
32 #define PXR_IMAGING_HD_MESH_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
39 
40 
42 
43 //-----------------------------------------------------------------------------
44 
45 #define HDMESH_SCHEMA_TOKENS \
46  (mesh) \
47  (topology) \
48  (subdivisionScheme) \
49  (subdivisionTags) \
50  (geomSubsets) \
51  (doubleSided) \
52 
53 TF_DECLARE_PUBLIC_TOKENS(HdMeshSchemaTokens, HD_API,
55 
56 //-----------------------------------------------------------------------------
57 
58 class HdMeshSchema : public HdSchema
59 {
60 public:
61  HdMeshSchema(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 
77  // RETRIEVING AND CONSTRUCTING
78 
79  /// Builds a container data source which includes the provided child data
80  /// sources. Parameters with nullptr values are excluded. This is a
81  /// low-level interface. For cases in which it's desired to define
82  /// the container with a sparse set of child fields, the Builder class
83  /// is often more convenient and readable.
84  HD_API
85  static HdContainerDataSourceHandle
87  const HdContainerDataSourceHandle &topology,
88  const HdTokenDataSourceHandle &subdivisionScheme,
89  const HdContainerDataSourceHandle &subdivisionTags,
90  const HdContainerDataSourceHandle &geomSubsets,
91  const HdBoolDataSourceHandle &doubleSided
92  );
93 
94  /// \class HdMeshSchema::Builder
95  ///
96  /// Utility class for setting sparse sets of child data source fields to be
97  /// filled as arguments into BuildRetained. Because all setter methods
98  /// return a reference to the instance, this can be used in the "builder
99  /// pattern" form.
100  class Builder
101  {
102  public:
103  HD_API
105  const HdContainerDataSourceHandle &topology);
106  HD_API
108  const HdTokenDataSourceHandle &subdivisionScheme);
109  HD_API
111  const HdContainerDataSourceHandle &subdivisionTags);
112  HD_API
114  const HdContainerDataSourceHandle &geomSubsets);
115  HD_API
117  const HdBoolDataSourceHandle &doubleSided);
118 
119  /// Returns a container data source containing the members set thus far.
120  HD_API
121  HdContainerDataSourceHandle Build();
122 
123  private:
124  HdContainerDataSourceHandle _topology;
125  HdTokenDataSourceHandle _subdivisionScheme;
126  HdContainerDataSourceHandle _subdivisionTags;
127  HdContainerDataSourceHandle _geomSubsets;
128  HdBoolDataSourceHandle _doubleSided;
129  };
130 
131  /// Retrieves a container data source with the schema's default name token
132  /// "mesh" from the parent container and constructs a
133  /// HdMeshSchema instance.
134  /// Because the requested container data source may not exist, the result
135  /// should be checked with IsDefined() or a bool comparison before use.
136  HD_API
138  const HdContainerDataSourceHandle &fromParentContainer);
139 
140  /// Returns a token where the container representing this schema is found in
141  /// a container by default.
142  HD_API
143  static const TfToken &GetSchemaToken();
144 
145  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
146  /// where the container representing this schema is found by default.
147  HD_API
148  static const HdDataSourceLocator &GetDefaultLocator();
149 
150 
151  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
152  /// where the topology data source can be found.
153  /// This is often useful for checking intersection against the
154  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
155  HD_API
156  static const HdDataSourceLocator &GetTopologyLocator();
157 
158  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
159  /// where the geomsubsets data source can be found.
160  /// This is often useful for checking intersection against the
161  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
162  HD_API
164 
165  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
166  /// where the doublesided data source can be found.
167  /// This is often useful for checking intersection against the
168  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
169  HD_API
171 
172  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
173  /// where the subdivisiontags data source can be found.
174  /// This is often useful for checking intersection against the
175  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
176  HD_API
178 
179  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
180  /// where the subdivisionscheme data source can be found.
181  /// This is often useful for checking intersection against the
182  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
183  HD_API
185 
186 };
187 
189 
190 #endif
#define HDMESH_SCHEMA_TOKENS
Definition: meshSchema.h:45
static HD_API const HdDataSourceLocator & GetSubdivisionTagsLocator()
HdMeshSchema(HdContainerDataSourceHandle container)
Definition: meshSchema.h:61
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()
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()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HD_API HdSubdivisionTagsSchema GetSubdivisionTags()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdMeshTopologySchema GetTopology()
static HD_API const HdDataSourceLocator & GetGeomSubsetsLocator()
static HD_API const HdDataSourceLocator & GetSubdivisionSchemeLocator()
TF_DECLARE_PUBLIC_TOKENS(HdMeshSchemaTokens, HD_API, HDMESH_SCHEMA_TOKENS)
HD_API Builder & SetTopology(const HdContainerDataSourceHandle &topology)
HdTokenDataSource::Handle HdTokenDataSourceHandle
static HD_API const HdDataSourceLocator & GetTopologyLocator()