HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tetMeshSchema.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_SCHEMA_H
19 #define PXR_IMAGING_HD_TET_MESH_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_TET_MESH_SCHEMA_TOKENS \
37  (tetMesh) \
38  (topology) \
39  (doubleSided) \
40 
41 TF_DECLARE_PUBLIC_TOKENS(HdTetMeshSchemaTokens, HD_API,
43 
44 //-----------------------------------------------------------------------------
45 
46 
47 /// \class HdTetMeshSchema
48 ///
49 class HdTetMeshSchema : public HdSchema
50 {
51 public:
52  /// \name Schema retrieval
53  /// @{
54 
55  HdTetMeshSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  /// Retrieves a container data source with the schema's default name token
59  /// "tetMesh" from the parent container and constructs a
60  /// HdTetMeshSchema 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  /// @}
82 
83  /// \name Schema location
84  /// @{
85 
86  /// Returns a token where the container representing this schema is found in
87  /// a container by default.
88  HD_API
89  static const TfToken &GetSchemaToken();
90 
91  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
92  /// where the container representing this schema is found by default.
93  HD_API
94  static const HdDataSourceLocator &GetDefaultLocator();
95 
96  /// @}
97 
98  /// \name Data source locators for members
99  ///
100  /// The following methods return an HdDataSourceLocator (relative to the
101  /// prim-level data source) where the data source for a member can be found.
102  ///
103  /// This is often useful for checking intersection against the
104  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
105  /// @{
106 
107  /// Prim-level relative data source locator to locate topology.
108  HD_API
109  static const HdDataSourceLocator &GetTopologyLocator();
110 
111  /// Prim-level relative data source locator to locate doubleSided.
112  HD_API
114  /// @}
115 
116  /// \name Schema construction
117  /// @{
118 
119  /// \deprecated Use Builder instead.
120  ///
121  /// Builds a container data source which includes the provided child data
122  /// sources. Parameters with nullptr values are excluded. This is a
123  /// low-level interface. For cases in which it's desired to define
124  /// the container with a sparse set of child fields, the Builder class
125  /// is often more convenient and readable.
126  HD_API
127  static HdContainerDataSourceHandle
129  const HdContainerDataSourceHandle &topology,
130  const HdBoolDataSourceHandle &doubleSided
131  );
132 
133  /// \class HdTetMeshSchema::Builder
134  ///
135  /// Utility class for setting sparse sets of child data source fields to be
136  /// filled as arguments into BuildRetained. Because all setter methods
137  /// return a reference to the instance, this can be used in the "builder
138  /// pattern" form.
139  class Builder
140  {
141  public:
142  HD_API
144  const HdContainerDataSourceHandle &topology);
145  HD_API
147  const HdBoolDataSourceHandle &doubleSided);
148 
149  /// Returns a container data source containing the members set thus far.
150  HD_API
151  HdContainerDataSourceHandle Build();
152 
153  private:
154  HdContainerDataSourceHandle _topology;
155  HdBoolDataSourceHandle _doubleSided;
156 
157  };
158 
159  /// @}
160 };
161 
163 
164 #endif
HD_API Builder & SetDoubleSided(const HdBoolDataSourceHandle &doubleSided)
HD_API HdBoolDataSourceHandle GetDoubleSided() const
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HdTetMeshSchema(HdContainerDataSourceHandle container)
Definition: tetMeshSchema.h:55
#define HD_API
Definition: api.h:23
static HD_API HdTetMeshSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Definition: token.h:70
static HD_API const HdDataSourceLocator & GetDoubleSidedLocator()
Prim-level relative data source locator to locate doubleSided.
HD_API Builder & SetTopology(const HdContainerDataSourceHandle &topology)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
GT_API const UT_StringHolder topology
HdBoolDataSource::Handle HdBoolDataSourceHandle
static HD_API const HdDataSourceLocator & GetTopologyLocator()
Prim-level relative data source locator to locate topology.
TF_DECLARE_PUBLIC_TOKENS(HdTetMeshSchemaTokens, HD_API, HD_TET_MESH_SCHEMA_TOKENS)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdTetMeshTopologySchema GetTopology() const
static HD_API const TfToken & GetSchemaToken()
#define HD_TET_MESH_SCHEMA_TOKENS
Definition: tetMeshSchema.h:36
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &topology, const HdBoolDataSourceHandle &doubleSided)