volume.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_VOLUME_H
8 #define USDVOL_GENERATED_VOLUME_H
9 
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdVol/api.h"
14 #include "pxr/usd/usdGeom/gprim.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 // VOLUME //
33 // -------------------------------------------------------------------------- //
34 
56 class UsdVolVolume : public UsdGeomGprim
57 {
58 public:
63 
68  explicit UsdVolVolume(const UsdPrim& prim=UsdPrim())
69  : UsdGeomGprim(prim)
70  {
71  }
72 
76  explicit UsdVolVolume(const UsdSchemaBase& schemaObj)
77  : UsdGeomGprim(schemaObj)
78  {
79  }
80 
82  USDVOL_API
83  virtual ~UsdVolVolume();
84 
88  USDVOL_API
89  static const TfTokenVector &
90  GetSchemaAttributeNames(bool includeInherited=true);
91 
101  USDVOL_API
102  static UsdVolVolume
103  Get(const UsdStagePtr &stage, const SdfPath &path);
104 
127  USDVOL_API
128  static UsdVolVolume
129  Define(const UsdStagePtr &stage, const SdfPath &path);
130 
131 protected:
135  USDVOL_API
136  UsdSchemaKind _GetSchemaKind() const override;
137 
138 private:
139  // needs to invoke _GetStaticTfType.
140  friend class UsdSchemaRegistry;
141  USDVOL_API
142  static const TfType &_GetStaticTfType();
143 
144  static bool _IsTypedSchema();
145 
146  // override SchemaBase virtuals.
147  USDVOL_API
148  const TfType &_GetTfType() const override;
149 
150 public:
151  // ===================================================================== //
152  // Feel free to add custom code below this line, it will be preserved by
153  // the code generator.
154  //
155  // Just remember to:
156  // - Close the class declaration with };
157  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
158  // - Close the include guard with #endif
159  // ===================================================================== //
160  // --(BEGIN CUSTOM CODE)--
161 
162  // --------------------------------------------------------------------- //
165  // --------------------------------------------------------------------- //
166 
167  typedef std::map<TfToken, SdfPath> FieldMap;
168 
176  USDVOL_API
177  FieldMap GetFieldPaths() const;
178 
186  USDVOL_API
187  bool HasFieldRelationship(const TfToken &name) const;
188 
195  USDVOL_API
196  SdfPath GetFieldPath(const TfToken &name) const;
197 
213  USDVOL_API
214  bool CreateFieldRelationship(const TfToken &name,
215  const SdfPath &fieldPath) const;
216 
225  USDVOL_API
226  bool BlockFieldRelationship(const TfToken &name) const;
227 
228 private:
233  static TfToken _MakeNamespaced(const TfToken& name);
234 };
235 
236 PXR_NAMESPACE_CLOSE_SCOPE
237 
238 #endif
USDVOL_API FieldMap GetFieldPaths() const
Return a map of field relationship names to the fields themselves, represented as prim paths.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: volume.h:62
USDVOL_API bool HasFieldRelationship(const TfToken &name) const
Checks if there is an existing field relationship with a given name.
UsdVolVolume(const UsdSchemaBase &schemaObj)
Construct a UsdVolVolume on the prim held by schemaObj .
Definition: volume.h:76
A renderable volume primitive.
Definition: volume.h:56
static USDVOL_API UsdVolVolume Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdVolVolume holding the prim adhering to this schema at path on stage.
static USDVOL_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
static USDVOL_API UsdVolVolume Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
USDVOL_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDVOL_API SdfPath GetFieldPath(const TfToken &name) const
Checks if there is an existing field relationship with a given name, and if so, returns the path to t...
USDVOL_API bool BlockFieldRelationship(const TfToken &name) const
Blocks an existing field relationship on this volume, ensuring it will not be enumerated by GetFieldP...
Represents a concrete typed schema.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
UsdVolVolume(const UsdPrim &prim=UsdPrim())
Construct a UsdVolVolume on UsdPrim prim .
Definition: volume.h:68
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
Base class for all geometric primitives.
Definition: gprim.h:49
TfType represents a dynamic runtime type.
Definition: type.h:47
Singleton registry that provides access to schema type information and the prim definitions for regis...
virtual USDVOL_API ~UsdVolVolume()
Destructor.
The base class for all schema types in Usd.
Definition: schemaBase.h:39
USDVOL_API bool CreateFieldRelationship(const TfToken &name, const SdfPath &fieldPath) const
Creates a relationship on this volume that targets the specified field.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...