HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
systemSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 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 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 /* ************************************************************************** */
27 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_SYSTEM_SCHEMA_H
36 #define PXR_IMAGING_HD_SYSTEM_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
40 #include "pxr/imaging/hd/schema.h"
41 
42 // --(BEGIN CUSTOM CODE: Includes)--
44 // --(END CUSTOM CODE: Includes)--
45 
47 
48 //-----------------------------------------------------------------------------
49 
50 // --(BEGIN CUSTOM CODE: Declares)--
52 // --(END CUSTOM CODE: Declares)--
53 
54 //-----------------------------------------------------------------------------
55 
56 #define HD_SYSTEM_SCHEMA_TOKENS \
57  (system) \
58 
59 TF_DECLARE_PUBLIC_TOKENS(HdSystemSchemaTokens, HD_API,
61 
62 //-----------------------------------------------------------------------------
63 // The HdSystemSchema specifies a container that will hold "system" data. Each
64 // piece of system data is identified by a key within the container. A piece
65 // of system data is evaluated at a given location by walking up the namespace
66 // looking for a system container that contains the corresponding key.
67 //
68 class HdSystemSchema : public HdSchema
69 {
70 public:
71  HdSystemSchema(HdContainerDataSourceHandle container)
72  : HdSchema(container) {}
73 
74 // --(BEGIN CUSTOM CODE: Schema Methods)--
75 
76  /// Evaluates the \p key at \p fromPath. If \p key is found, the return
77  /// value will be non-null and \p foundAtPath will contain the path at
78  /// which the non-null result was found. Otherwise, this returns null.
79  ///
80  /// This operation will be linear in the length of \p fromPath.
81  HD_API
82  static HdDataSourceBaseHandle GetFromPath(
83  HdSceneIndexBaseRefPtr const &inputScene,
84  SdfPath const &fromPath,
85  TfToken const &key,
86  SdfPath *foundAtPath);
87 
88  /// Composes the system container in at \p fromPath by walking up the
89  /// prim.dataSources in \p inputScene and composing any system containers
90  /// it encounters.
91  ///
92  /// If no system containers were found, this returns null.
93  /// Otherwise, this will return a container data source with the composed
94  /// system data sources. If non-null, \p foundAtPath will be the last prim
95  /// at which system data was found.
96  HD_API
97  static HdContainerDataSourceHandle Compose(
98  HdSceneIndexBaseRefPtr const &inputScene,
99  SdfPath const &fromPath,
100  SdfPath *foundAtPath);
101 
102  /// Similar to `Compose` but this return value would be suitable for using
103  /// with HdOverlayContainerDataSource for a prim's dataSource:
104  /// ```
105  /// prim.dataSource = HdOverlayContainerDataSource::New(
106  /// HdSystemSchema::ComposeAsPrimDataSource(...),
107  /// prim.dataSource);
108  /// ```
109  HD_API
110  static HdContainerDataSourceHandle ComposeAsPrimDataSource(
111  HdSceneIndexBaseRefPtr const &inputScene,
112  SdfPath const &fromPath,
113  SdfPath *foundAtPath);
114 
115 // --(END CUSTOM CODE: Schema Methods)--
116 
117 
118  /// Retrieves a container data source with the schema's default name token
119  /// "system" from the parent container and constructs a
120  /// HdSystemSchema instance.
121  /// Because the requested container data source may not exist, the result
122  /// should be checked with IsDefined() or a bool comparison before use.
123  HD_API
125  const HdContainerDataSourceHandle &fromParentContainer);
126 
127  /// Returns a token where the container representing this schema is found in
128  /// a container by default.
129  HD_API
130  static const TfToken &GetSchemaToken();
131 
132  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
133  /// where the container representing this schema is found by default.
134  HD_API
135  static const HdDataSourceLocator &GetDefaultLocator();
136 
137 };
138 
140 
141 #endif
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(HdSceneIndexBase)
#define HD_API
Definition: api.h:40
static HD_API HdContainerDataSourceHandle Compose(HdSceneIndexBaseRefPtr const &inputScene, SdfPath const &fromPath, SdfPath *foundAtPath)
Definition: token.h:87
static HD_API HdSystemSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
Definition: path.h:290
HdSystemSchema(HdContainerDataSourceHandle container)
Definition: systemSchema.h:71
static HD_API HdContainerDataSourceHandle ComposeAsPrimDataSource(HdSceneIndexBaseRefPtr const &inputScene, SdfPath const &fromPath, SdfPath *foundAtPath)
static HD_API const TfToken & GetSchemaToken()
static HD_API HdDataSourceBaseHandle GetFromPath(HdSceneIndexBaseRefPtr const &inputScene, SdfPath const &fromPath, TfToken const &key, SdfPath *foundAtPath)
#define HD_SYSTEM_SCHEMA_TOKENS
Definition: systemSchema.h:56
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
TF_DECLARE_PUBLIC_TOKENS(HdSystemSchemaTokens, HD_API, HD_SYSTEM_SCHEMA_TOKENS)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
static HD_API const HdDataSourceLocator & GetDefaultLocator()