HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
houdiniCameraPlateAPI.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_HOUDINICAMERAPLATEAPI_H
8 #define USDHOUDINI_GENERATED_HOUDINICAMERAPLATEAPI_H
9 
10 /// \file usdHoudini/houdiniCameraPlateAPI.h
11 
12 #include "pxr/pxr.h"
13 #include "./api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
17 #include "./tokens.h"
18 
19 #include "pxr/base/vt/value.h"
20 
21 #include "pxr/base/gf/vec3d.h"
22 #include "pxr/base/gf/vec3f.h"
23 #include "pxr/base/gf/matrix4d.h"
24 
25 #include "pxr/base/tf/token.h"
26 #include "pxr/base/tf/type.h"
27 
29 
30 class SdfAssetPath;
31 
32 // -------------------------------------------------------------------------- //
33 // HOUDINICAMERAPLATEAPI //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdHoudiniHoudiniCameraPlateAPI
37 ///
38 /// Houdini API schema for adding a foreground and background plate
39 /// to a camera. These images are only displayed in the LOP viewport,
40 /// and only when looking through this camera.
41 ///
42 class
45 {
46 public:
47  /// Compile time constant representing what kind of schema this class is.
48  ///
49  /// \sa UsdSchemaKind
50  static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
51 
52  /// Construct a UsdHoudiniHoudiniCameraPlateAPI on UsdPrim \p prim .
53  /// Equivalent to UsdHoudiniHoudiniCameraPlateAPI::Get(prim.GetStage(), prim.GetPath())
54  /// for a \em valid \p prim, but will not immediately throw an error for
55  /// an invalid \p prim
57  : UsdAPISchemaBase(prim)
58  {
59  }
60 
61  /// Construct a UsdHoudiniHoudiniCameraPlateAPI on the prim held by \p schemaObj .
62  /// Should be preferred over UsdHoudiniHoudiniCameraPlateAPI(schemaObj.GetPrim()),
63  /// as it preserves SchemaBase state.
65  : UsdAPISchemaBase(schemaObj)
66  {
67  }
68 
69  /// Destructor.
70  virtual ~UsdHoudiniHoudiniCameraPlateAPI() override;
71 
72  /// Return a vector of names of all pre-declared attributes for this schema
73  /// class and all its ancestor classes. Does not include attributes that
74  /// may be authored by custom/extended methods of the schemas involved.
75  static const TfTokenVector &
76  GetSchemaAttributeNames(bool includeInherited=true);
77 
78  /// Return a UsdHoudiniHoudiniCameraPlateAPI 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  /// UsdHoudiniHoudiniCameraPlateAPI(stage->GetPrimAtPath(path));
85  /// \endcode
86  ///
88  Get(const UsdStagePtr &stage, const SdfPath &path);
89 
90 
91  /// Returns true if this <b>single-apply</b> API schema can be applied to
92  /// the given \p prim. If this schema can not be a applied to the prim,
93  /// this returns false and, if provided, populates \p whyNot with the
94  /// reason it can not be applied.
95  ///
96  /// Note that if CanApply returns false, that does not necessarily imply
97  /// that calling Apply will fail. Callers are expected to call CanApply
98  /// before calling Apply if they want to ensure that it is valid to
99  /// apply a schema.
100  ///
101  /// \sa UsdPrim::GetAppliedSchemas()
102  /// \sa UsdPrim::HasAPI()
103  /// \sa UsdPrim::CanApplyAPI()
104  /// \sa UsdPrim::ApplyAPI()
105  /// \sa UsdPrim::RemoveAPI()
106  ///
107  static bool
108  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
109 
110  /// Applies this <b>single-apply</b> API schema to the given \p prim.
111  /// This information is stored by adding "HoudiniCameraPlateAPI" to the
112  /// token-valued, listOp metadata \em apiSchemas on the prim.
113  ///
114  /// \return A valid UsdHoudiniHoudiniCameraPlateAPI object is returned upon success.
115  /// An invalid (or empty) UsdHoudiniHoudiniCameraPlateAPI object is returned upon
116  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
117  /// resulting in failure.
118  ///
119  /// \sa UsdPrim::GetAppliedSchemas()
120  /// \sa UsdPrim::HasAPI()
121  /// \sa UsdPrim::CanApplyAPI()
122  /// \sa UsdPrim::ApplyAPI()
123  /// \sa UsdPrim::RemoveAPI()
124  ///
126  Apply(const UsdPrim &prim);
127 
128 protected:
129  /// Returns the kind of schema this class belongs to.
130  ///
131  /// \sa UsdSchemaKind
132  UsdSchemaKind _GetSchemaKind() const override;
133 
134 private:
135  // needs to invoke _GetStaticTfType.
136  friend class UsdSchemaRegistry;
137  static const TfType &_GetStaticTfType();
138 
139  static bool _IsTypedSchema();
140 
141  // override SchemaBase virtuals.
142  const TfType &_GetTfType() const override;
143 
144 public:
145  // --------------------------------------------------------------------- //
146  // HOUDINIBACKGROUNDIMAGE
147  // --------------------------------------------------------------------- //
148  /// Indicates the image file to use as the background plate.
149  ///
150  /// | ||
151  /// | -- | -- |
152  /// | Declaration | `asset houdini:backgroundimage` |
153  /// | C++ Type | SdfAssetPath |
154  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
155  UsdAttribute GetHoudiniBackgroundimageAttr() const;
156 
157  /// See GetHoudiniBackgroundimageAttr(), and also
158  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
159  /// If specified, author \p defaultValue as the attribute's default,
160  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
161  /// the default for \p writeSparsely is \c false.
162  UsdAttribute CreateHoudiniBackgroundimageAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
163 
164 public:
165  // --------------------------------------------------------------------- //
166  // HOUDINIFOREGROUNDIMAGE
167  // --------------------------------------------------------------------- //
168  /// Indicates the image file to use as the foreground plate.
169  ///
170  /// | ||
171  /// | -- | -- |
172  /// | Declaration | `asset houdini:foregroundimage` |
173  /// | C++ Type | SdfAssetPath |
174  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
175  UsdAttribute GetHoudiniForegroundimageAttr() const;
176 
177  /// See GetHoudiniForegroundimageAttr(), and also
178  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
179  /// If specified, author \p defaultValue as the attribute's default,
180  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
181  /// the default for \p writeSparsely is \c false.
182  UsdAttribute CreateHoudiniForegroundimageAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
183 
184 public:
185  // ===================================================================== //
186  // Feel free to add custom code below this line, it will be preserved by
187  // the code generator.
188  //
189  // Just remember to:
190  // - Close the class declaration with };
191  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
192  // - Close the include guard with #endif
193  // ===================================================================== //
194  // --(BEGIN CUSTOM CODE)--
195 };
196 
198 
199 #endif
#define USDHOUDINI_API
Definition: api.h:23
Single Apply API schema.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdHoudiniHoudiniCameraPlateAPI(const UsdPrim &prim=UsdPrim())
Definition: prim.h:116
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
UsdHoudiniHoudiniCameraPlateAPI(const UsdSchemaBase &schemaObj)
Definition: value.h:146