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/nonAppliedAPI.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 { namespace bar { namespace baz {
33 
34 // Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)35 TF_REGISTRY_FUNCTION(TfType)
36 {
37     TfType::Define<UsdContrivedNonAppliedAPI,
38         TfType::Bases< UsdAPISchemaBase > >();
39 
40 }
41 
42 TF_DEFINE_PRIVATE_TOKENS(
43     _schemaTokens,
44     (NonAppliedAPI)
45 );
46 
47 /* virtual */
~UsdContrivedNonAppliedAPI()48 UsdContrivedNonAppliedAPI::~UsdContrivedNonAppliedAPI()
49 {
50 }
51 
52 /* static */
53 UsdContrivedNonAppliedAPI
Get(const UsdStagePtr & stage,const SdfPath & path)54 UsdContrivedNonAppliedAPI::Get(const UsdStagePtr &stage, const SdfPath &path)
55 {
56     if (!stage) {
57         TF_CODING_ERROR("Invalid stage");
58         return UsdContrivedNonAppliedAPI();
59     }
60     return UsdContrivedNonAppliedAPI(stage->GetPrimAtPath(path));
61 }
62 
63 
64 /* virtual */
_GetSchemaKind() const65 UsdSchemaKind UsdContrivedNonAppliedAPI::_GetSchemaKind() const
66 {
67     return UsdContrivedNonAppliedAPI::schemaKind;
68 }
69 
70 /* static */
71 const TfType &
_GetStaticTfType()72 UsdContrivedNonAppliedAPI::_GetStaticTfType()
73 {
74     static TfType tfType = TfType::Find<UsdContrivedNonAppliedAPI>();
75     return tfType;
76 }
77 
78 /* static */
79 bool
_IsTypedSchema()80 UsdContrivedNonAppliedAPI::_IsTypedSchema()
81 {
82     static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
83     return isTyped;
84 }
85 
86 /* virtual */
87 const TfType &
_GetTfType() const88 UsdContrivedNonAppliedAPI::_GetTfType() const
89 {
90     return _GetStaticTfType();
91 }
92 
93 /*static*/
94 const TfTokenVector&
GetSchemaAttributeNames(bool includeInherited)95 UsdContrivedNonAppliedAPI::GetSchemaAttributeNames(bool includeInherited)
96 {
97     static TfTokenVector localNames;
98     static TfTokenVector allNames =
99         UsdAPISchemaBase::GetSchemaAttributeNames(true);
100 
101     if (includeInherited)
102         return allNames;
103     else
104         return localNames;
105 }
106 
107 }}}
108 
109 // ===================================================================== //
110 // Feel free to add custom code below this line. It will be preserved by
111 // the code generator.
112 //
113 // Just remember to wrap code in the appropriate delimiters:
114 // 'namespace foo { namespace bar { namespace baz {', '}}}'.
115 // ===================================================================== //
116 // --(BEGIN CUSTOM CODE)--
117