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 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_TOPOLOGY_SCHEMA_H
36 #define PXR_IMAGING_HD_MESH_TOPOLOGY_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
41 
42 
43 // --(BEGIN CUSTOM CODE: Includes)--
44 // --(END CUSTOM CODE: Includes)--
45 
47 
48 //-----------------------------------------------------------------------------
49 
50 #define HD_MESH_TOPOLOGY_SCHEMA_TOKENS \
51  (topology) \
52  (faceVertexCounts) \
53  (faceVertexIndices) \
54  (holeIndices) \
55  (orientation) \
56  (leftHanded) \
57  (rightHanded) \
58 
59 TF_DECLARE_PUBLIC_TOKENS(HdMeshTopologySchemaTokens, HD_API,
61 
62 //-----------------------------------------------------------------------------
63 
65 {
66 public:
67  HdMeshTopologySchema(HdContainerDataSourceHandle container)
68  : HdSchema(container) {}
69 
70 // --(BEGIN CUSTOM CODE: Schema Methods)--
71 // --(END CUSTOM CODE: Schema Methods)--
72 
73  //ACCESSORS
74 
75  HD_API
77  HD_API
79  HD_API
81  HD_API
83 
84  // RETRIEVING AND CONSTRUCTING
85 
86  /// Builds a container data source which includes the provided child data
87  /// sources. Parameters with nullptr values are excluded. This is a
88  /// low-level interface. For cases in which it's desired to define
89  /// the container with a sparse set of child fields, the Builder class
90  /// is often more convenient and readable.
91  HD_API
92  static HdContainerDataSourceHandle
94  const HdIntArrayDataSourceHandle &faceVertexCounts,
95  const HdIntArrayDataSourceHandle &faceVertexIndices,
96  const HdIntArrayDataSourceHandle &holeIndices,
97  const HdTokenDataSourceHandle &orientation
98  );
99 
100  /// \class HdMeshTopologySchema::Builder
101  ///
102  /// Utility class for setting sparse sets of child data source fields to be
103  /// filled as arguments into BuildRetained. Because all setter methods
104  /// return a reference to the instance, this can be used in the "builder
105  /// pattern" form.
106  class Builder
107  {
108  public:
109  HD_API
111  const HdIntArrayDataSourceHandle &faceVertexCounts);
112  HD_API
114  const HdIntArrayDataSourceHandle &faceVertexIndices);
115  HD_API
117  const HdIntArrayDataSourceHandle &holeIndices);
118  HD_API
120  const HdTokenDataSourceHandle &orientation);
121 
122  /// Returns a container data source containing the members set thus far.
123  HD_API
124  HdContainerDataSourceHandle Build();
125 
126  private:
127  HdIntArrayDataSourceHandle _faceVertexCounts;
128  HdIntArrayDataSourceHandle _faceVertexIndices;
129  HdIntArrayDataSourceHandle _holeIndices;
130  HdTokenDataSourceHandle _orientation;
131  };
132 
133  /// Retrieves a container data source with the schema's default name token
134  /// "topology" from the parent container and constructs a
135  /// HdMeshTopologySchema instance.
136  /// Because the requested container data source may not exist, the result
137  /// should be checked with IsDefined() or a bool comparison before use.
138  HD_API
140  const HdContainerDataSourceHandle &fromParentContainer);
141 
142  /// Returns a token where the container representing this schema is found in
143  /// a container by default.
144  HD_API
145  static const TfToken &GetSchemaToken();
146 
147  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
148  /// where the container representing this schema is found by default.
149  HD_API
150  static const HdDataSourceLocator &GetDefaultLocator();
151 
152  /// Returns token data source for use as orientation value.
153  /// Values of...
154  /// - HdMeshTopologySchemaTokens->leftHanded
155  /// - HdMeshTopologySchemaTokens->rightHanded
156  /// ...will be stored statically and reused for future calls.
157  HD_API
159  const TfToken &orientation);
160 
161 };
162 
164 
165 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API Builder & SetFaceVertexCounts(const HdIntArrayDataSourceHandle &faceVertexCounts)
HD_API HdIntArrayDataSourceHandle GetFaceVertexCounts()
HD_API HdIntArrayDataSourceHandle GetFaceVertexIndices()
static HD_API HdMeshTopologySchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdMeshTopologySchema(HdContainerDataSourceHandle container)
#define HD_MESH_TOPOLOGY_SCHEMA_TOKENS
#define HD_API
Definition: api.h:40
HD_API HdTokenDataSourceHandle GetOrientation()
Definition: token.h:87
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)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetHoleIndices(const HdIntArrayDataSourceHandle &holeIndices)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
static HD_API HdTokenDataSourceHandle BuildOrientationDataSource(const TfToken &orientation)
HD_API HdIntArrayDataSourceHandle GetHoleIndices()
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntArrayDataSourceHandle &faceVertexCounts, const HdIntArrayDataSourceHandle &faceVertexIndices, const HdIntArrayDataSourceHandle &holeIndices, const HdTokenDataSourceHandle &orientation)
HdTokenDataSource::Handle HdTokenDataSourceHandle