HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tetMeshTopologySchema.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_TET_MESH_TOPOLOGY_SCHEMA_H
19 #define PXR_IMAGING_HD_TET_MESH_TOPOLOGY_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_TET_MESH_TOPOLOGY_SCHEMA_TOKENS \
36  (topology) \
37  (tetVertexIndices) \
38  (surfaceFaceVertexIndices) \
39  (orientation) \
40  (leftHanded) \
41  (rightHanded) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdTetMeshTopologySchemaTokens, HD_API,
45 
46 //-----------------------------------------------------------------------------
47 
48 
49 /// \class HdTetMeshTopologySchema
50 ///
52 {
53 public:
54  /// \name Schema retrieval
55  /// @{
56 
57  HdTetMeshTopologySchema(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  /// HdTetMeshTopologySchema 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  /// @}
87 
88  /// \name Schema location
89  /// @{
90 
91  /// Returns a token where the container representing this schema is found in
92  /// a container by default.
93  HD_API
94  static const TfToken &GetSchemaToken();
95 
96  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
97  /// where the container representing this schema is found by default.
98  HD_API
99  static const HdDataSourceLocator &GetDefaultLocator();
100 
101  /// @}
102 
103  /// \name Data source locators for members
104  ///
105  /// The following methods return an HdDataSourceLocator (relative to the
106  /// prim-level data source) where the data source for a member can be found.
107  ///
108  /// This is often useful for checking intersection against the
109  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
110  /// @{
111 
112  /// Prim-level relative data source locator to locate tetVertexIndices.
113  HD_API
115 
116  /// Prim-level relative data source locator to locate surfaceFaceVertexIndices.
117  HD_API
119  /// @}
120 
121  /// \name Schema construction
122  /// @{
123 
124  /// \deprecated Use Builder instead.
125  ///
126  /// Builds a container data source which includes the provided child data
127  /// sources. Parameters with nullptr values are excluded. This is a
128  /// low-level interface. For cases in which it's desired to define
129  /// the container with a sparse set of child fields, the Builder class
130  /// is often more convenient and readable.
131  HD_API
132  static HdContainerDataSourceHandle
134  const HdVec4iArrayDataSourceHandle &tetVertexIndices,
135  const HdVec3iArrayDataSourceHandle &surfaceFaceVertexIndices,
136  const HdTokenDataSourceHandle &orientation
137  );
138 
139  /// \class HdTetMeshTopologySchema::Builder
140  ///
141  /// Utility class for setting sparse sets of child data source fields to be
142  /// filled as arguments into BuildRetained. Because all setter methods
143  /// return a reference to the instance, this can be used in the "builder
144  /// pattern" form.
145  class Builder
146  {
147  public:
148  HD_API
150  const HdVec4iArrayDataSourceHandle &tetVertexIndices);
151  HD_API
153  const HdVec3iArrayDataSourceHandle &surfaceFaceVertexIndices);
154  HD_API
156  const HdTokenDataSourceHandle &orientation);
157 
158  /// Returns a container data source containing the members set thus far.
159  HD_API
160  HdContainerDataSourceHandle Build();
161 
162  private:
163  HdVec4iArrayDataSourceHandle _tetVertexIndices;
164  HdVec3iArrayDataSourceHandle _surfaceFaceVertexIndices;
165  HdTokenDataSourceHandle _orientation;
166 
167  };
168 
169  /// Returns token data source for use as orientation value.
170  ///
171  /// The following values will be stored statically and reused for future
172  /// calls:
173  /// - HdTetMeshTopologySchemaTokens->leftHanded
174  /// - HdTetMeshTopologySchemaTokens->rightHanded
175  HD_API
177  const TfToken &orientation);
178 
179  /// @}
180 };
181 
183 
184 #endif
static HD_API const TfToken & GetSchemaToken()
static HD_API const HdDataSourceLocator & GetTetVertexIndicesLocator()
Prim-level relative data source locator to locate tetVertexIndices.
HD_API HdTokenDataSourceHandle GetOrientation() const
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HD_API Builder & SetSurfaceFaceVertexIndices(const HdVec3iArrayDataSourceHandle &surfaceFaceVertexIndices)
static HD_API const HdDataSourceLocator & GetSurfaceFaceVertexIndicesLocator()
Prim-level relative data source locator to locate surfaceFaceVertexIndices.
TF_DECLARE_PUBLIC_TOKENS(HdTetMeshTopologySchemaTokens, HD_API, HD_TET_MESH_TOPOLOGY_SCHEMA_TOKENS)
#define HD_API
Definition: api.h:23
HD_API HdVec3iArrayDataSourceHandle GetSurfaceFaceVertexIndices() const
HdVec4iArrayDataSource::Handle HdVec4iArrayDataSourceHandle
Definition: token.h:70
HD_API Builder & SetOrientation(const HdTokenDataSourceHandle &orientation)
HD_API Builder & SetTetVertexIndices(const HdVec4iArrayDataSourceHandle &tetVertexIndices)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
static HD_API HdContainerDataSourceHandle BuildRetained(const HdVec4iArrayDataSourceHandle &tetVertexIndices, const HdVec3iArrayDataSourceHandle &surfaceFaceVertexIndices, const HdTokenDataSourceHandle &orientation)
HdVec3iArrayDataSource::Handle HdVec3iArrayDataSourceHandle
HdTetMeshTopologySchema(HdContainerDataSourceHandle container)
#define HD_TET_MESH_TOPOLOGY_SCHEMA_TOKENS
static HD_API HdTokenDataSourceHandle BuildOrientationDataSource(const TfToken &orientation)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdVec4iArrayDataSourceHandle GetTetVertexIndices() const
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdTokenDataSource::Handle HdTokenDataSourceHandle
static HD_API HdTetMeshTopologySchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)