This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
coordSysAPI.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 USDSHADE_GENERATED_COORDSYSAPI_H
8#define USDSHADE_GENERATED_COORDSYSAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdShade/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
20
21#include "pxr/base/vt/value.h"
22
23#include "pxr/base/gf/vec3d.h"
24#include "pxr/base/gf/vec3f.h"
26
27#include "pxr/base/tf/token.h"
28#include "pxr/base/tf/type.h"
29
30PXR_NAMESPACE_OPEN_SCOPE
31
32class SdfAssetPath;
33
34// -------------------------------------------------------------------------- //
35// COORDSYSAPI //
36// -------------------------------------------------------------------------- //
37
66{
67public:
71 static const UsdSchemaKind schemaKind = UsdSchemaKind::MultipleApplyAPI;
72
83 const UsdPrim& prim=UsdPrim(), const TfToken &name=TfToken())
84 : UsdAPISchemaBase(prim, /*instanceName*/ name)
85 { }
86
92 const UsdSchemaBase& schemaObj, const TfToken &name)
93 : UsdAPISchemaBase(schemaObj, /*instanceName*/ name)
94 { }
95
97 USDSHADE_API
99
103 USDSHADE_API
104 static const TfTokenVector &
105 GetSchemaAttributeNames(bool includeInherited=true);
106
112 USDSHADE_API
113 static TfTokenVector
114 GetSchemaAttributeNames(bool includeInherited, const TfToken &instanceName);
115
117 TfToken GetName() const {
118 return _GetInstanceName();
119 }
120
135 USDSHADE_API
137 Get(const UsdStagePtr &stage, const SdfPath &path);
138
141 USDSHADE_API
143 Get(const UsdPrim &prim, const TfToken &name);
144
147 USDSHADE_API
148 static std::vector<UsdShadeCoordSysAPI>
149 GetAll(const UsdPrim &prim);
150
153 USDSHADE_API
154 static bool
156
160 USDSHADE_API
161 static bool
162 IsCoordSysAPIPath(const SdfPath &path, TfToken *name);
163
180 USDSHADE_API
181 static bool
182 CanApply(const UsdPrim &prim, const TfToken &name,
183 std::string *whyNot=nullptr);
184
204 USDSHADE_API
205 static UsdShadeCoordSysAPI
206 Apply(const UsdPrim &prim, const TfToken &name);
207
208protected:
212 USDSHADE_API
214
215private:
216 // needs to invoke _GetStaticTfType.
217 friend class UsdSchemaRegistry;
218 USDSHADE_API
219 static const TfType &_GetStaticTfType();
220
221 static bool _IsTypedSchema();
222
223 // override SchemaBase virtuals.
224 USDSHADE_API
225 const TfType &_GetTfType() const override;
226
227public:
228 // --------------------------------------------------------------------- //
229 // BINDING
230 // --------------------------------------------------------------------- //
233 USDSHADE_API
235
238 USDSHADE_API
240
241public:
242 // ===================================================================== //
243 // Feel free to add custom code below this line, it will be preserved by
244 // the code generator.
245 //
246 // Just remember to:
247 // - Close the class declaration with };
248 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
249 // - Close the include guard with #endif
250 // ===================================================================== //
251 // --(BEGIN CUSTOM CODE)--
252
256 typedef struct {
257 TfToken name;
258 SdfPath bindingRelPath;
259 SdfPath coordSysPrimPath;
260 } Binding;
261
273 USDSHADE_API
274 bool HasLocalBindings() const;
275
279 USDSHADE_API
280 static bool HasLocalBindingsForPrim(const UsdPrim &prim);
281
296 USDSHADE_API
297 std::vector<Binding> GetLocalBindings() const;
298
307 USDSHADE_API
308 static std::vector<Binding> GetLocalBindingsForPrim(const UsdPrim &prim);
309
315 USDSHADE_API
317
339 USDSHADE_API
340 std::vector<Binding> FindBindingsWithInheritance() const;
341
354 USDSHADE_API
355 static std::vector<Binding> FindBindingsWithInheritanceForPrim(
356 const UsdPrim &prim);
357
370 USDSHADE_API
372
386 USDSHADE_API
387 bool Bind(const TfToken &name, const SdfPath &path) const;
388
394 USDSHADE_API
395 bool ApplyAndBind(const TfToken &name, const SdfPath &path) const;
396
401 USDSHADE_API
402 bool Bind(const SdfPath &path) const;
403
420 USDSHADE_API
421 bool ClearBinding(const TfToken &name, bool removeSpec) const;
422
430 USDSHADE_API
431 bool ClearBinding(bool removeSpec) const;
432
445 USDSHADE_API
446 bool BlockBinding(const TfToken &name) const;
447
451 USDSHADE_API
452 bool BlockBinding() const;
453
456 //
460 //
461 USDSHADE_API
462 static TfToken GetCoordSysRelationshipName(const std::string &coordSysName);
463
465 USDSHADE_API
466 static bool CanContainPropertyName(const TfToken &name);
467
470 USDSHADE_API
471 static TfToken GetBindingBaseName(const TfToken &name);
472
475 USDSHADE_API
477
478private:
479 USDSHADE_API
480 static void _GetBindingsForPrim(const UsdPrim &prim,
481 std::vector<Binding> &result, bool checkExistingBindings=false);
482
483};
484
485PXR_NAMESPACE_CLOSE_SCOPE
486
488
489PXR_NAMESPACE_OPEN_SCOPE
490USDSHADE_API
491extern TfEnvSetting<std::string> USD_SHADE_COORD_SYS_IS_MULTI_APPLY;
492
493PXR_NAMESPACE_CLOSE_SCOPE
494
495#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
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
const TfToken & _GetInstanceName() const
Returns the instance name of the API schema object belonging to a multiple-apply API schema.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
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...
UsdShadeCoordSysAPI provides a way to designate, name, and discover coordinate systems.
Definition: coordSysAPI.h:66
USDSHADE_API UsdRelationship GetBindingRel() const
Prim binding expressing the appropriate coordinate systems.
USDSHADE_API bool ClearBinding(const TfToken &name, bool removeSpec) const
Clear the indicated coordinate system binding on this prim from the current edit target.
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.
USDSHADE_API bool BlockBinding() const
Block the indicated coordinate system binding on this prim by blocking targets on the underlying rela...
UsdShadeCoordSysAPI(const UsdPrim &prim=UsdPrim(), const TfToken &name=TfToken())
Construct a UsdShadeCoordSysAPI on UsdPrim prim with name name .
Definition: coordSysAPI.h:82
USDSHADE_API bool ClearBinding(bool removeSpec) const
Clear the coordinate system binding on the prim corresponding to the instanceName of this UsdShadeCoo...
USDSHADE_API bool Bind(const SdfPath &path) const
Bind the name to the given path.
TfToken GetName() const
Returns the name of this multiple-apply schema instance.
Definition: coordSysAPI.h:117
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: coordSysAPI.h:71
static USDSHADE_API UsdShadeCoordSysAPI Get(const UsdPrim &prim, const TfToken &name)
Return a UsdShadeCoordSysAPI with name name holding the prim prim.
USDSHADE_API bool BlockBinding(const TfToken &name) const
Block the indicated coordinate system binding on this prim by blocking targets on the underlying rela...
static USDSHADE_API std::vector< UsdShadeCoordSysAPI > GetAll(const UsdPrim &prim)
Return a vector of all named instances of UsdShadeCoordSysAPI on the given prim.
static USDSHADE_API TfToken GetCoordSysRelationshipName(const std::string &coordSysName)
Returns the fully namespaced coordinate system relationship name, given the coordinate system name.
static USDSHADE_API UsdShadeCoordSysAPI Apply(const UsdPrim &prim, const TfToken &name)
Applies this multiple-apply API schema to the given prim along with the given instance name,...
static USDSHADE_API bool IsSchemaPropertyBaseName(const TfToken &baseName)
Checks if the given name baseName is the base name of a property of CoordSysAPI.
static USDSHADE_API std::vector< Binding > FindBindingsWithInheritanceForPrim(const UsdPrim &prim)
Find the list of coordinate system bindings that apply to this prim, including inherited bindings.
static USDSHADE_API bool HasLocalBindingsForPrim(const UsdPrim &prim)
Returns true if the prim has UsdShadeCoordSysAPI applied.
USDSHADE_API bool HasLocalBindings() const
Returns true if the prim has local coordinate system relationship exists.
USDSHADE_API bool Bind(const TfToken &name, const SdfPath &path) const
Bind the name to the given path.
USDSHADE_API std::vector< Binding > FindBindingsWithInheritance() const
Find the list of coordinate system bindings that apply to this prim, including inherited bindings.
USDSHADE_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDSHADE_API bool CanContainPropertyName(const TfToken &name)
Test whether a given name contains the "coordSys:" prefix.
USDSHADE_API TfToken GetBindingBaseName() const
Strips "coordSys:" from the relationship name and returns "<instanceName>:binding".
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...
virtual USDSHADE_API ~UsdShadeCoordSysAPI()
Destructor.
USDSHADE_API Binding FindBindingWithInheritance() const
Find the coordinate system bindings that apply to this prim, including inherited bindings.
static USDSHADE_API TfToken GetBindingBaseName(const TfToken &name)
Strips "coordSys:" from the relationship name and returns "<instanceName>:binding".
USDSHADE_API bool ApplyAndBind(const TfToken &name, const SdfPath &path) const
A convinience API for clients to use to Apply schema in accordance with new UsdShadeCoordSysAPI schem...
USDSHADE_API UsdRelationship CreateBindingRel() const
See GetBindingRel(), and also Create vs Get Property Methods for when to use Get vs Create.
static USDSHADE_API bool CanApply(const UsdPrim &prim, const TfToken &name, std::string *whyNot=nullptr)
Returns true if this multiple-apply API schema can be applied, with the given instance name,...
static USDSHADE_API bool IsCoordSysAPIPath(const SdfPath &path, TfToken *name)
Checks if the given path path is of an API schema of type CoordSysAPI.
static USDSHADE_API std::vector< Binding > GetLocalBindingsForPrim(const UsdPrim &prim)
Get the list of coordinate system bindings local to this prim, across all multi-apply instanceNames.
static USDSHADE_API TfTokenVector GetSchemaAttributeNames(bool includeInherited, const TfToken &instanceName)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
UsdShadeCoordSysAPI(const UsdSchemaBase &schemaObj, const TfToken &name)
Construct a UsdShadeCoordSysAPI on the prim held by schemaObj with name name.
Definition: coordSysAPI.h:91
USDSHADE_API Binding GetLocalBinding() const
Get the coordinate system bindings local to this prim corresponding to this instance name.
A coordinate system binding.
Definition: coordSysAPI.h:256
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
Environment setting variable.
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