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