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 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 USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H
25 #define USDLUX_GENERATED_NONBOUNDABLELIGHTBASE_H
26 
27 /// \file usdLux/nonboundableLightBase.h
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdLux/api.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "pxr/usd/usdLux/lightAPI.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 // NONBOUNDABLELIGHTBASE //
51 // -------------------------------------------------------------------------- //
52 
53 /// \class UsdLuxNonboundableLightBase
54 ///
55 /// Base class for intrinsic lights that are not boundable.
56 ///
57 /// The primary purpose of this class is to provide a direct API to the
58 /// functions provided by LightAPI for concrete derived light types.
59 ///
60 ///
62 {
63 public:
64  /// Compile time constant representing what kind of schema this class is.
65  ///
66  /// \sa UsdSchemaKind
68 
69  /// Construct a UsdLuxNonboundableLightBase on UsdPrim \p prim .
70  /// Equivalent to UsdLuxNonboundableLightBase::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  : UsdGeomXformable(prim)
75  {
76  }
77 
78  /// Construct a UsdLuxNonboundableLightBase on the prim held by \p schemaObj .
79  /// Should be preferred over UsdLuxNonboundableLightBase(schemaObj.GetPrim()),
80  /// as it preserves SchemaBase state.
81  explicit UsdLuxNonboundableLightBase(const UsdSchemaBase& schemaObj)
82  : UsdGeomXformable(schemaObj)
83  {
84  }
85 
86  /// Destructor.
89 
90  /// Return a vector of names of all pre-declared attributes for this schema
91  /// class and all its ancestor classes. Does not include attributes that
92  /// may be authored by custom/extended methods of the schemas involved.
94  static const TfTokenVector &
95  GetSchemaAttributeNames(bool includeInherited=true);
96 
97  /// Return a UsdLuxNonboundableLightBase holding the prim adhering to this
98  /// schema at \p path on \p stage. If no prim exists at \p path on
99  /// \p stage, or if the prim at that path does not adhere to this schema,
100  /// return an invalid schema object. This is shorthand for the following:
101  ///
102  /// \code
103  /// UsdLuxNonboundableLightBase(stage->GetPrimAtPath(path));
104  /// \endcode
105  ///
106  USDLUX_API
108  Get(const UsdStagePtr &stage, const SdfPath &path);
109 
110 
111 protected:
112  /// Returns the kind of schema this class belongs to.
113  ///
114  /// \sa UsdSchemaKind
115  USDLUX_API
116  UsdSchemaKind _GetSchemaKind() const override;
117 
118 private:
119  // needs to invoke _GetStaticTfType.
120  friend class UsdSchemaRegistry;
121  USDLUX_API
122  static const TfType &_GetStaticTfType();
123 
124  static bool _IsTypedSchema();
125 
126  // override SchemaBase virtuals.
127  USDLUX_API
128  const TfType &_GetTfType() const override;
129 
130 public:
131  // ===================================================================== //
132  // Feel free to add custom code below this line, it will be preserved by
133  // the code generator.
134  //
135  // Just remember to:
136  // - Close the class declaration with };
137  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
138  // - Close the include guard with #endif
139  // ===================================================================== //
140  // --(BEGIN CUSTOM CODE)--
141 
142  /// \name LightAPI
143  ///
144  /// Convenience accessors for the light's built-in UsdLuxLightAPI
145  ///
146  /// @{
147 
148  /// Contructs and returns a UsdLuxLightAPI object for this light.
149  USDLUX_API
150  UsdLuxLightAPI LightAPI() const;
151 
152  /// See UsdLuxLightAPI::GetIntensityAttr().
153  USDLUX_API
155 
156  /// See UsdLuxLightAPI::CreateIntensityAttr().
157  USDLUX_API
159  VtValue const &defaultValue = VtValue(),
160  bool writeSparsely=false) const;
161 
162  /// See UsdLuxLightAPI::GetExposureAttr().
163  USDLUX_API
165 
166  /// See UsdLuxLightAPI::CreateExposureAttr().
167  USDLUX_API
169  VtValue const &defaultValue = VtValue(),
170  bool writeSparsely=false) const;
171 
172  /// See UsdLuxLightAPI::GetDiffuseAttr().
173  USDLUX_API
175 
176  /// See UsdLuxLightAPI::CreateDiffuseAttr().
177  USDLUX_API
179  VtValue const &defaultValue = VtValue(),
180  bool writeSparsely=false) const;
181 
182  /// See UsdLuxLightAPI::GetSpecularAttr().
183  USDLUX_API
185 
186  /// See UsdLuxLightAPI::CreateSpecularAttr().
187  USDLUX_API
189  VtValue const &defaultValue = VtValue(),
190  bool writeSparsely=false) const;
191 
192  /// See UsdLuxLightAPI::GetNormalizeAttr().
193  USDLUX_API
195 
196  /// See UsdLuxLightAPI::CreateNormalizeAttr().
197  USDLUX_API
199  VtValue const &defaultValue = VtValue(),
200  bool writeSparsely=false) const;
201 
202  /// See UsdLuxLightAPI::GetColorAttr().
203  USDLUX_API
204  UsdAttribute GetColorAttr() const;
205 
206  /// See UsdLuxLightAPI::CreateColorAttr().
207  USDLUX_API
209  VtValue const &defaultValue = VtValue(),
210  bool writeSparsely=false) const;
211 
212  /// See UsdLuxLightAPI::GetEnableColorTemperatureAttr().
213  USDLUX_API
215 
216  /// See UsdLuxLightAPI::CreateEnableColorTemperatureAttr().
217  USDLUX_API
219  VtValue const &defaultValue = VtValue(),
220  bool writeSparsely=false) const;
221 
222  /// See UsdLuxLightAPI::GetColorTemperatureAttr().
223  USDLUX_API
225 
226  /// See UsdLuxLightAPI::CreateColorTemperatureAttr().
227  USDLUX_API
229  VtValue const &defaultValue = VtValue(),
230  bool writeSparsely=false) const;
231 
232  /// See UsdLuxLightAPI::GetFiltersRel().
233  USDLUX_API
235 
236  /// See UsdLuxLightAPI::CreateFiltersRel().
237  USDLUX_API
239 
240  /// @}
241 };
242 
244 
245 #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:40
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:133
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
USDLUX_API UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateEnableColorTemperatureAttr().
virtual USDLUX_API ~UsdLuxNonboundableLightBase()
Destructor.
Definition: path.h:290
USDLUX_API UsdAttribute GetSpecularAttr() const
See UsdLuxLightAPI::GetSpecularAttr().
UsdSchemaKind
Definition: common.h:129
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:1432
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:91
USDLUX_API UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateDiffuseAttr().
Definition: type.h:64
USDLUX_API UsdRelationship GetFiltersRel() const
See UsdLuxLightAPI::GetFiltersRel().
USDLUX_API UsdAttribute GetEnableColorTemperatureAttr() const
See UsdLuxLightAPI::GetEnableColorTemperatureAttr().
Definition: value.h:164
USDLUX_API UsdAttribute CreateExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See UsdLuxLightAPI::CreateExposureAttr().