HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
particleFieldKernelGaussianEllipsoidAPI.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_PARTICLEFIELDKERNELGAUSSIANELLIPSOIDAPI_H
8 #define USDVOL_GENERATED_PARTICLEFIELDKERNELGAUSSIANELLIPSOIDAPI_H
9 
10 /// \file usdVol/particleFieldKernelGaussianEllipsoidAPI.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 
19 
20 
21 #include "pxr/base/vt/value.h"
22 
23 #include "pxr/base/gf/vec3d.h"
24 #include "pxr/base/gf/vec3f.h"
25 #include "pxr/base/gf/matrix4d.h"
26 
27 #include "pxr/base/tf/token.h"
28 #include "pxr/base/tf/type.h"
29 
31 
32 class SdfAssetPath;
33 
34 // -------------------------------------------------------------------------- //
35 // PARTICLEFIELDKERNELGAUSSIANELLIPSOIDAPI //
36 // -------------------------------------------------------------------------- //
37 
38 /// \class UsdVolParticleFieldKernelGaussianEllipsoidAPI
39 ///
40 /// Defines the gaussian ellipsoid kernel for a given ParticleField.
41 ///
42 /// An untransformed kernel (i.e. identity position, scale, rotation, opacity)
43 /// will define opacity at point 'p' by g(u=0;o=1;x = p.length()). Note that
44 /// since the standard deviation is 1, the 3-sigma point is 3.0 and 99.7% of
45 /// the splat support is within a spherical region of radius 3.
46 ///
47 /// Per-splat opacity is multiplicative with the gaussian falloff; rotation
48 /// and scale will transform the gaussian sphere kernel into an ellipsoid;
49 /// and position moves the per-splat peak falloff from the origin.
50 ///
51 ///
53 {
54 public:
55  /// Compile time constant representing what kind of schema this class is.
56  ///
57  /// \sa UsdSchemaKind
59 
60  /// Construct a UsdVolParticleFieldKernelGaussianEllipsoidAPI on UsdPrim \p prim .
61  /// Equivalent to UsdVolParticleFieldKernelGaussianEllipsoidAPI::Get(prim.GetStage(), prim.GetPath())
62  /// for a \em valid \p prim, but will not immediately throw an error for
63  /// an invalid \p prim
65  : UsdAPISchemaBase(prim)
66  {
67  }
68 
69  /// Construct a UsdVolParticleFieldKernelGaussianEllipsoidAPI on the prim held by \p schemaObj .
70  /// Should be preferred over UsdVolParticleFieldKernelGaussianEllipsoidAPI(schemaObj.GetPrim()),
71  /// as it preserves SchemaBase state.
73  : UsdAPISchemaBase(schemaObj)
74  {
75  }
76 
77  /// Destructor.
80 
81  /// Return a vector of names of all pre-declared attributes for this schema
82  /// class and all its ancestor classes. Does not include attributes that
83  /// may be authored by custom/extended methods of the schemas involved.
85  static const TfTokenVector &
86  GetSchemaAttributeNames(bool includeInherited=true);
87 
88  /// Return a UsdVolParticleFieldKernelGaussianEllipsoidAPI holding the prim adhering to this
89  /// schema at \p path on \p stage. If no prim exists at \p path on
90  /// \p stage, or if the prim at that path does not adhere to this schema,
91  /// return an invalid schema object. This is shorthand for the following:
92  ///
93  /// \code
94  /// UsdVolParticleFieldKernelGaussianEllipsoidAPI(stage->GetPrimAtPath(path));
95  /// \endcode
96  ///
99  Get(const UsdStagePtr &stage, const SdfPath &path);
100 
101 
102  /// Returns true if this <b>single-apply</b> API schema can be applied to
103  /// the given \p prim. If this schema can not be a applied to the prim,
104  /// this returns false and, if provided, populates \p whyNot with the
105  /// reason it can not be applied.
106  ///
107  /// Note that if CanApply returns false, that does not necessarily imply
108  /// that calling Apply will fail. Callers are expected to call CanApply
109  /// before calling Apply if they want to ensure that it is valid to
110  /// apply a schema.
111  ///
112  /// \sa UsdPrim::GetAppliedSchemas()
113  /// \sa UsdPrim::HasAPI()
114  /// \sa UsdPrim::CanApplyAPI()
115  /// \sa UsdPrim::ApplyAPI()
116  /// \sa UsdPrim::RemoveAPI()
117  ///
118  USDVOL_API
119  static bool
120  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
121 
122  /// Applies this <b>single-apply</b> API schema to the given \p prim.
123  /// This information is stored by adding "ParticleFieldKernelGaussianEllipsoidAPI" to the
124  /// token-valued, listOp metadata \em apiSchemas on the prim.
125  ///
126  /// \return A valid UsdVolParticleFieldKernelGaussianEllipsoidAPI object is returned upon success.
127  /// An invalid (or empty) UsdVolParticleFieldKernelGaussianEllipsoidAPI object is returned upon
128  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
129  /// resulting in failure.
130  ///
131  /// \sa UsdPrim::GetAppliedSchemas()
132  /// \sa UsdPrim::HasAPI()
133  /// \sa UsdPrim::CanApplyAPI()
134  /// \sa UsdPrim::ApplyAPI()
135  /// \sa UsdPrim::RemoveAPI()
136  ///
137  USDVOL_API
139  Apply(const UsdPrim &prim);
140 
141 protected:
142  /// Returns the kind of schema this class belongs to.
143  ///
144  /// \sa UsdSchemaKind
145  USDVOL_API
146  UsdSchemaKind _GetSchemaKind() const override;
147 
148 private:
149  // needs to invoke _GetStaticTfType.
150  friend class UsdSchemaRegistry;
151  USDVOL_API
152  static const TfType &_GetStaticTfType();
153 
154  static bool _IsTypedSchema();
155 
156  // override SchemaBase virtuals.
157  USDVOL_API
158  const TfType &_GetTfType() const override;
159 
160 public:
161  /// \name ParticleFieldKernelBaseAPI
162  ///
163  /// Convenience accessors for the built-in UsdVolParticleFieldKernelBaseAPI
164  ///
165  /// @{
166 
167  /// Constructs and returns a UsdVolParticleFieldKernelBaseAPI object.
168  /// Use this object to access UsdVolParticleFieldKernelBaseAPI custom methods.
169  USDVOL_API
171 
172  /// @}
173 public:
174  // ===================================================================== //
175  // Feel free to add custom code below this line, it will be preserved by
176  // the code generator.
177  //
178  // Just remember to:
179  // - Close the class declaration with };
180  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
181  // - Close the include guard with #endif
182  // ===================================================================== //
183  // --(BEGIN CUSTOM CODE)--
184 };
185 
187 
188 #endif
Single Apply API schema.
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
static USDVOL_API UsdVolParticleFieldKernelGaussianEllipsoidAPI Get(const UsdStagePtr &stage, const SdfPath &path)
virtual USDVOL_API ~UsdVolParticleFieldKernelGaussianEllipsoidAPI()
Destructor.
static USDVOL_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:280
UsdSchemaKind
Definition: common.h:112
static USDVOL_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
static USDVOL_API UsdVolParticleFieldKernelGaussianEllipsoidAPI Apply(const UsdPrim &prim)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
USDVOL_API UsdVolParticleFieldKernelBaseAPI ParticleFieldKernelBaseAPI() const
#define USDVOL_API
Definition: api.h:23
USDVOL_API UsdSchemaKind _GetSchemaKind() const override