HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
houdiniLightBarnDoorAPI.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_HOUDINILIGHTBARNDOORAPI_H
8 #define USDHOUDINI_GENERATED_HOUDINILIGHTBARNDOORAPI_H
9 
10 /// \file usdHoudini/houdiniLightBarnDoorAPI.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 // HOUDINILIGHTBARNDOORAPI //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdHoudiniHoudiniLightBarnDoorAPI
37 ///
38 /// Houdini API schema for describing barn door attributes on lights.
39 /// This should not be avoided, if possible, in favour of using Light Filters
40 /// instead. This schema (and the associated attributes) will be deprecated and
41 /// removed from Solaris in a later release of Houdini.
42 ///
43 class
46 {
47 public:
48  /// Compile time constant representing what kind of schema this class is.
49  ///
50  /// \sa UsdSchemaKind
51  static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
52 
53  /// Construct a UsdHoudiniHoudiniLightBarnDoorAPI on UsdPrim \p prim .
54  /// Equivalent to UsdHoudiniHoudiniLightBarnDoorAPI::Get(prim.GetStage(), prim.GetPath())
55  /// for a \em valid \p prim, but will not immediately throw an error for
56  /// an invalid \p prim
58  : UsdAPISchemaBase(prim)
59  {
60  }
61 
62  /// Construct a UsdHoudiniHoudiniLightBarnDoorAPI on the prim held by \p schemaObj .
63  /// Should be preferred over UsdHoudiniHoudiniLightBarnDoorAPI(schemaObj.GetPrim()),
64  /// as it preserves SchemaBase state.
66  : UsdAPISchemaBase(schemaObj)
67  {
68  }
69 
70  /// Destructor.
71  virtual ~UsdHoudiniHoudiniLightBarnDoorAPI() override;
72 
73  /// Return a vector of names of all pre-declared attributes for this schema
74  /// class and all its ancestor classes. Does not include attributes that
75  /// may be authored by custom/extended methods of the schemas involved.
76  static const TfTokenVector &
77  GetSchemaAttributeNames(bool includeInherited=true);
78 
79  /// Return a UsdHoudiniHoudiniLightBarnDoorAPI holding the prim adhering to this
80  /// schema at \p path on \p stage. If no prim exists at \p path on
81  /// \p stage, or if the prim at that path does not adhere to this schema,
82  /// return an invalid schema object. This is shorthand for the following:
83  ///
84  /// \code
85  /// UsdHoudiniHoudiniLightBarnDoorAPI(stage->GetPrimAtPath(path));
86  /// \endcode
87  ///
89  Get(const UsdStagePtr &stage, const SdfPath &path);
90 
91 
92  /// Returns true if this <b>single-apply</b> API schema can be applied to
93  /// the given \p prim. If this schema can not be a applied to the prim,
94  /// this returns false and, if provided, populates \p whyNot with the
95  /// reason it can not be applied.
96  ///
97  /// Note that if CanApply returns false, that does not necessarily imply
98  /// that calling Apply will fail. Callers are expected to call CanApply
99  /// before calling Apply if they want to ensure that it is valid to
100  /// apply a schema.
101  ///
102  /// \sa UsdPrim::GetAppliedSchemas()
103  /// \sa UsdPrim::HasAPI()
104  /// \sa UsdPrim::CanApplyAPI()
105  /// \sa UsdPrim::ApplyAPI()
106  /// \sa UsdPrim::RemoveAPI()
107  ///
108  static bool
109  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
110 
111  /// Applies this <b>single-apply</b> API schema to the given \p prim.
112  /// This information is stored by adding "HoudiniLightBarnDoorAPI" to the
113  /// token-valued, listOp metadata \em apiSchemas on the prim.
114  ///
115  /// \return A valid UsdHoudiniHoudiniLightBarnDoorAPI object is returned upon success.
116  /// An invalid (or empty) UsdHoudiniHoudiniLightBarnDoorAPI object is returned upon
117  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
118  /// resulting in failure.
119  ///
120  /// \sa UsdPrim::GetAppliedSchemas()
121  /// \sa UsdPrim::HasAPI()
122  /// \sa UsdPrim::CanApplyAPI()
123  /// \sa UsdPrim::ApplyAPI()
124  /// \sa UsdPrim::RemoveAPI()
125  ///
127  Apply(const UsdPrim &prim);
128 
129 protected:
130  /// Returns the kind of schema this class belongs to.
131  ///
132  /// \sa UsdSchemaKind
133  UsdSchemaKind _GetSchemaKind() const override;
134 
135 private:
136  // needs to invoke _GetStaticTfType.
137  friend class UsdSchemaRegistry;
138  static const TfType &_GetStaticTfType();
139 
140  static bool _IsTypedSchema();
141 
142  // override SchemaBase virtuals.
143  const TfType &_GetTfType() const override;
144 
145 public:
146  // --------------------------------------------------------------------- //
147  // BARNDOORLEFT
148  // --------------------------------------------------------------------- //
149  /// Slides in a light blocker from the left, covering part of the
150  /// spotlight cone. `1.0` reaches all the way across the cone, blocking all
151  /// light.
152  ///
153  /// | ||
154  /// | -- | -- |
155  /// | Declaration | `float barndoorleft = 0` |
156  /// | C++ Type | float |
157  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
158  UsdAttribute GetBarndoorleftAttr() const;
159 
160  /// See GetBarndoorleftAttr(), and also
161  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
162  /// If specified, author \p defaultValue as the attribute's default,
163  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
164  /// the default for \p writeSparsely is \c false.
165  UsdAttribute CreateBarndoorleftAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
166 
167 public:
168  // --------------------------------------------------------------------- //
169  // BARNDOORLEFTEDGE
170  // --------------------------------------------------------------------- //
171  /// Extends the solid light blocker above by an additional soft
172  /// edge. `1.0` creates a gradient as wide as the spotlight cone.
173  ///
174  /// | ||
175  /// | -- | -- |
176  /// | Declaration | `float barndoorleftedge = 0` |
177  /// | C++ Type | float |
178  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
179  UsdAttribute GetBarndoorleftedgeAttr() const;
180 
181  /// See GetBarndoorleftedgeAttr(), and also
182  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
183  /// If specified, author \p defaultValue as the attribute's default,
184  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
185  /// the default for \p writeSparsely is \c false.
186  UsdAttribute CreateBarndoorleftedgeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
187 
188 public:
189  // --------------------------------------------------------------------- //
190  // BARNDOORRIGHT
191  // --------------------------------------------------------------------- //
192  /// Slides in a light blocker from the right, covering part of the
193  /// spotlight cone. `1.0` reaches all the way across the cone, blocking all
194  /// light.
195  ///
196  /// | ||
197  /// | -- | -- |
198  /// | Declaration | `float barndoorright = 0` |
199  /// | C++ Type | float |
200  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
201  UsdAttribute GetBarndoorrightAttr() const;
202 
203  /// See GetBarndoorrightAttr(), and also
204  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
205  /// If specified, author \p defaultValue as the attribute's default,
206  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
207  /// the default for \p writeSparsely is \c false.
208  UsdAttribute CreateBarndoorrightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
209 
210 public:
211  // --------------------------------------------------------------------- //
212  // BARNDOORRIGHTEDGE
213  // --------------------------------------------------------------------- //
214  /// Extends the solid light blocker above by an additional soft
215  /// edge. `1.0` creates a gradient as wide as the spotlight cone.
216  ///
217  /// | ||
218  /// | -- | -- |
219  /// | Declaration | `float barndoorrightedge = 0` |
220  /// | C++ Type | float |
221  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
222  UsdAttribute GetBarndoorrightedgeAttr() const;
223 
224  /// See GetBarndoorrightedgeAttr(), and also
225  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
226  /// If specified, author \p defaultValue as the attribute's default,
227  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
228  /// the default for \p writeSparsely is \c false.
229  UsdAttribute CreateBarndoorrightedgeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
230 
231 public:
232  // --------------------------------------------------------------------- //
233  // BARNDOORTOP
234  // --------------------------------------------------------------------- //
235  /// Slides in a light blocker from the top, covering part of the
236  /// spotlight cone. `1.0` reaches all the way across the cone, blocking all
237  /// light.
238  ///
239  /// | ||
240  /// | -- | -- |
241  /// | Declaration | `float barndoortop = 0` |
242  /// | C++ Type | float |
243  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
244  UsdAttribute GetBarndoortopAttr() const;
245 
246  /// See GetBarndoortopAttr(), and also
247  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
248  /// If specified, author \p defaultValue as the attribute's default,
249  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
250  /// the default for \p writeSparsely is \c false.
251  UsdAttribute CreateBarndoortopAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
252 
253 public:
254  // --------------------------------------------------------------------- //
255  // BARNDOORTOPEDGE
256  // --------------------------------------------------------------------- //
257  /// Extends the solid light blocker above by an additional soft
258  /// edge. `1.0` creates a gradient as wide as the spotlight cone.
259  ///
260  /// | ||
261  /// | -- | -- |
262  /// | Declaration | `float barndoortopedge = 0` |
263  /// | C++ Type | float |
264  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
265  UsdAttribute GetBarndoortopedgeAttr() const;
266 
267  /// See GetBarndoortopedgeAttr(), and also
268  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
269  /// If specified, author \p defaultValue as the attribute's default,
270  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
271  /// the default for \p writeSparsely is \c false.
272  UsdAttribute CreateBarndoortopedgeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
273 
274 public:
275  // --------------------------------------------------------------------- //
276  // BARNDOORBOTTOM
277  // --------------------------------------------------------------------- //
278  /// Slides in a light blocker from the bottom, covering part of the
279  /// spotlight cone. `1.0` reaches all the way across the cone, blocking all
280  /// light.
281  ///
282  /// | ||
283  /// | -- | -- |
284  /// | Declaration | `float barndoorbottom = 0` |
285  /// | C++ Type | float |
286  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
287  UsdAttribute GetBarndoorbottomAttr() const;
288 
289  /// See GetBarndoorbottomAttr(), and also
290  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
291  /// If specified, author \p defaultValue as the attribute's default,
292  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
293  /// the default for \p writeSparsely is \c false.
294  UsdAttribute CreateBarndoorbottomAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
295 
296 public:
297  // --------------------------------------------------------------------- //
298  // BARNDOORBOTTOMEDGE
299  // --------------------------------------------------------------------- //
300  /// Extends the solid light blocker above by an additional soft
301  /// edge. `1.0` creates a gradient as wide as the spotlight cone.
302  ///
303  /// | ||
304  /// | -- | -- |
305  /// | Declaration | `float barndoorbottomedge = 0` |
306  /// | C++ Type | float |
307  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
308  UsdAttribute GetBarndoorbottomedgeAttr() const;
309 
310  /// See GetBarndoorbottomedgeAttr(), and also
311  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
312  /// If specified, author \p defaultValue as the attribute's default,
313  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
314  /// the default for \p writeSparsely is \c false.
315  UsdAttribute CreateBarndoorbottomedgeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
316 
317 public:
318  // ===================================================================== //
319  // Feel free to add custom code below this line, it will be preserved by
320  // the code generator.
321  //
322  // Just remember to:
323  // - Close the class declaration with };
324  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
325  // - Close the include guard with #endif
326  // ===================================================================== //
327  // --(BEGIN CUSTOM CODE)--
328 };
329 
331 
332 #endif
#define USDHOUDINI_API
Definition: api.h:23
Single Apply API schema.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdHoudiniHoudiniLightBarnDoorAPI(const UsdSchemaBase &schemaObj)
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
UsdHoudiniHoudiniLightBarnDoorAPI(const UsdPrim &prim=UsdPrim())
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
Definition: value.h:146