HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
usdPrimInfoSchema.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_USD_IMAGING_USD_IMAGING_USD_PRIM_INFO_SCHEMA_H
32 #define PXR_USD_IMAGING_USD_IMAGING_USD_PRIM_INFO_SCHEMA_H
33 
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define USDIMAGINGUSDPRIMINFO_SCHEMA_TOKENS \
43  (__usdPrimInfo) \
44  (niPrototypePath) \
45  (isNiPrototype) \
46  (specifier) \
47  (piPropagatedPrototypes) \
48  (isLoaded) \
49  (def) \
50  (over) \
51  ((class_, "class")) \
52 
53 TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdPrimInfoSchemaTokens, USDIMAGING_API,
55 
56 //-----------------------------------------------------------------------------
57 
59 {
60 public:
61  UsdImagingUsdPrimInfoSchema(HdContainerDataSourceHandle container)
62  : HdSchema(container) {}
63 
64  //ACCESSORS
65 
73  HdContainerDataSourceHandle GetPiPropagatedPrototypes();
76 
77  // RETRIEVING AND CONSTRUCTING
78 
79  /// Builds a container data source which includes the provided child data
80  /// sources. Parameters with nullptr values are excluded. This is a
81  /// low-level interface. For cases in which it's desired to define
82  /// the container with a sparse set of child fields, the Builder class
83  /// is often more convenient and readable.
85  static HdContainerDataSourceHandle
87  const HdPathDataSourceHandle &niPrototypePath,
88  const HdBoolDataSourceHandle &isNiPrototype,
89  const HdTokenDataSourceHandle &specifier,
90  const HdContainerDataSourceHandle &piPropagatedPrototypes,
91  const HdBoolDataSourceHandle &isLoaded
92  );
93 
94  /// \class UsdImagingUsdPrimInfoSchema::Builder
95  ///
96  /// Utility class for setting sparse sets of child data source fields to be
97  /// filled as arguments into BuildRetained. Because all setter methods
98  /// return a reference to the instance, this can be used in the "builder
99  /// pattern" form.
100  class Builder
101  {
102  public:
105  const HdPathDataSourceHandle &niPrototypePath);
108  const HdBoolDataSourceHandle &isNiPrototype);
111  const HdTokenDataSourceHandle &specifier);
114  const HdContainerDataSourceHandle &piPropagatedPrototypes);
117  const HdBoolDataSourceHandle &isLoaded);
118 
119  /// Returns a container data source containing the members set thus far.
121  HdContainerDataSourceHandle Build();
122 
123  private:
124  HdPathDataSourceHandle _niPrototypePath;
125  HdBoolDataSourceHandle _isNiPrototype;
126  HdTokenDataSourceHandle _specifier;
127  HdContainerDataSourceHandle _piPropagatedPrototypes;
128  HdBoolDataSourceHandle _isLoaded;
129  };
130 
131  /// Retrieves a container data source with the schema's default name token
132  /// "__usdPrimInfo" from the parent container and constructs a
133  /// UsdImagingUsdPrimInfoSchema instance.
134  /// Because the requested container data source may not exist, the result
135  /// should be checked with IsDefined() or a bool comparison before use.
138  const HdContainerDataSourceHandle &fromParentContainer);
139 
140  /// Returns a token where the container representing this schema is found in
141  /// a container by default.
143  static const TfToken &GetSchemaToken();
144 
145  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
146  /// where the container representing this schema is found by default.
148  static const HdDataSourceLocator &GetDefaultLocator();
149 
150 
151  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
152  /// where the niprototypepath data source can be found.
153  /// This is often useful for checking intersection against the
154  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
157 
158 };
159 
161 
162 #endif
static USDIMAGING_API UsdImagingUsdPrimInfoSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
#define USDIMAGING_API
Definition: api.h:40
#define USDIMAGINGUSDPRIMINFO_SCHEMA_TOKENS
UsdImagingUsdPrimInfoSchema(HdContainerDataSourceHandle container)
USDIMAGING_API Builder & SetSpecifier(const HdTokenDataSourceHandle &specifier)
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
static USDIMAGING_API const HdDataSourceLocator & GetNiPrototypePathLocator()
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
USDIMAGING_API HdBoolDataSourceHandle GetIsLoaded()
Definition: token.h:87
static USDIMAGING_API const TfToken & GetSchemaToken()
USDIMAGING_API HdTokenDataSourceHandle GetSpecifier()
HdBoolDataSource::Handle HdBoolDataSourceHandle
USDIMAGING_API Builder & SetNiPrototypePath(const HdPathDataSourceHandle &niPrototypePath)
USDIMAGING_API Builder & SetIsLoaded(const HdBoolDataSourceHandle &isLoaded)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
USDIMAGING_API HdContainerDataSourceHandle GetPiPropagatedPrototypes()
static USDIMAGING_API HdContainerDataSourceHandle BuildRetained(const HdPathDataSourceHandle &niPrototypePath, const HdBoolDataSourceHandle &isNiPrototype, const HdTokenDataSourceHandle &specifier, const HdContainerDataSourceHandle &piPropagatedPrototypes, const HdBoolDataSourceHandle &isLoaded)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDIMAGING_API Builder & SetPiPropagatedPrototypes(const HdContainerDataSourceHandle &piPropagatedPrototypes)
USDIMAGING_API HdPathDataSourceHandle GetNiPrototypePath()
TF_DECLARE_PUBLIC_TOKENS(UsdImagingUsdPrimInfoSchemaTokens, USDIMAGING_API, USDIMAGINGUSDPRIMINFO_SCHEMA_TOKENS)
USDIMAGING_API HdBoolDataSourceHandle GetIsNiPrototype()
HdPathDataSource::Handle HdPathDataSourceHandle
USDIMAGING_API Builder & SetIsNiPrototype(const HdBoolDataSourceHandle &isNiPrototype)
HdTokenDataSource::Handle HdTokenDataSourceHandle