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 2022 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 /* ************************************************************************** */
27 /* ** This file is generated by a script. Do not edit directly. Edit ** */
28 /* ** defs.py or the (*)Schema.template.h files to make changes. ** */
29 /* ************************************************************************** */
30 
31 #ifndef PXR_IMAGING_HD_INSTANCE_INDICES_SCHEMA_H
32 #define PXR_IMAGING_HD_INSTANCE_INDICES_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDINSTANCEINDICES_SCHEMA_TOKENS \
43  (instancer) \
44  (prototypeIndex) \
45  (instanceIndices) \
46 
47 TF_DECLARE_PUBLIC_TOKENS(HdInstanceIndicesSchemaTokens, HD_API,
49 
50 //-----------------------------------------------------------------------------
51 
53 {
54 public:
55  HdInstanceIndicesSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  //ACCESSORS
59 
60  HD_API
62  HD_API
64  HD_API
66 
67  // RETRIEVING AND CONSTRUCTING
68 
69  /// Builds a container data source which includes the provided child data
70  /// sources. Parameters with nullptr values are excluded. This is a
71  /// low-level interface. For cases in which it's desired to define
72  /// the container with a sparse set of child fields, the Builder class
73  /// is often more convenient and readable.
74  HD_API
75  static HdContainerDataSourceHandle
77  const HdPathDataSourceHandle &instancer,
78  const HdIntDataSourceHandle &prototypeIndex,
79  const HdIntArrayDataSourceHandle &instanceIndices
80  );
81 
82  /// \class HdInstanceIndicesSchema::Builder
83  ///
84  /// Utility class for setting sparse sets of child data source fields to be
85  /// filled as arguments into BuildRetained. Because all setter methods
86  /// return a reference to the instance, this can be used in the "builder
87  /// pattern" form.
88  class Builder
89  {
90  public:
91  HD_API
93  const HdPathDataSourceHandle &instancer);
94  HD_API
96  const HdIntDataSourceHandle &prototypeIndex);
97  HD_API
99  const HdIntArrayDataSourceHandle &instanceIndices);
100 
101  /// Returns a container data source containing the members set thus far.
102  HD_API
103  HdContainerDataSourceHandle Build();
104 
105  private:
106  HdPathDataSourceHandle _instancer;
107  HdIntDataSourceHandle _prototypeIndex;
108  HdIntArrayDataSourceHandle _instanceIndices;
109  };
110 
111 };
112 
114 
115 #endif
#define HDINSTANCEINDICES_SCHEMA_TOKENS
TF_DECLARE_PUBLIC_TOKENS(HdInstanceIndicesSchemaTokens, HD_API, HDINSTANCEINDICES_SCHEMA_TOKENS)
#define HD_API
Definition: api.h:40
HD_API Builder & SetInstanceIndices(const HdIntArrayDataSourceHandle &instanceIndices)
HdIntArrayDataSource::Handle HdIntArrayDataSourceHandle
HD_API HdPathDataSourceHandle GetInstancer()
HD_API HdIntDataSourceHandle GetPrototypeIndex()
HdInstanceIndicesSchema(HdContainerDataSourceHandle container)
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)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HD_API Builder & SetPrototypeIndex(const HdIntDataSourceHandle &prototypeIndex)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetInstancer(const HdPathDataSourceHandle &instancer)
HdIntDataSource::Handle HdIntDataSourceHandle
HD_API HdIntArrayDataSourceHandle GetInstanceIndices()
HdPathDataSource::Handle HdPathDataSourceHandle