HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
selectionSchema.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_SELECTION_SCHEMA_H
19 #define PXR_IMAGING_HD_SELECTION_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_SELECTION_SCHEMA_TOKENS \
37  (fullySelected) \
38  (nestedInstanceIndices) \
39 
40 TF_DECLARE_PUBLIC_TOKENS(HdSelectionSchemaTokens, HD_API,
42 
43 //-----------------------------------------------------------------------------
44 
45 
46 /// \class HdSelectionSchema
47 ///
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  HdSelectionSchema(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  /// Starting with the outer most, list for each nesting level of
69  /// instancing what instances are selected.
70  HD_API
72 
73  /// @}
74 
75  /// \name Schema construction
76  /// @{
77 
78  /// \deprecated Use Builder instead.
79  ///
80  /// Builds a container data source which includes the provided child data
81  /// sources. Parameters with nullptr values are excluded. This is a
82  /// low-level interface. For cases in which it's desired to define
83  /// the container with a sparse set of child fields, the Builder class
84  /// is often more convenient and readable.
85  HD_API
86  static HdContainerDataSourceHandle
88  const HdBoolDataSourceHandle &fullySelected,
89  const HdVectorDataSourceHandle &nestedInstanceIndices
90  );
91 
92  /// \class HdSelectionSchema::Builder
93  ///
94  /// Utility class for setting sparse sets of child data source fields to be
95  /// filled as arguments into BuildRetained. Because all setter methods
96  /// return a reference to the instance, this can be used in the "builder
97  /// pattern" form.
98  class Builder
99  {
100  public:
101  HD_API
103  const HdBoolDataSourceHandle &fullySelected);
104  HD_API
106  const HdVectorDataSourceHandle &nestedInstanceIndices);
107 
108  /// Returns a container data source containing the members set thus far.
109  HD_API
110  HdContainerDataSourceHandle Build();
111 
112  private:
113  HdBoolDataSourceHandle _fullySelected;
114  HdVectorDataSourceHandle _nestedInstanceIndices;
115 
116  };
117 
118  /// @}
119 };
120 
122 
123 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
#define HD_SELECTION_SCHEMA_TOKENS
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdInstanceIndicesVectorSchema GetNestedInstanceIndices() const
TF_DECLARE_PUBLIC_TOKENS(HdSelectionSchemaTokens, HD_API, HD_SELECTION_SCHEMA_TOKENS)
HD_API HdBoolDataSourceHandle GetFullySelected() const
HD_API Builder & SetNestedInstanceIndices(const HdVectorDataSourceHandle &nestedInstanceIndices)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdBoolDataSourceHandle &fullySelected, const HdVectorDataSourceHandle &nestedInstanceIndices)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetFullySelected(const HdBoolDataSourceHandle &fullySelected)
HdSelectionSchema(HdContainerDataSourceHandle container)