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
60 USDHOUDINI_API
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  /// \deprecated
70  /// Same as schemaKind, provided to maintain temporary backward
71  /// compatibility with older generated schemas.
72  static const UsdSchemaKind schemaType = UsdSchemaKind::SingleApplyAPI;
73 
74  /// Construct a UsdHoudiniHoudiniCameraPlateAPI on UsdPrim \p prim .
75  /// Equivalent to UsdHoudiniHoudiniCameraPlateAPI::Get(prim.GetStage(), prim.GetPath())
76  /// for a \em valid \p prim, but will not immediately throw an error for
77  /// an invalid \p prim
79  : UsdAPISchemaBase(prim)
80  {
81  }
82 
83  /// Construct a UsdHoudiniHoudiniCameraPlateAPI on the prim held by \p schemaObj .
84  /// Should be preferred over UsdHoudiniHoudiniCameraPlateAPI(schemaObj.GetPrim()),
85  /// as it preserves SchemaBase state.
87  : UsdAPISchemaBase(schemaObj)
88  {
89  }
90 
91  /// Destructor.
92  virtual ~UsdHoudiniHoudiniCameraPlateAPI() override;
93 
94  /// Return a vector of names of all pre-declared attributes for this schema
95  /// class and all its ancestor classes. Does not include attributes that
96  /// may be authored by custom/extended methods of the schemas involved.
97  static const TfTokenVector &
98  GetSchemaAttributeNames(bool includeInherited=true);
99 
100  /// Return a UsdHoudiniHoudiniCameraPlateAPI holding the prim adhering to this
101  /// schema at \p path on \p stage. If no prim exists at \p path on
102  /// \p stage, or if the prim at that path does not adhere to this schema,
103  /// return an invalid schema object. This is shorthand for the following:
104  ///
105  /// \code
106  /// UsdHoudiniHoudiniCameraPlateAPI(stage->GetPrimAtPath(path));
107  /// \endcode
108  ///
110  Get(const UsdStagePtr &stage, const SdfPath &path);
111 
112 
113  /// Applies this <b>single-apply</b> API schema to the given \p prim.
114  /// This information is stored by adding "HoudiniCameraPlateAPI" to the
115  /// token-valued, listOp metadata \em apiSchemas on the prim.
116  ///
117  /// \return A valid UsdHoudiniHoudiniCameraPlateAPI object is returned upon success.
118  /// An invalid (or empty) UsdHoudiniHoudiniCameraPlateAPI object is returned upon
119  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
120  /// resulting in failure.
121  ///
122  /// \sa UsdPrim::GetAppliedSchemas()
123  /// \sa UsdPrim::HasAPI()
124  /// \sa UsdPrim::ApplyAPI()
125  /// \sa UsdPrim::RemoveAPI()
126  ///
128  Apply(const UsdPrim &prim);
129 
130 protected:
131  /// Returns the kind of schema this class belongs to.
132  ///
133  /// \sa UsdSchemaKind
134  UsdSchemaKind _GetSchemaKind() const override;
135 
136  /// \deprecated
137  /// Same as _GetSchemaKind, provided to maintain temporary backward
138  /// compatibility with older generated schemas.
139  UsdSchemaKind _GetSchemaType() const override;
140 
141 private:
142  // needs to invoke _GetStaticTfType.
143  friend class UsdSchemaRegistry;
144  static const TfType &_GetStaticTfType();
145 
146  static bool _IsTypedSchema();
147 
148  // override SchemaBase virtuals.
149  const TfType &_GetTfType() const override;
150 
151 public:
152  // --------------------------------------------------------------------- //
153  // HOUDINIBACKGROUNDIMAGE
154  // --------------------------------------------------------------------- //
155  /// Indicates the image file to use as the background plate.
156  ///
157  /// | ||
158  /// | -- | -- |
159  /// | Declaration | `asset houdini:backgroundimage` |
160  /// | C++ Type | SdfAssetPath |
161  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
162  UsdAttribute GetHoudiniBackgroundimageAttr() const;
163 
164  /// See GetHoudiniBackgroundimageAttr(), and also
165  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
166  /// If specified, author \p defaultValue as the attribute's default,
167  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
168  /// the default for \p writeSparsely is \c false.
169  UsdAttribute CreateHoudiniBackgroundimageAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
170 
171 public:
172  // --------------------------------------------------------------------- //
173  // HOUDINIFOREGROUNDIMAGE
174  // --------------------------------------------------------------------- //
175  /// Indicates the image file to use as the foreground plate.
176  ///
177  /// | ||
178  /// | -- | -- |
179  /// | Declaration | `asset houdini:foregroundimage` |
180  /// | C++ Type | SdfAssetPath |
181  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
182  UsdAttribute GetHoudiniForegroundimageAttr() const;
183 
184  /// See GetHoudiniForegroundimageAttr(), and also
185  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
186  /// If specified, author \p defaultValue as the attribute's default,
187  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
188  /// the default for \p writeSparsely is \c false.
189  UsdAttribute CreateHoudiniForegroundimageAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
190 
191 public:
192  // ===================================================================== //
193  // Feel free to add custom code below this line, it will be preserved by
194  // the code generator.
195  //
196  // Just remember to:
197  // - Close the class declaration with };
198  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
199  // - Close the include guard with #endif
200  // ===================================================================== //
201  // --(BEGIN CUSTOM CODE)--
202 };
203 
205 
206 #endif
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
UsdSchemaKind
Definition: common.h:127
Single Apply API schema.
UsdHoudiniHoudiniCameraPlateAPI(const UsdPrim &prim=UsdPrim())
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
Definition: path.h:288
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
Definition: type.h:64
UsdHoudiniHoudiniCameraPlateAPI(const UsdSchemaBase &schemaObj)
Definition: value.h:168