HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
volumeFieldBase.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_VOLUMEFIELDBASE_H
8 #define USDVOL_GENERATED_VOLUMEFIELDBASE_H
9 
10 /// \file usdVol/volumeFieldBase.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 // VOLUMEFIELDBASE //
33 // -------------------------------------------------------------------------- //
34 
35 /// \class UsdVolVolumeFieldBase
36 ///
37 /// Base class for volume field primitives.
38 ///
40 {
41 public:
42  /// Compile time constant representing what kind of schema this class is.
43  ///
44  /// \sa UsdSchemaKind
46 
47  /// Construct a UsdVolVolumeFieldBase on UsdPrim \p prim .
48  /// Equivalent to UsdVolVolumeFieldBase::Get(prim.GetStage(), prim.GetPath())
49  /// for a \em valid \p prim, but will not immediately throw an error for
50  /// an invalid \p prim
51  explicit UsdVolVolumeFieldBase(const UsdPrim& prim=UsdPrim())
52  : UsdGeomXformable(prim)
53  {
54  }
55 
56  /// Construct a UsdVolVolumeFieldBase on the prim held by \p schemaObj .
57  /// Should be preferred over UsdVolVolumeFieldBase(schemaObj.GetPrim()),
58  /// as it preserves SchemaBase state.
59  explicit UsdVolVolumeFieldBase(const UsdSchemaBase& schemaObj)
60  : UsdGeomXformable(schemaObj)
61  {
62  }
63 
64  /// Destructor.
66  virtual ~UsdVolVolumeFieldBase();
67 
68  /// Return a vector of names of all pre-declared attributes for this schema
69  /// class and all its ancestor classes. Does not include attributes that
70  /// may be authored by custom/extended methods of the schemas involved.
72  static const TfTokenVector &
73  GetSchemaAttributeNames(bool includeInherited=true);
74 
75  /// Return a UsdVolVolumeFieldBase holding the prim adhering to this
76  /// schema at \p path on \p stage. If no prim exists at \p path on
77  /// \p stage, or if the prim at that path does not adhere to this schema,
78  /// return an invalid schema object. This is shorthand for the following:
79  ///
80  /// \code
81  /// UsdVolVolumeFieldBase(stage->GetPrimAtPath(path));
82  /// \endcode
83  ///
86  Get(const UsdStagePtr &stage, const SdfPath &path);
87 
88 
89 protected:
90  /// Returns the kind of schema this class belongs to.
91  ///
92  /// \sa UsdSchemaKind
94  UsdSchemaKind _GetSchemaKind() const override;
95 
96 private:
97  // needs to invoke _GetStaticTfType.
98  friend class UsdSchemaRegistry;
100  static const TfType &_GetStaticTfType();
101 
102  static bool _IsTypedSchema();
103 
104  // override SchemaBase virtuals.
105  USDVOL_API
106  const TfType &_GetTfType() const override;
107 
108 public:
109  // ===================================================================== //
110  // Feel free to add custom code below this line, it will be preserved by
111  // the code generator.
112  //
113  // Just remember to:
114  // - Close the class declaration with };
115  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
116  // - Close the include guard with #endif
117  // ===================================================================== //
118  // --(BEGIN CUSTOM CODE)--
119 };
120 
122 
123 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
virtual USDVOL_API ~UsdVolVolumeFieldBase()
Destructor.
UsdVolVolumeFieldBase(const UsdPrim &prim=UsdPrim())
Represents a non-concrete typed schema.
USDVOL_API UsdSchemaKind _GetSchemaKind() const override
static USDVOL_API UsdVolVolumeFieldBase Get(const UsdStagePtr &stage, const SdfPath &path)
static const UsdSchemaKind schemaKind
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:280
UsdSchemaKind
Definition: common.h:112
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
#define USDVOL_API
Definition: api.h:23
UsdVolVolumeFieldBase(const UsdSchemaBase &schemaObj)
static USDVOL_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)