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