HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
instanceIndicesSchema.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_INSTANCE_INDICES_SCHEMA_H
19 #define PXR_IMAGING_HD_INSTANCE_INDICES_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_INSTANCE_INDICES_SCHEMA_TOKENS \
36  (instancer) \
37  (prototypeIndex) \
38  (instanceIndices) \
39 
40 TF_DECLARE_PUBLIC_TOKENS(HdInstanceIndicesSchemaTokens, HD_API,
42 
43 //-----------------------------------------------------------------------------
44 
45 
46 /// \class HdInstanceIndicesSchema
47 ///
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  HdInstanceIndicesSchema(HdContainerDataSourceHandle container)
55  : HdSchema(container) {}
56 
57  /// @}
58 
59 // --(BEGIN CUSTOM CODE: Schema Methods)--
60 // --(END CUSTOM CODE: Schema Methods)--
61 
62  /// \name Member accessor
63  /// @{
64 
65  HD_API
67 
68  HD_API
70 
71  HD_API
73 
74  /// @}
75 
76  /// \name Schema construction
77  /// @{
78 
79  /// \deprecated Use Builder instead.
80  ///
81  /// Builds a container data source which includes the provided child data
82  /// sources. Parameters with nullptr values are excluded. This is a
83  /// low-level interface. For cases in which it's desired to define
84  /// the container with a sparse set of child fields, the Builder class
85  /// is often more convenient and readable.
86  HD_API
87  static HdContainerDataSourceHandle
89  const HdPathDataSourceHandle &instancer,
90  const HdIntDataSourceHandle &prototypeIndex,
91  const HdIntArrayDataSourceHandle &instanceIndices
92  );
93 
94  /// \class HdInstanceIndicesSchema::Builder
95  ///
96  /// Utility class for setting sparse sets of child data source fields to be
97  /// filled as arguments into BuildRetained. Because all setter methods
98  /// return a reference to the instance, this can be used in the "builder
99  /// pattern" form.
100  class Builder
101  {
102  public:
103  HD_API
105  const HdPathDataSourceHandle &instancer);
106  HD_API
108  const HdIntDataSourceHandle &prototypeIndex);
109  HD_API
111  const HdIntArrayDataSourceHandle &instanceIndices);
112 
113  /// Returns a container data source containing the members set thus far.
114  HD_API
115  HdContainerDataSourceHandle Build();
116 
117  private:
118  HdPathDataSourceHandle _instancer;
119  HdIntDataSourceHandle _prototypeIndex;
120  HdIntArrayDataSourceHandle _instanceIndices;
121 
122  };
123 
124  /// @}
125 };
126 
128 
129 #endif
#define HD_INSTANCE_INDICES_SCHEMA_TOKENS
HD_API HdIntArrayDataSourceHandle GetInstanceIndices() const
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
HD_API Builder & SetInstanceIndices(const HdIntArrayDataSourceHandle &instanceIndices)
HD_API HdIntDataSourceHandle GetPrototypeIndex() const
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
HdInstanceIndicesSchema(HdContainerDataSourceHandle container)
HD_API HdPathDataSourceHandle GetInstancer() const
TF_DECLARE_PUBLIC_TOKENS(HdInstanceIndicesSchemaTokens, HD_API, HD_INSTANCE_INDICES_SCHEMA_TOKENS)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &instancer, const HdIntDataSourceHandle &prototypeIndex, const HdIntArrayDataSourceHandle &instanceIndices)
HD_API Builder & SetPrototypeIndex(const HdIntDataSourceHandle &prototypeIndex)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetInstancer(const HdPathDataSourceHandle &instancer)
HdIntDataSource::Handle HdIntDataSourceHandle
HdPathDataSource::Handle HdPathDataSourceHandle