|
| 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 USDLIGHTFIELD_GENERATED_GAUSSIANFALLOFFFUNCTIONAPI_H |
| 8 | +#define USDLIGHTFIELD_GENERATED_GAUSSIANFALLOFFFUNCTIONAPI_H |
| 9 | + |
| 10 | +/// \file usdLightField/gaussianFalloffFunctionAPI.h |
| 11 | + |
| 12 | +#include "pxr/pxr.h" |
| 13 | +#include "pxr/usd/usdLightField/api.h" |
| 14 | +#include "pxr/usd/usd/apiSchemaBase.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 | + |
| 27 | +PXR_NAMESPACE_OPEN_SCOPE |
| 28 | + |
| 29 | +class SdfAssetPath; |
| 30 | + |
| 31 | +// -------------------------------------------------------------------------- // |
| 32 | +// GAUSSIANFALLOFFFUNCTIONAPI // |
| 33 | +// -------------------------------------------------------------------------- // |
| 34 | + |
| 35 | +/// \class UsdLightFieldGaussianFalloffFunctionAPI |
| 36 | +/// |
| 37 | +/// Defines a Gaussian fall-off function. An opacity data source is |
| 38 | +/// required and it used to control the gaussian peak. |
| 39 | +/// |
| 40 | +class UsdLightFieldGaussianFalloffFunctionAPI : public UsdAPISchemaBase |
| 41 | +{ |
| 42 | +public: |
| 43 | + /// Compile time constant representing what kind of schema this class is. |
| 44 | + /// |
| 45 | + /// \sa UsdSchemaKind |
| 46 | + static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI; |
| 47 | + |
| 48 | + /// Construct a UsdLightFieldGaussianFalloffFunctionAPI on UsdPrim \p prim . |
| 49 | + /// Equivalent to UsdLightFieldGaussianFalloffFunctionAPI::Get(prim.GetStage(), prim.GetPath()) |
| 50 | + /// for a \em valid \p prim, but will not immediately throw an error for |
| 51 | + /// an invalid \p prim |
| 52 | + explicit UsdLightFieldGaussianFalloffFunctionAPI(const UsdPrim& prim=UsdPrim()) |
| 53 | + : UsdAPISchemaBase(prim) |
| 54 | + { |
| 55 | + } |
| 56 | + |
| 57 | + /// Construct a UsdLightFieldGaussianFalloffFunctionAPI on the prim held by \p schemaObj . |
| 58 | + /// Should be preferred over UsdLightFieldGaussianFalloffFunctionAPI(schemaObj.GetPrim()), |
| 59 | + /// as it preserves SchemaBase state. |
| 60 | + explicit UsdLightFieldGaussianFalloffFunctionAPI(const UsdSchemaBase& schemaObj) |
| 61 | + : UsdAPISchemaBase(schemaObj) |
| 62 | + { |
| 63 | + } |
| 64 | + |
| 65 | + /// Destructor. |
| 66 | + USDLIGHTFIELD_API |
| 67 | + virtual ~UsdLightFieldGaussianFalloffFunctionAPI(); |
| 68 | + |
| 69 | + /// Return a vector of names of all pre-declared attributes for this schema |
| 70 | + /// class and all its ancestor classes. Does not include attributes that |
| 71 | + /// may be authored by custom/extended methods of the schemas involved. |
| 72 | + USDLIGHTFIELD_API |
| 73 | + static const TfTokenVector & |
| 74 | + GetSchemaAttributeNames(bool includeInherited=true); |
| 75 | + |
| 76 | + /// Return a UsdLightFieldGaussianFalloffFunctionAPI holding the prim adhering to this |
| 77 | + /// schema at \p path on \p stage. If no prim exists at \p path on |
| 78 | + /// \p stage, or if the prim at that path does not adhere to this schema, |
| 79 | + /// return an invalid schema object. This is shorthand for the following: |
| 80 | + /// |
| 81 | + /// \code |
| 82 | + /// UsdLightFieldGaussianFalloffFunctionAPI(stage->GetPrimAtPath(path)); |
| 83 | + /// \endcode |
| 84 | + /// |
| 85 | + USDLIGHTFIELD_API |
| 86 | + static UsdLightFieldGaussianFalloffFunctionAPI |
| 87 | + Get(const UsdStagePtr &stage, const SdfPath &path); |
| 88 | + |
| 89 | + |
| 90 | + /// Returns true if this <b>single-apply</b> API schema can be applied to |
| 91 | + /// the given \p prim. If this schema can not be a applied to the prim, |
| 92 | + /// this returns false and, if provided, populates \p whyNot with the |
| 93 | + /// reason it can not be applied. |
| 94 | + /// |
| 95 | + /// Note that if CanApply returns false, that does not necessarily imply |
| 96 | + /// that calling Apply will fail. Callers are expected to call CanApply |
| 97 | + /// before calling Apply if they want to ensure that it is valid to |
| 98 | + /// apply a schema. |
| 99 | + /// |
| 100 | + /// \sa UsdPrim::GetAppliedSchemas() |
| 101 | + /// \sa UsdPrim::HasAPI() |
| 102 | + /// \sa UsdPrim::CanApplyAPI() |
| 103 | + /// \sa UsdPrim::ApplyAPI() |
| 104 | + /// \sa UsdPrim::RemoveAPI() |
| 105 | + /// |
| 106 | + USDLIGHTFIELD_API |
| 107 | + static bool |
| 108 | + CanApply(const UsdPrim &prim, std::string *whyNot=nullptr); |
| 109 | + |
| 110 | + /// Applies this <b>single-apply</b> API schema to the given \p prim. |
| 111 | + /// This information is stored by adding "GaussianFalloffFunctionAPI" to the |
| 112 | + /// token-valued, listOp metadata \em apiSchemas on the prim. |
| 113 | + /// |
| 114 | + /// \return A valid UsdLightFieldGaussianFalloffFunctionAPI object is returned upon success. |
| 115 | + /// An invalid (or empty) UsdLightFieldGaussianFalloffFunctionAPI object is returned upon |
| 116 | + /// failure. See \ref UsdPrim::ApplyAPI() for conditions |
| 117 | + /// resulting in failure. |
| 118 | + /// |
| 119 | + /// \sa UsdPrim::GetAppliedSchemas() |
| 120 | + /// \sa UsdPrim::HasAPI() |
| 121 | + /// \sa UsdPrim::CanApplyAPI() |
| 122 | + /// \sa UsdPrim::ApplyAPI() |
| 123 | + /// \sa UsdPrim::RemoveAPI() |
| 124 | + /// |
| 125 | + USDLIGHTFIELD_API |
| 126 | + static UsdLightFieldGaussianFalloffFunctionAPI |
| 127 | + Apply(const UsdPrim &prim); |
| 128 | + |
| 129 | +protected: |
| 130 | + /// Returns the kind of schema this class belongs to. |
| 131 | + /// |
| 132 | + /// \sa UsdSchemaKind |
| 133 | + USDLIGHTFIELD_API |
| 134 | + UsdSchemaKind _GetSchemaKind() const override; |
| 135 | + |
| 136 | +private: |
| 137 | + // needs to invoke _GetStaticTfType. |
| 138 | + friend class UsdSchemaRegistry; |
| 139 | + USDLIGHTFIELD_API |
| 140 | + static const TfType &_GetStaticTfType(); |
| 141 | + |
| 142 | + static bool _IsTypedSchema(); |
| 143 | + |
| 144 | + // override SchemaBase virtuals. |
| 145 | + USDLIGHTFIELD_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 | +}; |
| 160 | + |
| 161 | +PXR_NAMESPACE_CLOSE_SCOPE |
| 162 | + |
| 163 | +#endif |
0 commit comments