HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nonboundableLightBase.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 USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H
8 #define USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H
9 
10 /// \file usdLux/nonboundableLightBase.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdLux/api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
17 #include "pxr/usd/usdLux/lightAPI.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 // NONBOUNDABLELIGHTBASE //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdLuxNonboundableLightBase
37 ///
38 /// Base class for intrinsic lights that are not boundable.
39 ///
40 /// The primary purpose of this class is to provide a direct API to the
41 /// functions provided by LightAPI for concrete derived light types.
42 ///
43 ///
45 {
46 public:
47  /// Compile time constant representing what kind of schema this class is.
48  ///
49  /// \sa UsdSchemaKind
51 
52  /// Construct a UsdLuxNonboundableLightBase on UsdPrim \p prim .
53  /// Equivalent to UsdLuxNonboundableLightBase::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  : UsdGeomXformable(prim)
58  {
59  }
60 
61  /// Construct a UsdLuxNonboundableLightBase on the prim held by \p schemaObj .
62  /// Should be preferred over UsdLuxNonboundableLightBase(schemaObj.GetPrim()),
63  /// as it preserves SchemaBase state.
64  explicit UsdLuxNonboundableLightBase(const UsdSchemaBase& schemaObj)
65  : UsdGeomXformable(schemaObj)
66  {
67  }
68 
69  /// Destructor.
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.
77  static const TfTokenVector &
78  GetSchemaAttributeNames(bool includeInherited=true);
79 
80  /// Return a UsdLuxNonboundableLightBase holding the prim adhering to this
81  /// schema at \p path on \p stage. If no prim exists at \p path on
82  /// \p stage, or if the prim at that path does not adhere to this schema,
83  /// return an invalid schema object. This is shorthand for the following:
84  ///
85  /// \code
86  /// UsdLuxNonboundableLightBase(stage->GetPrimAtPath(path));
87  /// \endcode
88  ///
91  Get(const UsdStagePtr &stage, const SdfPath &path);
92 
93 
94 protected:
95  /// Returns the kind of schema this class belongs to.
96  ///
97  /// \sa UsdSchemaKind
99  UsdSchemaKind _GetSchemaKind() const override;
100 
101 private:
102  // needs to invoke _GetStaticTfType.
103  friend class UsdSchemaRegistry;
104  USDLUX_API
105  static const TfType &_GetStaticTfType();
106 
107  static bool _IsTypedSchema();
108 
109  // override SchemaBase virtuals.
110  USDLUX_API
111  const TfType &_GetTfType() const override;
112 
113 public:
114  // ===================================================================== //
115  // Feel free to add custom code below this line, it will be preserved by
116  // the code generator.
117  //
118  // Just remember to:
119  // - Close the class declaration with };
120  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
121  // - Close the include guard with #endif
122  // ===================================================================== //
123  // --(BEGIN CUSTOM CODE)--
124 
125  /// \name LightAPI
126  ///
127  /// Convenience accessors for the light's built-in UsdLuxLightAPI
128  ///
129  /// @{
130 
131  /// Contructs and returns a UsdLuxLightAPI object for this light.
132  USDLUX_API
133  UsdLuxLightAPI LightAPI() const;
134 
135  /// See UsdLuxLightAPI::GetIntensityAttr().
136  USDLUX_API
138 
139  /// See UsdLuxLightAPI::CreateIntensityAttr().
140  USDLUX_API
142  VtValue const &defaultValue = VtValue(),
143  bool writeSparsely=false) const;
144 
145  /// See UsdLuxLightAPI::GetExposureAttr().
146  USDLUX_API
148 
149  /// See UsdLuxLightAPI::CreateExposureAttr().
150  USDLUX_API
152  VtValue const &defaultValue = VtValue(),
153  bool writeSparsely=false) const;
154 
155  /// See UsdLuxLightAPI::GetDiffuseAttr().
156  USDLUX_API
158 
159  /// See UsdLuxLightAPI::CreateDiffuseAttr().
160  USDLUX_API
162  VtValue const &defaultValue = VtValue(),
163  bool writeSparsely=false) const;
164 
165  /// See UsdLuxLightAPI::GetSpecularAttr().
166  USDLUX_API
168 
169  /// See UsdLuxLightAPI::CreateSpecularAttr().
170  USDLUX_API
172  VtValue const &defaultValue = VtValue(),
173  bool writeSparsely=false) const;
174 
175  /// See UsdLuxLightAPI::GetNormalizeAttr().
176  USDLUX_API
178 
179  /// See UsdLuxLightAPI::CreateNormalizeAttr().
180  USDLUX_API
182  VtValue const &defaultValue = VtValue(),
183  bool writeSparsely=false) const;
184 
185  /// See UsdLuxLightAPI::GetColorAttr().
186  USDLUX_API
187  UsdAttribute GetColorAttr() const;
188 
189  /// See UsdLuxLightAPI::CreateColorAttr().
190  USDLUX_API
192  VtValue const &defaultValue = VtValue(),
193  bool writeSparsely=false) const;
194 
195  /// See UsdLuxLightAPI::GetEnableColorTemperatureAttr().
196  USDLUX_API
198 
199  /// See UsdLuxLightAPI::CreateEnableColorTemperatureAttr().
200  USDLUX_API
202  VtValue const &defaultValue = VtValue(),
203  bool writeSparsely=false) const;
204 
205  /// See UsdLuxLightAPI::GetColorTemperatureAttr().
206  USDLUX_API
208 
209  /// See UsdLuxLightAPI::CreateColorTemperatureAttr().
210  USDLUX_API
212  VtValue const &defaultValue = VtValue(),
213  bool writeSparsely=false) const;
214 
215  /// See UsdLuxLightAPI::GetFiltersRel().
216  USDLUX_API
218 
219  /// See UsdLuxLightAPI::CreateFiltersRel().
220  USDLUX_API
222 
223  /// @}
224 };
225 
227 
228 #endif
USDLUX_API UsdAttribute GetExposureAttr() const
See UsdLuxLightAPI::GetExposureAttr().
USDLUX_API UsdRelationship CreateFiltersRel() const
See UsdLuxLightAPI::CreateFiltersRel().
static USDLUX_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdLuxNonboundableLightBase(const UsdPrim &prim=UsdPrim())
#define USDLUX_API
Definition: api.h:23
USDLUX_API UsdAttribute CreateSpecularAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateSpecularAttr().
UsdLuxNonboundableLightBase(const UsdSchemaBase &schemaObj)
USDLUX_API UsdAttribute CreateIntensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateIntensityAttr().
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
static const UsdSchemaKind schemaKind
USDLUX_API UsdAttribute GetIntensityAttr() const
See UsdLuxLightAPI::GetIntensityAttr().
USDLUX_API UsdAttribute GetDiffuseAttr() const
See UsdLuxLightAPI::GetDiffuseAttr().
USDLUX_API UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateColorTemperatureAttr().
Represents a non-concrete typed schema.
USDLUX_API UsdLuxLightAPI LightAPI() const
Contructs and returns a UsdLuxLightAPI object for this light.
USDLUX_API UsdAttribute GetColorTemperatureAttr() const
See UsdLuxLightAPI::GetColorTemperatureAttr().
static USDLUX_API UsdLuxNonboundableLightBase Get(const UsdStagePtr &stage, const SdfPath &path)
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDLUX_API UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr().
virtual USDLUX_API ~UsdLuxNonboundableLightBase()
Destructor.
Definition: path.h:273
USDLUX_API UsdAttribute GetSpecularAttr() const
See UsdLuxLightAPI::GetSpecularAttr().
UsdSchemaKind
Definition: common.h:112
USDLUX_API UsdAttribute CreateColorAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateColorAttr().
USDLUX_API UsdAttribute GetColorAttr() const
See UsdLuxLightAPI::GetColorAttr().
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDLUX_API UsdAttribute GetNormalizeAttr() const
See UsdLuxLightAPI::GetNormalizeAttr().
USDLUX_API UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateNormalizeAttr().
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDLUX_API UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateDiffuseAttr().
Definition: type.h:47
USDLUX_API UsdRelationship GetFiltersRel() const
See UsdLuxLightAPI::GetFiltersRel().
USDLUX_API UsdAttribute GetEnableColorTemperatureAttr() const
See UsdLuxLightAPI::GetEnableColorTemperatureAttr().
Definition: value.h:146
USDLUX_API UsdAttribute CreateExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateExposureAttr().