Loading...
Searching...
No Matches
apiSchemaBase.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USD_GENERATED_APISCHEMABASE_H
8#define USD_GENERATED_APISCHEMABASE_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usd/api.h"
14#include "pxr/usd/usd/schemaBase.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
17
18#include "pxr/base/vt/value.h"
19
20#include "pxr/base/gf/vec3d.h"
21#include "pxr/base/gf/vec3f.h"
23
24#include "pxr/base/tf/token.h"
25#include "pxr/base/tf/type.h"
26
27PXR_NAMESPACE_OPEN_SCOPE
28
29class SdfAssetPath;
30
31// -------------------------------------------------------------------------- //
32// APISCHEMABASE //
33// -------------------------------------------------------------------------- //
34
95{
96public:
100 static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractBase;
101
106 explicit UsdAPISchemaBase(const UsdPrim& prim=UsdPrim())
107 : UsdSchemaBase(prim)
108 {
109 }
110
114 explicit UsdAPISchemaBase(const UsdSchemaBase& schemaObj)
115 : UsdSchemaBase(schemaObj)
116 {
117 }
118
120 USD_API
121 virtual ~UsdAPISchemaBase() = 0;
122
126 USD_API
127 static const TfTokenVector &
128 GetSchemaAttributeNames(bool includeInherited=true);
129
130
131protected:
135 USD_API
137
138private:
139 // needs to invoke _GetStaticTfType.
140 friend class UsdSchemaRegistry;
141 USD_API
142 static const TfType &_GetStaticTfType();
143
144 static bool _IsTypedSchema();
145
146 // override SchemaBase virtuals.
147 USD_API
148 const TfType &_GetTfType() const override;
149
150public:
151 // ===================================================================== //
152 // Feel free to add custom code below this line, it will be preserved by
153 // the code generator.
154 //
155 // Just remember to:
156 // - Close the class declaration with };
157 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
158 // - Close the include guard with #endif
159 // ===================================================================== //
160 // --(BEGIN CUSTOM CODE)--
161
162protected:
165 explicit UsdAPISchemaBase(const UsdPrim& prim,
166 const TfToken &instanceName)
167 : UsdSchemaBase(prim)
168 , _instanceName(instanceName)
169 {
170 }
171
174 explicit UsdAPISchemaBase(const UsdSchemaBase& schemaObj,
175 const TfToken &instanceName)
176 : UsdSchemaBase(schemaObj)
177 , _instanceName(instanceName)
178 {
179 }
180
186 const TfToken &_GetInstanceName() const {
187 return _instanceName;
188 }
189
192 USD_API
194 const TfType &schemaType);
195
196protected:
209 USD_API
210 bool _IsCompatible() const override;
211
212private:
213 // The instance name associated with this schema object, if it is a
214 // multiple-apply API schema. For example, in the case of UsdCollectionAPI,
215 // this will hold the name of the collection.
216 TfToken _instanceName;
217};
218
219PXR_NAMESPACE_CLOSE_SCOPE
220
221#endif
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:79
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:95
static USD_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
USD_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
const TfToken & _GetInstanceName() const
Returns the instance name of the API schema object belonging to a multiple-apply API schema.
virtual USD_API ~UsdAPISchemaBase()=0
Destructor.
UsdAPISchemaBase(const UsdPrim &prim=UsdPrim())
Construct a UsdAPISchemaBase on UsdPrim prim .
UsdAPISchemaBase(const UsdSchemaBase &schemaObj)
Construct a UsdAPISchemaBase on the prim held by schemaObj .
static USD_API TfTokenVector _GetMultipleApplyInstanceNames(const UsdPrim &prim, const TfType &schemaType)
Returns a vector of names of API schema objects belonging to a multiple-apply API schema applied to a...
UsdAPISchemaBase(const UsdSchemaBase &schemaObj, const TfToken &instanceName)
Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName...
USD_API bool _IsCompatible() const override
Check whether this APISchema object is valid for the currently held prim.
UsdAPISchemaBase(const UsdPrim &prim, const TfToken &instanceName)
Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440