HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
visibilitySchema.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_VISIBILITY_SCHEMA_H
19 #define PXR_IMAGING_HD_VISIBILITY_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_VISIBILITY_SCHEMA_TOKENS \
36  (visibility) \
37 
38 TF_DECLARE_PUBLIC_TOKENS(HdVisibilitySchemaTokens, HD_API,
40 
41 //-----------------------------------------------------------------------------
42 
43 
44 /// \class HdVisibilitySchema
45 ///
47 {
48 public:
49  /// \name Schema retrieval
50  /// @{
51 
52  HdVisibilitySchema(HdContainerDataSourceHandle container)
53  : HdSchema(container) {}
54 
55  /// Retrieves a container data source with the schema's default name token
56  /// "visibility" from the parent container and constructs a
57  /// HdVisibilitySchema 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 Schema construction
93  /// @{
94 
95  /// \deprecated Use Builder instead.
96  ///
97  /// Builds a container data source which includes the provided child data
98  /// sources. Parameters with nullptr values are excluded. This is a
99  /// low-level interface. For cases in which it's desired to define
100  /// the container with a sparse set of child fields, the Builder class
101  /// is often more convenient and readable.
102  HD_API
103  static HdContainerDataSourceHandle
105  const HdBoolDataSourceHandle &visibility
106  );
107 
108  /// \class HdVisibilitySchema::Builder
109  ///
110  /// Utility class for setting sparse sets of child data source fields to be
111  /// filled as arguments into BuildRetained. Because all setter methods
112  /// return a reference to the instance, this can be used in the "builder
113  /// pattern" form.
114  class Builder
115  {
116  public:
117  HD_API
119  const HdBoolDataSourceHandle &visibility);
120 
121  /// Returns a container data source containing the members set thus far.
122  HD_API
123  HdContainerDataSourceHandle Build();
124 
125  private:
126  HdBoolDataSourceHandle _visibility;
127 
128  };
129 
130  /// @}
131 };
132 
134 
135 #endif
static HD_API HdContainerDataSourceHandle BuildRetained(const HdBoolDataSourceHandle &visibility)
static HD_API HdVisibilitySchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
TF_DECLARE_PUBLIC_TOKENS(HdVisibilitySchemaTokens, HD_API, HD_VISIBILITY_SCHEMA_TOKENS)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
static HD_API const TfToken & GetSchemaToken()
#define HD_VISIBILITY_SCHEMA_TOKENS
Definition: token.h:70
HdBoolDataSource::Handle HdBoolDataSourceHandle
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdVisibilitySchema(HdContainerDataSourceHandle container)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdBoolDataSourceHandle GetVisibility() const
HD_API Builder & SetVisibility(const HdBoolDataSourceHandle &visibility)