1 //
2 // Copyright 2016 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 #include "pxr/usd/usdContrived/emptyMultipleApplyAPI.h"
25 #include "pxr/usd/usd/schemaRegistry.h"
26 #include "pxr/usd/usd/typed.h"
27 #include "pxr/usd/usd/tokens.h"
28 
29 #include "pxr/usd/sdf/types.h"
30 #include "pxr/usd/sdf/assetPath.h"
31 
32 namespace foo {
33 
34 // Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)35 TF_REGISTRY_FUNCTION(TfType)
36 {
37     TfType::Define<UsdContrivedEmptyMultipleApplyAPI,
38         TfType::Bases< UsdAPISchemaBase > >();
39 
40 }
41 
42 TF_DEFINE_PRIVATE_TOKENS(
43     _schemaTokens,
44     (EmptyMultipleApplyAPI)
45 );
46 
47 /* virtual */
~UsdContrivedEmptyMultipleApplyAPI()48 UsdContrivedEmptyMultipleApplyAPI::~UsdContrivedEmptyMultipleApplyAPI()
49 {
50 }
51 
52 /* static */
53 UsdContrivedEmptyMultipleApplyAPI
Get(const UsdStagePtr & stage,const SdfPath & path)54 UsdContrivedEmptyMultipleApplyAPI::Get(const UsdStagePtr &stage, const SdfPath &path)
55 {
56     if (!stage) {
57         TF_CODING_ERROR("Invalid stage");
58         return UsdContrivedEmptyMultipleApplyAPI();
59     }
60     return UsdContrivedEmptyMultipleApplyAPI(stage->GetPrimAtPath(path));
61 }
62 
63 UsdContrivedEmptyMultipleApplyAPI
Get(const UsdPrim & prim,const TfToken & name)64 UsdContrivedEmptyMultipleApplyAPI::Get(const UsdPrim &prim, const TfToken &name)
65 {
66     return UsdContrivedEmptyMultipleApplyAPI(prim, name);
67 }
68 
69 /*virtual*/
70 bool
_IsAppliedAPISchema() const71 UsdContrivedEmptyMultipleApplyAPI::_IsAppliedAPISchema() const
72 {
73     return true;
74 }
75 
76 /*virtual*/
77 bool
_IsMultipleApplyAPISchema() const78 UsdContrivedEmptyMultipleApplyAPI::_IsMultipleApplyAPISchema() const
79 {
80     return true;
81 }
82 
83 /* static */
84 UsdContrivedEmptyMultipleApplyAPI
Apply(const UsdPrim & prim,const TfToken & name)85 UsdContrivedEmptyMultipleApplyAPI::Apply(const UsdPrim &prim, const TfToken &name)
86 {
87     return UsdAPISchemaBase::_MultipleApplyAPISchema<UsdContrivedEmptyMultipleApplyAPI>(
88             prim, _schemaTokens->EmptyMultipleApplyAPI, name);
89 }
90 
91 /* static */
92 const TfType &
_GetStaticTfType()93 UsdContrivedEmptyMultipleApplyAPI::_GetStaticTfType()
94 {
95     static TfType tfType = TfType::Find<UsdContrivedEmptyMultipleApplyAPI>();
96     return tfType;
97 }
98 
99 /* static */
100 bool
_IsTypedSchema()101 UsdContrivedEmptyMultipleApplyAPI::_IsTypedSchema()
102 {
103     static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
104     return isTyped;
105 }
106 
107 /* virtual */
108 const TfType &
_GetTfType() const109 UsdContrivedEmptyMultipleApplyAPI::_GetTfType() const
110 {
111     return _GetStaticTfType();
112 }
113 
114 /*static*/
115 const TfTokenVector&
GetSchemaAttributeNames(const TfToken instanceName,bool includeInherited)116 UsdContrivedEmptyMultipleApplyAPI::GetSchemaAttributeNames(
117     const TfToken instanceName, bool includeInherited)
118 {
119     static TfTokenVector localNames;
120     static TfTokenVector allNames =
121         UsdAPISchemaBase::GetSchemaAttributeNames(true);
122 
123     if (includeInherited)
124         return allNames;
125     else
126         return localNames;
127 }
128 
129 }
130 
131 // ===================================================================== //
132 // Feel free to add custom code below this line. It will be preserved by
133 // the code generator.
134 //
135 // Just remember to wrap code in the appropriate delimiters:
136 // 'namespace foo {', '}'.
137 // ===================================================================== //
138 // --(BEGIN CUSTOM CODE)--
139