HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
integratorSchema.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_INTEGRATOR_SCHEMA_H
19 #define PXR_IMAGING_HD_INTEGRATOR_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_INTEGRATOR_SCHEMA_TOKENS \
37  (integrator) \
38  (resource) \
39 
40 TF_DECLARE_PUBLIC_TOKENS(HdIntegratorSchemaTokens, HD_API,
42 
43 //-----------------------------------------------------------------------------
44 
45 
47 {
48 public:
49  /// \name Schema retrieval
50  /// @{
51 
52  HdIntegratorSchema(HdContainerDataSourceHandle container)
53  : HdSchema(container) {}
54 
55  /// Retrieves a container data source with the schema's default name token
56  /// "integrator" from the parent container and constructs a
57  /// HdIntegratorSchema instance.
58  /// Because the requested container data source may not exist, the result
59  /// should be checked with IsDefined() or a bool comparison before use.
60  HD_API
62  const HdContainerDataSourceHandle &fromParentContainer);
63 
64  /// @}
65 
66 // --(BEGIN CUSTOM CODE: Schema Methods)--
67 // --(END CUSTOM CODE: Schema Methods)--
68 
69  /// \name Member accessor
70  /// @{
71 
72  HD_API
74 
75  /// @}
76 
77  /// \name Schema location
78  /// @{
79 
80  /// Returns a token where the container representing this schema is found in
81  /// a container by default.
82  HD_API
83  static const TfToken &GetSchemaToken();
84 
85  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
86  /// where the container representing this schema is found by default.
87  HD_API
88  static const HdDataSourceLocator &GetDefaultLocator();
89 
90  /// @}
91 
92  /// \name Data source locators for members
93  ///
94  /// The following methods return an HdDataSourceLocator (relative to the
95  /// prim-level data source) where the data source for a member can be found.
96  ///
97  /// This is often useful for checking intersection against the
98  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
99  /// @{
100 
101  /// Prim-level relative data source locator to locate resource.
102  HD_API
103  static const HdDataSourceLocator &GetResourceLocator();
104  /// @}
105 
106  /// \name Schema construction
107  /// @{
108 
109  /// \deprecated Use Builder instead.
110  ///
111  /// Builds a container data source which includes the provided child data
112  /// sources. Parameters with nullptr values are excluded. This is a
113  /// low-level interface. For cases in which it's desired to define
114  /// the container with a sparse set of child fields, the Builder class
115  /// is often more convenient and readable.
116  HD_API
117  static HdContainerDataSourceHandle
119  const HdContainerDataSourceHandle &resource
120  );
121 
122  /// \class HdIntegratorSchema::Builder
123  ///
124  /// Utility class for setting sparse sets of child data source fields to be
125  /// filled as arguments into BuildRetained. Because all setter methods
126  /// return a reference to the instance, this can be used in the "builder
127  /// pattern" form.
128  class Builder
129  {
130  public:
131  HD_API
133  const HdContainerDataSourceHandle &resource);
134 
135  /// Returns a container data source containing the members set thus far.
136  HD_API
137  HdContainerDataSourceHandle Build();
138 
139  private:
140  HdContainerDataSourceHandle _resource;
141 
142  };
143 
144  /// @}
145 };
146 
148 
149 #endif
static HD_API HdIntegratorSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define HD_INTEGRATOR_SCHEMA_TOKENS
#define HD_API
Definition: api.h:23
Definition: token.h:70
TF_DECLARE_PUBLIC_TOKENS(HdIntegratorSchemaTokens, HD_API, HD_INTEGRATOR_SCHEMA_TOKENS)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API const TfToken & GetSchemaToken()
static HD_API const HdDataSourceLocator & GetResourceLocator()
Prim-level relative data source locator to locate resource.
HD_API HdMaterialNodeSchema GetResource() const
HdIntegratorSchema(HdContainerDataSourceHandle container)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HD_API HdContainerDataSourceHandle BuildRetained(const HdContainerDataSourceHandle &resource)
HD_API Builder & SetResource(const HdContainerDataSourceHandle &resource)
static HD_API const HdDataSourceLocator & GetDefaultLocator()