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