HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
houdiniViewportLightAPI.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_HOUDINIVIEWPORTLIGHTAPI_H
8 #define USDHOUDINI_GENERATED_HOUDINIVIEWPORTLIGHTAPI_H
9 
10 /// \file usdHoudini/houdiniViewportLightAPI.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 // HOUDINIVIEWPORTLIGHTAPI //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdHoudiniHoudiniViewportLightAPI
37 ///
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::SingleApplyAPI;
48 
49  /// Construct a UsdHoudiniHoudiniViewportLightAPI on UsdPrim \p prim .
50  /// Equivalent to UsdHoudiniHoudiniViewportLightAPI::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
54  : UsdAPISchemaBase(prim)
55  {
56  }
57 
58  /// Construct a UsdHoudiniHoudiniViewportLightAPI on the prim held by \p schemaObj .
59  /// Should be preferred over UsdHoudiniHoudiniViewportLightAPI(schemaObj.GetPrim()),
60  /// as it preserves SchemaBase state.
62  : UsdAPISchemaBase(schemaObj)
63  {
64  }
65 
66  /// Destructor.
67  virtual ~UsdHoudiniHoudiniViewportLightAPI() 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 UsdHoudiniHoudiniViewportLightAPI 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  /// UsdHoudiniHoudiniViewportLightAPI(stage->GetPrimAtPath(path));
82  /// \endcode
83  ///
85  Get(const UsdStagePtr &stage, const SdfPath &path);
86 
87 
88  /// Returns true if this <b>single-apply</b> API schema can be applied to
89  /// the given \p prim. If this schema can not be a applied to the prim,
90  /// this returns false and, if provided, populates \p whyNot with the
91  /// reason it can not be applied.
92  ///
93  /// Note that if CanApply returns false, that does not necessarily imply
94  /// that calling Apply will fail. Callers are expected to call CanApply
95  /// before calling Apply if they want to ensure that it is valid to
96  /// apply a schema.
97  ///
98  /// \sa UsdPrim::GetAppliedSchemas()
99  /// \sa UsdPrim::HasAPI()
100  /// \sa UsdPrim::CanApplyAPI()
101  /// \sa UsdPrim::ApplyAPI()
102  /// \sa UsdPrim::RemoveAPI()
103  ///
104  static bool
105  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
106 
107  /// Applies this <b>single-apply</b> API schema to the given \p prim.
108  /// This information is stored by adding "HoudiniViewportLightAPI" to the
109  /// token-valued, listOp metadata \em apiSchemas on the prim.
110  ///
111  /// \return A valid UsdHoudiniHoudiniViewportLightAPI object is returned upon success.
112  /// An invalid (or empty) UsdHoudiniHoudiniViewportLightAPI object is returned upon
113  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
114  /// resulting in failure.
115  ///
116  /// \sa UsdPrim::GetAppliedSchemas()
117  /// \sa UsdPrim::HasAPI()
118  /// \sa UsdPrim::CanApplyAPI()
119  /// \sa UsdPrim::ApplyAPI()
120  /// \sa UsdPrim::RemoveAPI()
121  ///
123  Apply(const UsdPrim &prim);
124 
125 protected:
126  /// Returns the kind of schema this class belongs to.
127  ///
128  /// \sa UsdSchemaKind
129  UsdSchemaKind _GetSchemaKind() const override;
130 
131 private:
132  // needs to invoke _GetStaticTfType.
133  friend class UsdSchemaRegistry;
134  static const TfType &_GetStaticTfType();
135 
136  static bool _IsTypedSchema();
137 
138  // override SchemaBase virtuals.
139  const TfType &_GetTfType() const override;
140 
141 public:
142  // --------------------------------------------------------------------- //
143  // HOUDINICLIPPINGRANGE
144  // --------------------------------------------------------------------- //
145  /// Near and far clipping distances in scene units.
146  ///
147  /// | ||
148  /// | -- | -- |
149  /// | Declaration | `float2 houdini:clippingRange = (1, 1000000)` |
150  /// | C++ Type | GfVec2f |
151  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float2 |
152  UsdAttribute GetHoudiniClippingRangeAttr() const;
153 
154  /// See GetHoudiniClippingRangeAttr(), and also
155  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
156  /// If specified, author \p defaultValue as the attribute's default,
157  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
158  /// the default for \p writeSparsely is \c false.
159  UsdAttribute CreateHoudiniClippingRangeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
160 
161 public:
162  // ===================================================================== //
163  // Feel free to add custom code below this line, it will be preserved by
164  // the code generator.
165  //
166  // Just remember to:
167  // - Close the class declaration with };
168  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
169  // - Close the include guard with #endif
170  // ===================================================================== //
171  // --(BEGIN CUSTOM CODE)--
172 };
173 
175 
176 #endif
#define USDHOUDINI_API
Definition: api.h:23
Single Apply API schema.
UsdHoudiniHoudiniViewportLightAPI(const UsdSchemaBase &schemaObj)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
UsdSchemaKind
Definition: common.h:112
UsdHoudiniHoudiniViewportLightAPI(const UsdPrim &prim=UsdPrim())
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
Definition: value.h:146