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"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
35 
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  UsdSchemaKind _GetSchemaKind() 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  USDSHADE_API
173  bool HasLocalBindings() const;
174 
180  USDSHADE_API
181  std::vector<Binding> GetLocalBindings() const;
182 
195  USDSHADE_API
196  std::vector<Binding> FindBindingsWithInheritance() const;
197 
201  USDSHADE_API
202  bool Bind(const TfToken &name, const SdfPath &path) const;
203 
210  USDSHADE_API
211  bool ClearBinding(const TfToken &name, bool removeSpec) const;
212 
215  USDSHADE_API
216  bool BlockBinding(const TfToken &name) const;
217 
220  USDSHADE_API
221  static TfToken GetCoordSysRelationshipName(const std::string &coordSysName);
222 
225  USDSHADE_API
226  static bool CanContainPropertyName(const TfToken &name);
227 };
228 
229 PXR_NAMESPACE_CLOSE_SCOPE
230 
231 #endif
USDSHADE_API bool BlockBinding(const TfToken &name) const
Block the indicated coordinate system binding on this prim by blocking targets on the underlying rela...
UsdShadeCoordSysAPI provides a way to designate, name, and discover coordinate systems.
Definition: coordSysAPI.h:79
USDSHADE_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
The base class for all API schemas.
A coordinate system binding.
Definition: coordSysAPI.h:163
Non-applied API schema.
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:127
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: coordSysAPI.h:85
UsdShadeCoordSysAPI(const UsdSchemaBase &schemaObj)
Construct a UsdShadeCoordSysAPI on the prim held by schemaObj .
Definition: coordSysAPI.h:99
virtual USDSHADE_API ~UsdShadeCoordSysAPI()
Destructor.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
USDSHADE_API bool Bind(const TfToken &name, const SdfPath &path) const
Bind the name to the given path.
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:47
USDSHADE_API std::vector< Binding > FindBindingsWithInheritance() const
Find the list of coordinate system bindings that apply to this prim, including inherited bindings...
USDSHADE_API bool HasLocalBindings() const
Returns true if the prim has local coordinate system binding opinions.
USDSHADE_API std::vector< Binding > GetLocalBindings() const
Get the list of coordinate system bindings local to this prim.
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:64
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 schema type information and the prim definitions for regis...
USDSHADE_API bool ClearBinding(const TfToken &name, bool removeSpec) const
Clear the indicated coordinate system binding on this prim from the current edit target.
static USDSHADE_API bool CanContainPropertyName(const TfToken &name)
Test whether a given name contains the &quot;coordSys:&quot; prefix.
The base class for all schema types in Usd.
Definition: schemaBase.h:56
static USDSHADE_API TfToken GetCoordSysRelationshipName(const std::string &coordSysName)
Returns the fully namespaced coordinate system relationship name, given the coordinate system name...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...