HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
meshTopologySchema.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_MESH_TOPOLOGY_SCHEMA_H
19 #define PXR_IMAGING_HD_MESH_TOPOLOGY_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
25 
26 #include "pxr/imaging/hd/schema.h"
27 
28 // --(BEGIN CUSTOM CODE: Includes)--
29 // --(END CUSTOM CODE: Includes)--
30 
32 
33 // --(BEGIN CUSTOM CODE: Declares)--
34 // --(END CUSTOM CODE: Declares)--
35 
36 #define HD_MESH_TOPOLOGY_SCHEMA_TOKENS \
37  (topology) \
38  (faceVertexCounts) \
39  (faceVertexIndices) \
40  (holeIndices) \
41  (orientation) \
42  (leftHanded) \
43  (rightHanded) \
44 
45 TF_DECLARE_PUBLIC_TOKENS(HdMeshTopologySchemaTokens, HD_API,
47 
48 //-----------------------------------------------------------------------------
49 
50 
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  HdMeshTopologySchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  /// Retrieves a container data source with the schema's default name token
61  /// "topology" from the parent container and constructs a
62  /// HdMeshTopologySchema 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  /// @}
90 
91  /// \name Schema location
92  /// @{
93 
94  /// Returns a token where the container representing this schema is found in
95  /// a container by default.
96  HD_API
97  static const TfToken &GetSchemaToken();
98 
99  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
100  /// where the container representing this schema is found by default.
101  HD_API
102  static const HdDataSourceLocator &GetDefaultLocator();
103 
104  /// @}
105 
106  /// \name Schema construction
107  /// @{
108 
109  /// \deprecated Use Builder instead.
110  ///
111  /// Builds a container data source which includes the provided child data
112  /// sources. Parameters with nullptr values are excluded. This is a
113  /// low-level interface. For cases in which it's desired to define
114  /// the container with a sparse set of child fields, the Builder class
115  /// is often more convenient and readable.
116  HD_API
117  static HdContainerDataSourceHandle
119  const HdIntArrayDataSourceHandle &faceVertexCounts,
120  const HdIntArrayDataSourceHandle &faceVertexIndices,
121  const HdIntArrayDataSourceHandle &holeIndices,
122  const HdTokenDataSourceHandle &orientation
123  );
124 
125  /// \class HdMeshTopologySchema::Builder
126  ///
127  /// Utility class for setting sparse sets of child data source fields to be
128  /// filled as arguments into BuildRetained. Because all setter methods
129  /// return a reference to the instance, this can be used in the "builder
130  /// pattern" form.
131  class Builder
132  {
133  public:
134  HD_API
136  const HdIntArrayDataSourceHandle &faceVertexCounts);
137  HD_API
139  const HdIntArrayDataSourceHandle &faceVertexIndices);
140  HD_API
142  const HdIntArrayDataSourceHandle &holeIndices);
143  HD_API
145  const HdTokenDataSourceHandle &orientation);
146 
147  /// Returns a container data source containing the members set thus far.
148  HD_API
149  HdContainerDataSourceHandle Build();
150 
151  private:
152  HdIntArrayDataSourceHandle _faceVertexCounts;
153  HdIntArrayDataSourceHandle _faceVertexIndices;
154  HdIntArrayDataSourceHandle _holeIndices;
155  HdTokenDataSourceHandle _orientation;
156 
157  };
158 
159  /// Returns token data source for use as orientation value.
160  ///
161  /// The following values will be stored statically and reused for future
162  /// calls:
163  /// - HdMeshTopologySchemaTokens->leftHanded
164  /// - HdMeshTopologySchemaTokens->rightHanded
165  HD_API
167  const TfToken &orientation);
168 
169  /// @}
170 };
171 
173 
174 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetFaceVertexCounts(const HdIntArrayDataSourceHandle &faceVertexCounts)
static HD_API HdMeshTopologySchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdTokenDataSourceHandle GetOrientation() const
HdMeshTopologySchema(HdContainerDataSourceHandle container)
#define HD_MESH_TOPOLOGY_SCHEMA_TOKENS
#define HD_API
Definition: api.h:23
HD_API HdIntArrayDataSourceHandle GetHoleIndices() const
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(HdMeshTopologySchemaTokens, HD_API, HD_MESH_TOPOLOGY_SCHEMA_TOKENS)
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
HD_API Builder & SetOrientation(const HdTokenDataSourceHandle &orientation)
static HD_API const TfToken & GetSchemaToken()
HD_API Builder & SetFaceVertexIndices(const HdIntArrayDataSourceHandle &faceVertexIndices)
HD_API HdIntArrayDataSourceHandle GetFaceVertexIndices() const
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetHoleIndices(const HdIntArrayDataSourceHandle &holeIndices)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API HdTokenDataSourceHandle BuildOrientationDataSource(const TfToken &orientation)
HD_API HdIntArrayDataSourceHandle GetFaceVertexCounts() const
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntArrayDataSourceHandle &faceVertexCounts, const HdIntArrayDataSourceHandle &faceVertexIndices, const HdIntArrayDataSourceHandle &holeIndices, const HdTokenDataSourceHandle &orientation)
HdTokenDataSource::Handle HdTokenDataSourceHandle