instanceSchema.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_INSTANCE_SCHEMA_H
19 #define PXR_IMAGING_HD_INSTANCE_SCHEMA_H
20 
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 
30 PXR_NAMESPACE_OPEN_SCOPE
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_INSTANCE_SCHEMA_TOKENS \
36  (instance) \
37  (instancer) \
38  (prototypeIndex) \
39  (instanceIndex) \
40 
41 TF_DECLARE_PUBLIC_TOKENS(HdInstanceSchemaTokens, HD_API,
42  HD_INSTANCE_SCHEMA_TOKENS);
43 
44 //-----------------------------------------------------------------------------
45 
46 
58 class HdInstanceSchema : public HdSchema
59 {
60 public:
63 
64  HdInstanceSchema(HdContainerDataSourceHandle container)
65  : HdSchema(container) {}
66 
72  HD_API
74  const HdContainerDataSourceHandle &fromParentContainer);
75 
77 
78 // --(BEGIN CUSTOM CODE: Schema Methods)--
79 // --(END CUSTOM CODE: Schema Methods)--
80 
83 
91  HD_API
92  HdPathDataSourceHandle GetInstancer() const;
93 
96  HD_API
97  HdIntDataSourceHandle GetPrototypeIndex() const;
98 
102  HD_API
103  HdIntDataSourceHandle GetInstanceIndex() const;
104 
106 
109 
112  HD_API
113  static const TfToken &GetSchemaToken();
114 
117  HD_API
118  static const HdDataSourceLocator &GetDefaultLocator();
119 
121 
124 
132  HD_API
133  static HdContainerDataSourceHandle
135  const HdPathDataSourceHandle &instancer,
136  const HdIntDataSourceHandle &prototypeIndex,
137  const HdIntDataSourceHandle &instanceIndex
138  );
139 
146  class Builder
147  {
148  public:
149  HD_API
150  Builder &SetInstancer(
151  const HdPathDataSourceHandle &instancer);
152  HD_API
153  Builder &SetPrototypeIndex(
154  const HdIntDataSourceHandle &prototypeIndex);
155  HD_API
156  Builder &SetInstanceIndex(
157  const HdIntDataSourceHandle &instanceIndex);
158 
160  HD_API
161  HdContainerDataSourceHandle Build();
162 
163  private:
164  HdPathDataSourceHandle _instancer;
165  HdIntDataSourceHandle _prototypeIndex;
166  HdIntDataSourceHandle _instanceIndex;
167 
168  };
169 
171 };
172 
173 PXR_NAMESPACE_CLOSE_SCOPE
174 
175 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
Represents an object that can identify the location of a data source.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:92
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Returns an HdDataSourceLocator (relative to the prim-level data source) where the container represent...
This schema can be considered the opposite of instancerTopology's "instanceLocations".
HD_API HdIntDataSourceHandle GetInstanceIndex() const
Index into int array within the vector data source at instancer's instancerTopology's instanceIndices...
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
static HD_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &instancer, const HdIntDataSourceHandle &prototypeIndex, const HdIntDataSourceHandle &instanceIndex)
HD_API HdIntDataSourceHandle GetPrototypeIndex() const
Index into vector data source at instancer's instancerTopology's instanceIndices to find entry corres...
HD_API HdPathDataSourceHandle GetInstancer() const
Path to instancer for which a (sub-)entry was added to its instancerTopology's instanceIndices during...
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:25
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 HdInstanceSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
Retrieves a container data source with the schema's default name token "instance" from the parent con...