instanceSchema.h
1 //
2 // Copyright 2021 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 //
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_INSTANCE_SCHEMA_H
29 #define PXR_IMAGING_HD_INSTANCE_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
33 #include "pxr/imaging/hd/schema.h"
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 //-----------------------------------------------------------------------------
38 
39 #define HDINSTANCE_SCHEMA_TOKENS \
40  (instancer) \
41  (path) \
42 
43 TF_DECLARE_PUBLIC_TOKENS(HdInstanceSchemaTokens, HD_API,
44  HDINSTANCE_SCHEMA_TOKENS);
45 
46 //-----------------------------------------------------------------------------
47 
48 // This schema can be considered the opposite of instancerTopology's
49 // "instanceLocations". When the scene coalesces scene prims into multiple
50 // instances of a single prototype, it inserts "instance" prims at the site
51 // of de-duplication. The instancer prim added to manage the prototype
52 // uses "instanceLocations" to point back to all of these instance prims.
53 //
54 // The instance prims aren't directly useful for rendering but can be useful
55 // for scene processing and data aggregation.
56 
57 
58 class HdInstanceSchema : public HdSchema
59 {
60 public:
61  HdInstanceSchema(HdContainerDataSourceHandle container)
62  : HdSchema(container) {}
63 
64  //ACCESSORS
65 
66  HD_API
67  HdPathArrayDataSourceHandle GetPath();
68 
69  // RETRIEVING AND CONSTRUCTING
70 
76  HD_API
77  static HdContainerDataSourceHandle
78  BuildRetained(
79  const HdPathArrayDataSourceHandle &path
80  );
81 
88  class Builder
89  {
90  public:
91  HD_API
92  Builder &SetPath(
93  const HdPathArrayDataSourceHandle &path);
94 
96  HD_API
97  HdContainerDataSourceHandle Build();
98 
99  private:
100  HdPathArrayDataSourceHandle _path;
101  };
102 
108  HD_API
109  static HdInstanceSchema GetFromParent(
110  const HdContainerDataSourceHandle &fromParentContainer);
111 
114  HD_API
115  static const HdDataSourceLocator &GetDefaultLocator();
116 
117 };
118 
119 PXR_NAMESPACE_CLOSE_SCOPE
120 
121 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
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:118
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:42