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 
51 /// \class HdMeshTopologySchema
52 ///
54 {
55 public:
56  /// \name Schema retrieval
57  /// @{
58 
59  HdMeshTopologySchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  /// Retrieves a container data source with the schema's default name token
63  /// "topology" from the parent container and constructs a
64  /// HdMeshTopologySchema instance.
65  /// Because the requested container data source may not exist, the result
66  /// should be checked with IsDefined() or a bool comparison before use.
67  HD_API
69  const HdContainerDataSourceHandle &fromParentContainer);
70 
71  /// @}
72 
73 // --(BEGIN CUSTOM CODE: Schema Methods)--
74 // --(END CUSTOM CODE: Schema Methods)--
75 
76  /// \name Member accessor
77  /// @{
78 
79  HD_API
81 
82  HD_API
84 
85  HD_API
87 
88  HD_API
90 
91  /// @}
92 
93  /// \name Schema location
94  /// @{
95 
96  /// Returns a token where the container representing this schema is found in
97  /// a container by default.
98  HD_API
99  static const TfToken &GetSchemaToken();
100 
101  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
102  /// where the container representing this schema is found by default.
103  HD_API
104  static const HdDataSourceLocator &GetDefaultLocator();
105 
106  /// @}
107 
108  /// \name Schema construction
109  /// @{
110 
111  /// \deprecated Use Builder instead.
112  ///
113  /// Builds a container data source which includes the provided child data
114  /// sources. Parameters with nullptr values are excluded. This is a
115  /// low-level interface. For cases in which it's desired to define
116  /// the container with a sparse set of child fields, the Builder class
117  /// is often more convenient and readable.
118  HD_API
119  static HdContainerDataSourceHandle
121  const HdIntArrayDataSourceHandle &faceVertexCounts,
122  const HdIntArrayDataSourceHandle &faceVertexIndices,
123  const HdIntArrayDataSourceHandle &holeIndices,
124  const HdTokenDataSourceHandle &orientation
125  );
126 
127  /// \class HdMeshTopologySchema::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 HdIntArrayDataSourceHandle &faceVertexCounts);
139  HD_API
141  const HdIntArrayDataSourceHandle &faceVertexIndices);
142  HD_API
144  const HdIntArrayDataSourceHandle &holeIndices);
145  HD_API
147  const HdTokenDataSourceHandle &orientation);
148 
149  /// Returns a container data source containing the members set thus far.
150  HD_API
151  HdContainerDataSourceHandle Build();
152 
153  private:
154  HdIntArrayDataSourceHandle _faceVertexCounts;
155  HdIntArrayDataSourceHandle _faceVertexIndices;
156  HdIntArrayDataSourceHandle _holeIndices;
157  HdTokenDataSourceHandle _orientation;
158 
159  };
160 
161  /// Returns token data source for use as orientation value.
162  ///
163  /// The following values will be stored statically and reused for future
164  /// calls:
165  /// - HdMeshTopologySchemaTokens->leftHanded
166  /// - HdMeshTopologySchemaTokens->rightHanded
167  HD_API
169  const TfToken &orientation);
170 
171  /// @}
172 };
173 
175 
176 #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
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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)
#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