All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
99{
100public:
104 static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractBase;
105
110 explicit UsdAPISchemaBase(const UsdPrim& prim=UsdPrim())
111 : UsdSchemaBase(prim)
112 {
113 }
114
118 explicit UsdAPISchemaBase(const UsdSchemaBase& schemaObj)
119 : UsdSchemaBase(schemaObj)
120 {
121 }
122
124 USD_API
125 virtual ~UsdAPISchemaBase() = 0;
126
130 USD_API
131 static const TfTokenVector &
132 GetSchemaAttributeNames(bool includeInherited=true);
133
134
135protected:
139 USD_API
141
142private:
143 // needs to invoke _GetStaticTfType.
144 friend class UsdSchemaRegistry;
145 USD_API
146 static const TfType &_GetStaticTfType();
147
148 static bool _IsTypedSchema();
149
150 // override SchemaBase virtuals.
151 USD_API
152 const TfType &_GetTfType() const override;
153
154public:
155 // ===================================================================== //
156 // Feel free to add custom code below this line, it will be preserved by
157 // the code generator.
158 //
159 // Just remember to:
160 // - Close the class declaration with };
161 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
162 // - Close the include guard with #endif
163 // ===================================================================== //
164 // --(BEGIN CUSTOM CODE)--
165
166protected:
169 explicit UsdAPISchemaBase(const UsdPrim& prim,
170 const TfToken &instanceName)
171 : UsdSchemaBase(prim)
172 , _instanceName(instanceName)
173 {
174 }
175
178 explicit UsdAPISchemaBase(const UsdSchemaBase& schemaObj,
179 const TfToken &instanceName)
180 : UsdSchemaBase(schemaObj)
181 , _instanceName(instanceName)
182 {
183 }
184
190 const TfToken &_GetInstanceName() const {
191 return _instanceName;
192 }
193
196 USD_API
198 const TfType &schemaType);
199
200protected:
213 USD_API
214 bool _IsCompatible() const override;
215
216private:
217 // The instance name associated with this schema object, if it is a
218 // multiple-apply API schema. For example, in the case of UsdCollectionAPI,
219 // this will hold the name of the collection.
220 TfToken _instanceName;
221};
222
223PXR_NAMESPACE_CLOSE_SCOPE
224
225#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
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:99
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