HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
particleFieldRadianceBaseAPI.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 USDVOL_GENERATED_PARTICLEFIELDRADIANCEBASEAPI_H
8 #define USDVOL_GENERATED_PARTICLEFIELDRADIANCEBASEAPI_H
9 
10 /// \file usdVol/particleFieldRadianceBaseAPI.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdVol/api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
17 
18 #include "pxr/base/vt/value.h"
19 
20 #include "pxr/base/gf/vec3d.h"
21 #include "pxr/base/gf/vec3f.h"
22 #include "pxr/base/gf/matrix4d.h"
23 
24 #include "pxr/base/tf/token.h"
25 #include "pxr/base/tf/type.h"
26 
28 
29 class SdfAssetPath;
30 
31 // -------------------------------------------------------------------------- //
32 // PARTICLEFIELDRADIANCEBASEAPI //
33 // -------------------------------------------------------------------------- //
34 
35 /// \class UsdVolParticleFieldRadianceBaseAPI
36 ///
37 /// Defines a base-class type applied schema that all applied schema
38 /// that provides a ParticleField radiance definition will automatically
39 /// apply.
40 /// The purpose of this base class is to allow validation to enforce
41 /// that a radiance definition is present for a ParticleField
42 ///
44 {
45 public:
46  /// Compile time constant representing what kind of schema this class is.
47  ///
48  /// \sa UsdSchemaKind
50 
51  /// Construct a UsdVolParticleFieldRadianceBaseAPI on UsdPrim \p prim .
52  /// Equivalent to UsdVolParticleFieldRadianceBaseAPI::Get(prim.GetStage(), prim.GetPath())
53  /// for a \em valid \p prim, but will not immediately throw an error for
54  /// an invalid \p prim
56  : UsdAPISchemaBase(prim)
57  {
58  }
59 
60  /// Construct a UsdVolParticleFieldRadianceBaseAPI on the prim held by \p schemaObj .
61  /// Should be preferred over UsdVolParticleFieldRadianceBaseAPI(schemaObj.GetPrim()),
62  /// as it preserves SchemaBase state.
64  : UsdAPISchemaBase(schemaObj)
65  {
66  }
67 
68  /// Destructor.
71 
72  /// Return a vector of names of all pre-declared attributes for this schema
73  /// class and all its ancestor classes. Does not include attributes that
74  /// may be authored by custom/extended methods of the schemas involved.
76  static const TfTokenVector &
77  GetSchemaAttributeNames(bool includeInherited=true);
78 
79  /// Return a UsdVolParticleFieldRadianceBaseAPI holding the prim adhering to this
80  /// schema at \p path on \p stage. If no prim exists at \p path on
81  /// \p stage, or if the prim at that path does not adhere to this schema,
82  /// return an invalid schema object. This is shorthand for the following:
83  ///
84  /// \code
85  /// UsdVolParticleFieldRadianceBaseAPI(stage->GetPrimAtPath(path));
86  /// \endcode
87  ///
90  Get(const UsdStagePtr &stage, const SdfPath &path);
91 
92 
93  /// Returns true if this <b>single-apply</b> API schema can be applied to
94  /// the given \p prim. If this schema can not be a applied to the prim,
95  /// this returns false and, if provided, populates \p whyNot with the
96  /// reason it can not be applied.
97  ///
98  /// Note that if CanApply returns false, that does not necessarily imply
99  /// that calling Apply will fail. Callers are expected to call CanApply
100  /// before calling Apply if they want to ensure that it is valid to
101  /// apply a schema.
102  ///
103  /// \sa UsdPrim::GetAppliedSchemas()
104  /// \sa UsdPrim::HasAPI()
105  /// \sa UsdPrim::CanApplyAPI()
106  /// \sa UsdPrim::ApplyAPI()
107  /// \sa UsdPrim::RemoveAPI()
108  ///
109  USDVOL_API
110  static bool
111  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
112 
113  /// Applies this <b>single-apply</b> API schema to the given \p prim.
114  /// This information is stored by adding "ParticleFieldRadianceBaseAPI" to the
115  /// token-valued, listOp metadata \em apiSchemas on the prim.
116  ///
117  /// \return A valid UsdVolParticleFieldRadianceBaseAPI object is returned upon success.
118  /// An invalid (or empty) UsdVolParticleFieldRadianceBaseAPI object is returned upon
119  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
120  /// resulting in failure.
121  ///
122  /// \sa UsdPrim::GetAppliedSchemas()
123  /// \sa UsdPrim::HasAPI()
124  /// \sa UsdPrim::CanApplyAPI()
125  /// \sa UsdPrim::ApplyAPI()
126  /// \sa UsdPrim::RemoveAPI()
127  ///
128  USDVOL_API
130  Apply(const UsdPrim &prim);
131 
132 protected:
133  /// Returns the kind of schema this class belongs to.
134  ///
135  /// \sa UsdSchemaKind
136  USDVOL_API
137  UsdSchemaKind _GetSchemaKind() const override;
138 
139 private:
140  // needs to invoke _GetStaticTfType.
141  friend class UsdSchemaRegistry;
142  USDVOL_API
143  static const TfType &_GetStaticTfType();
144 
145  static bool _IsTypedSchema();
146 
147  // override SchemaBase virtuals.
148  USDVOL_API
149  const TfType &_GetTfType() const override;
150 
151 public:
152  // ===================================================================== //
153  // Feel free to add custom code below this line, it will be preserved by
154  // the code generator.
155  //
156  // Just remember to:
157  // - Close the class declaration with };
158  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
159  // - Close the include guard with #endif
160  // ===================================================================== //
161  // --(BEGIN CUSTOM CODE)--
162 };
163 
165 
166 #endif
Single Apply API schema.
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
static USDVOL_API UsdVolParticleFieldRadianceBaseAPI Apply(const UsdPrim &prim)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
static USDVOL_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
static USDVOL_API UsdVolParticleFieldRadianceBaseAPI Get(const UsdStagePtr &stage, const SdfPath &path)
UsdVolParticleFieldRadianceBaseAPI(const UsdPrim &prim=UsdPrim())
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:280
virtual USDVOL_API ~UsdVolParticleFieldRadianceBaseAPI()
Destructor.
UsdSchemaKind
Definition: common.h:112
static USDVOL_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDVOL_API UsdSchemaKind _GetSchemaKind() const override
Definition: type.h:47
#define USDVOL_API
Definition: api.h:23
UsdVolParticleFieldRadianceBaseAPI(const UsdSchemaBase &schemaObj)