HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
houdiniLayerInfo.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 USDHOUDINI_GENERATED_HOUDINILAYERINFO_H
8 #define USDHOUDINI_GENERATED_HOUDINILAYERINFO_H
9 
10 /// \file usdHoudini/houdiniLayerInfo.h
11 
12 #include "pxr/pxr.h"
13 #include "./api.h"
14 #include "pxr/usd/usd/typed.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 // HOUDINILAYERINFO //
33 // -------------------------------------------------------------------------- //
34 
35 /// \class UsdHoudiniHoudiniLayerInfo
36 ///
37 /// Holder for Houdini-specific layer information.
38 ///
39 class
42 {
43 public:
44  /// Compile time constant representing what kind of schema this class is.
45  ///
46  /// \sa UsdSchemaKind
47  static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
48 
49  /// Construct a UsdHoudiniHoudiniLayerInfo on UsdPrim \p prim .
50  /// Equivalent to UsdHoudiniHoudiniLayerInfo::Get(prim.GetStage(), prim.GetPath())
51  /// for a \em valid \p prim, but will not immediately throw an error for
52  /// an invalid \p prim
53  explicit UsdHoudiniHoudiniLayerInfo(const UsdPrim& prim=UsdPrim())
54  : UsdTyped(prim)
55  {
56  }
57 
58  /// Construct a UsdHoudiniHoudiniLayerInfo on the prim held by \p schemaObj .
59  /// Should be preferred over UsdHoudiniHoudiniLayerInfo(schemaObj.GetPrim()),
60  /// as it preserves SchemaBase state.
61  explicit UsdHoudiniHoudiniLayerInfo(const UsdSchemaBase& schemaObj)
62  : UsdTyped(schemaObj)
63  {
64  }
65 
66  /// Destructor.
67  virtual ~UsdHoudiniHoudiniLayerInfo() override;
68 
69  /// Return a vector of names of all pre-declared attributes for this schema
70  /// class and all its ancestor classes. Does not include attributes that
71  /// may be authored by custom/extended methods of the schemas involved.
72  static const TfTokenVector &
73  GetSchemaAttributeNames(bool includeInherited=true);
74 
75  /// Return a UsdHoudiniHoudiniLayerInfo 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  /// UsdHoudiniHoudiniLayerInfo(stage->GetPrimAtPath(path));
82  /// \endcode
83  ///
85  Get(const UsdStagePtr &stage, const SdfPath &path);
86 
87  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
88  /// is defined (according to UsdPrim::IsDefined()) on this stage.
89  ///
90  /// If a prim adhering to this schema at \p path is already defined on this
91  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
92  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
93  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
94  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
95  /// current EditTarget for any nonexistent, or existing but not \a Defined
96  /// ancestors.
97  ///
98  /// The given \a path must be an absolute prim path that does not contain
99  /// any variant selections.
100  ///
101  /// If it is impossible to author any of the necessary PrimSpecs, (for
102  /// example, in case \a path cannot map to the current UsdEditTarget's
103  /// namespace) issue an error and return an invalid \a UsdPrim.
104  ///
105  /// Note that this method may return a defined prim whose typeName does not
106  /// specify this schema class, in case a stronger typeName opinion overrides
107  /// the opinion at the current EditTarget.
108  ///
110  Define(const UsdStagePtr &stage, const SdfPath &path);
111 
112 protected:
113  /// Returns the kind of schema this class belongs to.
114  ///
115  /// \sa UsdSchemaKind
116  UsdSchemaKind _GetSchemaKind() const override;
117 
118 private:
119  // needs to invoke _GetStaticTfType.
120  friend class UsdSchemaRegistry;
121  static const TfType &_GetStaticTfType();
122 
123  static bool _IsTypedSchema();
124 
125  // override SchemaBase virtuals.
126  const TfType &_GetTfType() const override;
127 
128 public:
129  // ===================================================================== //
130  // Feel free to add custom code below this line, it will be preserved by
131  // the code generator.
132  //
133  // Just remember to:
134  // - Close the class declaration with };
135  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
136  // - Close the include guard with #endif
137  // ===================================================================== //
138  // --(BEGIN CUSTOM CODE)--
139 };
140 
142 
143 #endif
#define USDHOUDINI_API
Definition: api.h:23
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdHoudiniHoudiniLayerInfo(const UsdPrim &prim=UsdPrim())
Represents a concrete typed schema.
Definition: prim.h:116
Definition: typed.h:44
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
UsdSchemaKind
Definition: common.h:112
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
UsdHoudiniHoudiniLayerInfo(const UsdSchemaBase &schemaObj)