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