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 
50 {
51 public:
52  /// \name Schema retrieval
53  /// @{
54 
55  HdTetMeshTopologySchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  /// Retrieves a container data source with the schema's default name token
59  /// "topology" from the parent container and constructs a
60  /// HdTetMeshTopologySchema instance.
61  /// Because the requested container data source may not exist, the result
62  /// should be checked with IsDefined() or a bool comparison before use.
63  HD_API
65  const HdContainerDataSourceHandle &fromParentContainer);
66 
67  /// @}
68 
69 // --(BEGIN CUSTOM CODE: Schema Methods)--
70 // --(END CUSTOM CODE: Schema Methods)--
71 
72  /// \name Member accessor
73  /// @{
74 
75  HD_API
77 
78  HD_API
80 
81  HD_API
83 
84  /// @}
85 
86  /// \name Schema location
87  /// @{
88 
89  /// Returns a token where the container representing this schema is found in
90  /// a container by default.
91  HD_API
92  static const TfToken &GetSchemaToken();
93 
94  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
95  /// where the container representing this schema is found by default.
96  HD_API
97  static const HdDataSourceLocator &GetDefaultLocator();
98 
99  /// @}
100 
101  /// \name Data source locators for members
102  ///
103  /// The following methods return an HdDataSourceLocator (relative to the
104  /// prim-level data source) where the data source for a member can be found.
105  ///
106  /// This is often useful for checking intersection against the
107  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
108  /// @{
109 
110  /// Prim-level relative data source locator to locate tetVertexIndices.
111  HD_API
113 
114  /// Prim-level relative data source locator to locate surfaceFaceVertexIndices.
115  HD_API
117  /// @}
118 
119  /// \name Schema construction
120  /// @{
121 
122  /// \deprecated Use Builder instead.
123  ///
124  /// Builds a container data source which includes the provided child data
125  /// sources. Parameters with nullptr values are excluded. This is a
126  /// low-level interface. For cases in which it's desired to define
127  /// the container with a sparse set of child fields, the Builder class
128  /// is often more convenient and readable.
129  HD_API
130  static HdContainerDataSourceHandle
132  const HdVec4iArrayDataSourceHandle &tetVertexIndices,
133  const HdVec3iArrayDataSourceHandle &surfaceFaceVertexIndices,
134  const HdTokenDataSourceHandle &orientation
135  );
136 
137  /// \class HdTetMeshTopologySchema::Builder
138  ///
139  /// Utility class for setting sparse sets of child data source fields to be
140  /// filled as arguments into BuildRetained. Because all setter methods
141  /// return a reference to the instance, this can be used in the "builder
142  /// pattern" form.
143  class Builder
144  {
145  public:
146  HD_API
148  const HdVec4iArrayDataSourceHandle &tetVertexIndices);
149  HD_API
151  const HdVec3iArrayDataSourceHandle &surfaceFaceVertexIndices);
152  HD_API
154  const HdTokenDataSourceHandle &orientation);
155 
156  /// Returns a container data source containing the members set thus far.
157  HD_API
158  HdContainerDataSourceHandle Build();
159 
160  private:
161  HdVec4iArrayDataSourceHandle _tetVertexIndices;
162  HdVec3iArrayDataSourceHandle _surfaceFaceVertexIndices;
163  HdTokenDataSourceHandle _orientation;
164 
165  };
166 
167  /// Returns token data source for use as orientation value.
168  ///
169  /// The following values will be stored statically and reused for future
170  /// calls:
171  /// - HdTetMeshTopologySchemaTokens->leftHanded
172  /// - HdTetMeshTopologySchemaTokens->rightHanded
173  HD_API
175  const TfToken &orientation);
176 
177  /// @}
178 };
179 
181 
182 #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
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
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
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)