All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
coordSysAPI.h
Go to the documentation of this file.
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 #ifndef USDSHADE_GENERATED_COORDSYSAPI_H
25 #define USDSHADE_GENERATED_COORDSYSAPI_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdShade/api.h"
31 #include "pxr/usd/usd/apiSchemaBase.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "pxr/usd/usdShade/tokens.h"
35 
36 #include "pxr/usd/usdGeom/xformable.h"
37 
38 #include "pxr/base/vt/value.h"
39 
40 #include "pxr/base/gf/vec3d.h"
41 #include "pxr/base/gf/vec3f.h"
42 #include "pxr/base/gf/matrix4d.h"
43 
44 #include "pxr/base/tf/token.h"
45 #include "pxr/base/tf/type.h"
46 
47 PXR_NAMESPACE_OPEN_SCOPE
48 
49 class SdfAssetPath;
50 
51 // -------------------------------------------------------------------------- //
52 // COORDSYSAPI //
53 // -------------------------------------------------------------------------- //
54 
80 {
81 public:
86 
91  explicit UsdShadeCoordSysAPI(const UsdPrim& prim=UsdPrim())
92  : UsdAPISchemaBase(prim)
93  {
94  }
95 
99  explicit UsdShadeCoordSysAPI(const UsdSchemaBase& schemaObj)
100  : UsdAPISchemaBase(schemaObj)
101  {
102  }
103 
105  USDSHADE_API
106  virtual ~UsdShadeCoordSysAPI();
107 
111  USDSHADE_API
112  static const TfTokenVector &
113  GetSchemaAttributeNames(bool includeInherited=true);
114 
124  USDSHADE_API
125  static UsdShadeCoordSysAPI
126  Get(const UsdStagePtr &stage, const SdfPath &path);
127 
128 
129 protected:
133  USDSHADE_API
134  UsdSchemaType _GetSchemaType() const override;
135 
136 private:
137  // needs to invoke _GetStaticTfType.
138  friend class UsdSchemaRegistry;
139  USDSHADE_API
140  static const TfType &_GetStaticTfType();
141 
142  static bool _IsTypedSchema();
143 
144  // override SchemaBase virtuals.
145  USDSHADE_API
146  const TfType &_GetTfType() const override;
147 
148 public:
149  // ===================================================================== //
150  // Feel free to add custom code below this line, it will be preserved by
151  // the code generator.
152  //
153  // Just remember to:
154  // - Close the class declaration with };
155  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
156  // - Close the include guard with #endif
157  // ===================================================================== //
158  // --(BEGIN CUSTOM CODE)--
159 
163  typedef struct {
164  TfToken name;
165  SdfPath bindingRelPath;
166  SdfPath coordSysPrimPath;
167  } Binding;
168 
172  USDGEOM_API
173  bool HasLocalBindings() const;
174 
180  USDGEOM_API
181  std::vector<Binding> GetLocalBindings() const;
182 
195  USDGEOM_API
196  std::vector<Binding> FindBindingsWithInheritance() const;
197 
201  USDGEOM_API
202  bool Bind(const TfToken &name, const SdfPath &path) const;
203 
210  USDGEOM_API
211  bool ClearBinding(const TfToken &name, bool removeSpec) const;
212 
215  USDGEOM_API
216  bool BlockBinding(const TfToken &name) const;
217 
220  USDGEOM_API
221  static TfToken GetCoordSysRelationshipName(const std::string &coordSysName);
222 };
223 
224 PXR_NAMESPACE_CLOSE_SCOPE
225 
226 #endif
UsdShadeCoordSysAPI provides a way to designate, name, and discover coordinate systems.
Definition: coordSysAPI.h:79
USDGEOM_API bool BlockBinding(const TfToken &name) const
Block the indicated coordinate system binding on this prim by blocking targets on the underlying rela...
static const UsdSchemaType schemaType
Compile time constant representing what kind of schema this class is.
Definition: coordSysAPI.h:85
USDGEOM_API std::vector< Binding > FindBindingsWithInheritance() const
Find the list of coordinate system bindings that apply to this prim, including inherited bindings...
The base class for all API schemas.
A coordinate system binding.
Definition: coordSysAPI.h:163
USDGEOM_API bool HasLocalBindings() const
Returns true if the prim has local coordinate system binding opinions.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
USDSHADE_API UsdSchemaType _GetSchemaType() const override
Returns the type of schema this class belongs to.
UsdShadeCoordSysAPI(const UsdSchemaBase &schemaObj)
Construct a UsdShadeCoordSysAPI on the prim held by schemaObj .
Definition: coordSysAPI.h:99
virtual USDSHADE_API ~UsdShadeCoordSysAPI()
Destructor.
USDGEOM_API bool ClearBinding(const TfToken &name, bool removeSpec) const
Clear the indicated coordinate system binding on this prim from the current edit target.
Non-applied API schema.
UsdSchemaType
An enum representing which type of schema a given schema class belongs to.
Definition: common.h:149
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
UsdShadeCoordSysAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdShadeCoordSysAPI on UsdPrim prim .
Definition: coordSysAPI.h:91
Contains an asset path and an optional resolved path.
Definition: assetPath.h:43
USDGEOM_API std::vector< Binding > GetLocalBindings() const
Get the list of coordinate system bindings local to this prim.
static USDGEOM_API TfToken GetCoordSysRelationshipName(const std::string &coordSysName)
Returns the fully namespaced coordinate system relationship name, given the coordinate system name...
USDGEOM_API bool Bind(const TfToken &name, const SdfPath &path) const
Bind the name to the given path.
static USDSHADE_API UsdShadeCoordSysAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdShadeCoordSysAPI holding the prim adhering to this schema at path on stage.
TfType represents a dynamic runtime type.
Definition: type.h:70
static USDSHADE_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...
Singleton registry that provides access to prim and property definition information for registered Us...
The base class for all schema types in Usd.
Definition: schemaBase.h:56