instancerTopologySchema.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 //
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_INSTANCER_TOPOLOGY_SCHEMA_H
19 #define PXR_IMAGING_HD_INSTANCER_TOPOLOGY_SCHEMA_H
20 
22 
23 #include "pxr/imaging/hd/api.h"
24 #include "pxr/imaging/hd/schemaTypeDefs.h"
25 
26 #include "pxr/imaging/hd/schema.h"
27 
28 // --(BEGIN CUSTOM CODE: Includes)--
29 // --(END CUSTOM CODE: Includes)--
30 
31 PXR_NAMESPACE_OPEN_SCOPE
32 
33 // --(BEGIN CUSTOM CODE: Declares)--
34 // --(END CUSTOM CODE: Declares)--
35 
36 #define HD_INSTANCER_TOPOLOGY_SCHEMA_TOKENS \
37  (instancerTopology) \
38  (prototypes) \
39  (instanceIndices) \
40  (mask) \
41  (instanceLocations) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdInstancerTopologySchemaTokens, HD_API,
44  HD_INSTANCER_TOPOLOGY_SCHEMA_TOKENS);
45 
46 //-----------------------------------------------------------------------------
47 
48 
93 {
94 public:
97 
98  HdInstancerTopologySchema(HdContainerDataSourceHandle container)
99  : HdSchema(container) {}
100 
106  HD_API
108  const HdContainerDataSourceHandle &fromParentContainer);
109 
111 
112 // --(BEGIN CUSTOM CODE: Schema Methods)--
113 
114  HD_API
115  VtArray<int> ComputeInstanceIndicesForProto(SdfPath const &path) const;
116 
117 // --(END CUSTOM CODE: Schema Methods)--
118 
121 
122  HD_API
123  HdPathArrayDataSourceHandle GetPrototypes() const;
124 
125  HD_API
126  HdIntArrayVectorSchema GetInstanceIndices() const;
127 
128  HD_API
129  HdBoolArrayDataSourceHandle GetMask() const;
130 
131  HD_API
132  HdPathArrayDataSourceHandle GetInstanceLocations() const;
133 
135 
138 
141  HD_API
142  static const TfToken &GetSchemaToken();
143 
146  HD_API
147  static const HdDataSourceLocator &GetDefaultLocator();
148 
150 
153 
161  HD_API
162  static HdContainerDataSourceHandle
164  const HdPathArrayDataSourceHandle &prototypes,
165  const HdVectorDataSourceHandle &instanceIndices,
166  const HdBoolArrayDataSourceHandle &mask,
167  const HdPathArrayDataSourceHandle &instanceLocations
168  );
169 
176  class Builder
177  {
178  public:
179  HD_API
180  Builder &SetPrototypes(
181  const HdPathArrayDataSourceHandle &prototypes);
182  HD_API
183  Builder &SetInstanceIndices(
184  const HdVectorDataSourceHandle &instanceIndices);
185  HD_API
186  Builder &SetMask(
187  const HdBoolArrayDataSourceHandle &mask);
188  HD_API
189  Builder &SetInstanceLocations(
190  const HdPathArrayDataSourceHandle &instanceLocations);
191 
193  HD_API
194  HdContainerDataSourceHandle Build();
195 
196  private:
197  HdPathArrayDataSourceHandle _prototypes;
198  HdVectorDataSourceHandle _instanceIndices;
199  HdBoolArrayDataSourceHandle _mask;
200  HdPathArrayDataSourceHandle _instanceLocations;
201 
202  };
203 
205 };
206 
207 PXR_NAMESPACE_CLOSE_SCOPE
208 
209 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API HdInstancerTopologySchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
Retrieves a container data source with the schema's default name token "instancerTopology" from the p...
Since the instancing schema is complicated:
Template class wrapping a vector data source whose children are data source of an expected type.
Definition: vectorSchema.h:65
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
Represents an object that can identify the location of a data source.
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Returns an HdDataSourceLocator (relative to the prim-level data source) where the container represent...
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:92
static HD_API const TfToken & GetSchemaToken()
Returns a token where the container representing this schema is found in a container by default.
static HD_API HdContainerDataSourceHandle BuildRetained(const HdPathArrayDataSourceHandle &prototypes, const HdVectorDataSourceHandle &instanceIndices, const HdBoolArrayDataSourceHandle &mask, const HdPathArrayDataSourceHandle &instanceLocations)
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:213
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:25