All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
30PXR_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
41TF_DECLARE_PUBLIC_TOKENS(HdInstanceSchemaTokens, HD_API,
42 HD_INSTANCE_SCHEMA_TOKENS);
43
44//-----------------------------------------------------------------------------
45
46// This schema can be considered the opposite of instancerTopology's
47// "instanceLocations". When the scene coalesces scene prims into multiple
48// instances of a single prototype, it inserts "instance" prims at the site of
49// de-duplication. The instancer prim added to manage the prototype uses
50// "instanceLocations" to point back to all of these instance prims.
51//
52// The instance prims aren't directly useful for rendering but can be useful
53// for scene processing and data aggregation.
54//
55
56class HdInstanceSchema : public HdSchema
57{
58public:
61
62 HdInstanceSchema(HdContainerDataSourceHandle container)
63 : HdSchema(container) {}
64
70 HD_API
71 static HdInstanceSchema GetFromParent(
72 const HdContainerDataSourceHandle &fromParentContainer);
73
75
76// --(BEGIN CUSTOM CODE: Schema Methods)--
77// --(END CUSTOM CODE: Schema Methods)--
78
81
89 HD_API
90 HdPathDataSourceHandle GetInstancer() const;
91
94 HD_API
95 HdIntDataSourceHandle GetPrototypeIndex() const;
96
100 HD_API
101 HdIntDataSourceHandle GetInstanceIndex() const;
102
104
107
110 HD_API
111 static const TfToken &GetSchemaToken();
112
115 HD_API
116 static const HdDataSourceLocator &GetDefaultLocator();
117
119
122
130 HD_API
131 static HdContainerDataSourceHandle
132 BuildRetained(
133 const HdPathDataSourceHandle &instancer,
134 const HdIntDataSourceHandle &prototypeIndex,
135 const HdIntDataSourceHandle &instanceIndex
136 );
137
145 {
146 public:
147 HD_API
148 Builder &SetInstancer(
149 const HdPathDataSourceHandle &instancer);
150 HD_API
151 Builder &SetPrototypeIndex(
152 const HdIntDataSourceHandle &prototypeIndex);
153 HD_API
154 Builder &SetInstanceIndex(
155 const HdIntDataSourceHandle &instanceIndex);
156
158 HD_API
159 HdContainerDataSourceHandle Build();
160
161 private:
162 HdPathDataSourceHandle _instancer;
163 HdIntDataSourceHandle _prototypeIndex;
164 HdIntDataSourceHandle _instanceIndex;
165
166 };
167
169};
170
171PXR_NAMESPACE_CLOSE_SCOPE
172
173#endif
Represents an object that can identify the location of a data source.
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:26
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81