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 Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USDHOUDINI_GENERATED_HOUDINICAMERAPLATEAPI_H
25 #define USDHOUDINI_GENERATED_HOUDINICAMERAPLATEAPI_H
26 
27 /// \file usdHoudini/houdiniCameraPlateAPI.h
28 
29 #include "pxr/pxr.h"
30 #include "./api.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "./tokens.h"
35 
36 #include "pxr/base/vt/value.h"
37 
38 #include "pxr/base/gf/vec3d.h"
39 #include "pxr/base/gf/vec3f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 
42 #include "pxr/base/tf/token.h"
43 #include "pxr/base/tf/type.h"
44 
46 
47 class SdfAssetPath;
48 
49 // -------------------------------------------------------------------------- //
50 // HOUDINICAMERAPLATEAPI //
51 // -------------------------------------------------------------------------- //
52 
53 /// \class UsdHoudiniHoudiniCameraPlateAPI
54 ///
55 /// Houdini API schema for adding a foreground and background plate
56 /// to a camera. These images are only displayed in the LOP viewport,
57 /// and only when looking through this camera.
58 ///
59 class
62 {
63 public:
64  /// Compile time constant representing what kind of schema this class is.
65  ///
66  /// \sa UsdSchemaKind
67  static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
68 
69  /// Construct a UsdHoudiniHoudiniCameraPlateAPI on UsdPrim \p prim .
70  /// Equivalent to UsdHoudiniHoudiniCameraPlateAPI::Get(prim.GetStage(), prim.GetPath())
71  /// for a \em valid \p prim, but will not immediately throw an error for
72  /// an invalid \p prim
74  : UsdAPISchemaBase(prim)
75  {
76  }
77 
78  /// Construct a UsdHoudiniHoudiniCameraPlateAPI on the prim held by \p schemaObj .
79  /// Should be preferred over UsdHoudiniHoudiniCameraPlateAPI(schemaObj.GetPrim()),
80  /// as it preserves SchemaBase state.
82  : UsdAPISchemaBase(schemaObj)
83  {
84  }
85 
86  /// Destructor.
87  virtual ~UsdHoudiniHoudiniCameraPlateAPI() override;
88 
89  /// Return a vector of names of all pre-declared attributes for this schema
90  /// class and all its ancestor classes. Does not include attributes that
91  /// may be authored by custom/extended methods of the schemas involved.
92  static const TfTokenVector &
93  GetSchemaAttributeNames(bool includeInherited=true);
94 
95  /// Return a UsdHoudiniHoudiniCameraPlateAPI holding the prim adhering to this
96  /// schema at \p path on \p stage. If no prim exists at \p path on
97  /// \p stage, or if the prim at that path does not adhere to this schema,
98  /// return an invalid schema object. This is shorthand for the following:
99  ///
100  /// \code
101  /// UsdHoudiniHoudiniCameraPlateAPI(stage->GetPrimAtPath(path));
102  /// \endcode
103  ///
105  Get(const UsdStagePtr &stage, const SdfPath &path);
106 
107 
108  /// Returns true if this <b>single-apply</b> API schema can be applied to
109  /// the given \p prim. If this schema can not be a applied to the prim,
110  /// this returns false and, if provided, populates \p whyNot with the
111  /// reason it can not be applied.
112  ///
113  /// Note that if CanApply returns false, that does not necessarily imply
114  /// that calling Apply will fail. Callers are expected to call CanApply
115  /// before calling Apply if they want to ensure that it is valid to
116  /// apply a schema.
117  ///
118  /// \sa UsdPrim::GetAppliedSchemas()
119  /// \sa UsdPrim::HasAPI()
120  /// \sa UsdPrim::CanApplyAPI()
121  /// \sa UsdPrim::ApplyAPI()
122  /// \sa UsdPrim::RemoveAPI()
123  ///
124  static bool
125  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
126 
127  /// Applies this <b>single-apply</b> API schema to the given \p prim.
128  /// This information is stored by adding "HoudiniCameraPlateAPI" to the
129  /// token-valued, listOp metadata \em apiSchemas on the prim.
130  ///
131  /// \return A valid UsdHoudiniHoudiniCameraPlateAPI object is returned upon success.
132  /// An invalid (or empty) UsdHoudiniHoudiniCameraPlateAPI object is returned upon
133  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
134  /// resulting in failure.
135  ///
136  /// \sa UsdPrim::GetAppliedSchemas()
137  /// \sa UsdPrim::HasAPI()
138  /// \sa UsdPrim::CanApplyAPI()
139  /// \sa UsdPrim::ApplyAPI()
140  /// \sa UsdPrim::RemoveAPI()
141  ///
143  Apply(const UsdPrim &prim);
144 
145 protected:
146  /// Returns the kind of schema this class belongs to.
147  ///
148  /// \sa UsdSchemaKind
149  UsdSchemaKind _GetSchemaKind() const override;
150 
151 private:
152  // needs to invoke _GetStaticTfType.
153  friend class UsdSchemaRegistry;
154  static const TfType &_GetStaticTfType();
155 
156  static bool _IsTypedSchema();
157 
158  // override SchemaBase virtuals.
159  const TfType &_GetTfType() const override;
160 
161 public:
162  // --------------------------------------------------------------------- //
163  // HOUDINIBACKGROUNDIMAGE
164  // --------------------------------------------------------------------- //
165  /// Indicates the image file to use as the background plate.
166  ///
167  /// | ||
168  /// | -- | -- |
169  /// | Declaration | `asset houdini:backgroundimage` |
170  /// | C++ Type | SdfAssetPath |
171  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
172  UsdAttribute GetHoudiniBackgroundimageAttr() const;
173 
174  /// See GetHoudiniBackgroundimageAttr(), and also
175  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
176  /// If specified, author \p defaultValue as the attribute's default,
177  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
178  /// the default for \p writeSparsely is \c false.
179  UsdAttribute CreateHoudiniBackgroundimageAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
180 
181 public:
182  // --------------------------------------------------------------------- //
183  // HOUDINIFOREGROUNDIMAGE
184  // --------------------------------------------------------------------- //
185  /// Indicates the image file to use as the foreground plate.
186  ///
187  /// | ||
188  /// | -- | -- |
189  /// | Declaration | `asset houdini:foregroundimage` |
190  /// | C++ Type | SdfAssetPath |
191  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
192  UsdAttribute GetHoudiniForegroundimageAttr() const;
193 
194  /// See GetHoudiniForegroundimageAttr(), and also
195  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
196  /// If specified, author \p defaultValue as the attribute's default,
197  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
198  /// the default for \p writeSparsely is \c false.
199  UsdAttribute CreateHoudiniForegroundimageAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
200 
201 public:
202  // ===================================================================== //
203  // Feel free to add custom code below this line, it will be preserved by
204  // the code generator.
205  //
206  // Just remember to:
207  // - Close the class declaration with };
208  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
209  // - Close the include guard with #endif
210  // ===================================================================== //
211  // --(BEGIN CUSTOM CODE)--
212 };
213 
215 
216 #endif
#define USDHOUDINI_API
Definition: api.h:47
Single Apply API schema.
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdHoudiniHoudiniCameraPlateAPI(const UsdPrim &prim=UsdPrim())
Definition: prim.h:135
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
Definition: path.h:291
UsdSchemaKind
Definition: common.h:127
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
Definition: type.h:64
UsdHoudiniHoudiniCameraPlateAPI(const UsdSchemaBase &schemaObj)
Definition: value.h:167