All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
light.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_LIGHT_H
25 #define USDLUX_GENERATED_LIGHT_H
26 
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/tokens.h"
35 
37 #include "pxr/usd/usdShade/input.h"
38 #include "pxr/usd/usdShade/output.h"
39 
40 #include "pxr/base/vt/value.h"
41 
42 #include "pxr/base/gf/vec3d.h"
43 #include "pxr/base/gf/vec3f.h"
44 #include "pxr/base/gf/matrix4d.h"
45 
46 #include "pxr/base/tf/token.h"
47 #include "pxr/base/tf/type.h"
48 
49 PXR_NAMESPACE_OPEN_SCOPE
50 
51 class SdfAssetPath;
52 
53 // -------------------------------------------------------------------------- //
54 // LIGHT //
55 // -------------------------------------------------------------------------- //
56 
80 {
81 public:
86 
91  explicit UsdLuxLight(const UsdPrim& prim=UsdPrim())
92  : UsdGeomXformable(prim)
93  {
94  }
95 
99  explicit UsdLuxLight(const UsdSchemaBase& schemaObj)
100  : UsdGeomXformable(schemaObj)
101  {
102  }
103 
105  USDLUX_API
106  virtual ~UsdLuxLight();
107 
111  USDLUX_API
112  static const TfTokenVector &
113  GetSchemaAttributeNames(bool includeInherited=true);
114 
124  USDLUX_API
125  static UsdLuxLight
126  Get(const UsdStagePtr &stage, const SdfPath &path);
127 
128 
129 protected:
133  USDLUX_API
134  UsdSchemaKind _GetSchemaKind() const override;
135 
136 private:
137  // needs to invoke _GetStaticTfType.
138  friend class UsdSchemaRegistry;
139  USDLUX_API
140  static const TfType &_GetStaticTfType();
141 
142  static bool _IsTypedSchema();
143 
144  // override SchemaBase virtuals.
145  USDLUX_API
146  const TfType &_GetTfType() const override;
147 
148 public:
149  // --------------------------------------------------------------------- //
150  // INTENSITY
151  // --------------------------------------------------------------------- //
159  USDLUX_API
161 
167  USDLUX_API
168  UsdAttribute CreateIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
169 
170 public:
171  // --------------------------------------------------------------------- //
172  // EXPOSURE
173  // --------------------------------------------------------------------- //
183  USDLUX_API
185 
191  USDLUX_API
192  UsdAttribute CreateExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
193 
194 public:
195  // --------------------------------------------------------------------- //
196  // DIFFUSE
197  // --------------------------------------------------------------------- //
206  USDLUX_API
208 
214  USDLUX_API
215  UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
216 
217 public:
218  // --------------------------------------------------------------------- //
219  // SPECULAR
220  // --------------------------------------------------------------------- //
229  USDLUX_API
231 
237  USDLUX_API
238  UsdAttribute CreateSpecularAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
239 
240 public:
241  // --------------------------------------------------------------------- //
242  // NORMALIZE
243  // --------------------------------------------------------------------- //
254  USDLUX_API
256 
262  USDLUX_API
263  UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
264 
265 public:
266  // --------------------------------------------------------------------- //
267  // COLOR
268  // --------------------------------------------------------------------- //
276  USDLUX_API
277  UsdAttribute GetColorAttr() const;
278 
284  USDLUX_API
285  UsdAttribute CreateColorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
286 
287 public:
288  // --------------------------------------------------------------------- //
289  // ENABLECOLORTEMPERATURE
290  // --------------------------------------------------------------------- //
298  USDLUX_API
300 
306  USDLUX_API
307  UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
308 
309 public:
310  // --------------------------------------------------------------------- //
311  // COLORTEMPERATURE
312  // --------------------------------------------------------------------- //
326  USDLUX_API
328 
334  USDLUX_API
335  UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
336 
337 public:
338  // --------------------------------------------------------------------- //
339  // FILTERS
340  // --------------------------------------------------------------------- //
343  USDLUX_API
345 
348  USDLUX_API
350 
351 public:
352  // ===================================================================== //
353  // Feel free to add custom code below this line, it will be preserved by
354  // the code generator.
355  //
356  // Just remember to:
357  // - Close the class declaration with };
358  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
359  // - Close the include guard with #endif
360  // ===================================================================== //
361  // --(BEGIN CUSTOM CODE)--
362 
363  // -------------------------------------------------------------------------
367 
370  USDLUX_API
371  UsdLuxLight(const UsdShadeConnectableAPI &connectable);
372 
381  USDLUX_API
383 
385 
386  // -------------------------------------------------------------------------
393 
399  USDLUX_API
400  UsdShadeOutput CreateOutput(const TfToken& name,
401  const SdfValueTypeName& typeName);
402 
405  USDLUX_API
406  UsdShadeOutput GetOutput(const TfToken &name) const;
407 
412  USDLUX_API
413  std::vector<UsdShadeOutput> GetOutputs(bool onlyAuthored=true) const;
414 
416 
417  // -------------------------------------------------------------------------
418 
426 
431  USDLUX_API
432  UsdShadeInput CreateInput(const TfToken& name,
433  const SdfValueTypeName& typeName);
434 
437  USDLUX_API
438  UsdShadeInput GetInput(const TfToken &name) const;
439 
444  USDLUX_API
445  std::vector<UsdShadeInput> GetInputs(bool onlyAuthored=true) const;
446 
448 
465  USDLUX_API
467 
471  USDLUX_API
473 
477  USDLUX_API
479 };
480 
481 PXR_NAMESPACE_CLOSE_SCOPE
482 
483 #endif
USDLUX_API UsdAttribute GetEnableColorTemperatureAttr() const
Enables using colorTemperature.
USDLUX_API UsdAttribute CreateExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetExposureAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdAttribute CreateIntensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetIntensityAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdCollectionAPI GetLightLinkCollectionAPI() const
Return the UsdCollectionAPI interface used for examining and modifying the light-linking of this ligh...
USDLUX_API UsdAttribute CreateSpecularAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSpecularAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdRelationship CreateFiltersRel() const
See GetFiltersRel(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdShadeConnectableAPI ConnectableAPI() const
Contructs and returns a UsdShadeConnectableAPI object with this light.
Basic type for a vector of 3 float components.
Definition: vec3f.h:63
USDLUX_API UsdRelationship GetFiltersRel() const
Relationship to the light filters that apply to this light.
Represents a value type name, i.e.
Definition: valueTypeName.h:87
static USDLUX_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDLUX_API UsdAttribute GetIntensityAttr() const
Scales the power of the light linearly.
UsdLuxLight(const UsdSchemaBase &schemaObj)
Construct a UsdLuxLight on the prim held by schemaObj .
Definition: light.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
USDLUX_API UsdAttribute CreateDiffuseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetDiffuseAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdAttribute CreateColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetColorTemperatureAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
virtual USDLUX_API ~UsdLuxLight()
Destructor.
This class encapsulates a shader or node-graph input, which is a connectable attribute representing a...
Definition: input.h:48
UsdLuxLight(const UsdPrim &prim=UsdPrim())
Construct a UsdLuxLight on UsdPrim prim .
Definition: light.h:91
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:127
USDLUX_API UsdAttribute GetColorTemperatureAttr() const
Color temperature, in degrees Kelvin, representing the white point.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
USDLUX_API UsdAttribute GetDiffuseAttr() const
A multiplier for the effect of this light on the diffuse response of materials.
USDLUX_API UsdAttribute CreateColorAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetColorAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdAttribute GetExposureAttr() const
Scales the power of the light exponentially as a power of 2 (similar to an F-stop control over exposu...
USDLUX_API GfVec3f ComputeBaseEmission() const
Computes the base emission (aka radiant flux density, aka energy per unit area), incorporating the pa...
USDLUX_API UsdAttribute GetNormalizeAttr() const
Normalizes power by the surface area of the light.
This is a general purpose API schema, used to describe a collection of heterogeneous objects within t...
USDLUX_API UsdShadeInput CreateInput(const TfToken &name, const SdfValueTypeName &typeName)
Create an input which can either have a value or can be connected.
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and mak...
USDLUX_API std::vector< UsdShadeInput > GetInputs(bool onlyAuthored=true) const
Inputs are represented by attributes in the &quot;inputs:&quot; namespace.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:132
USDLUX_API UsdAttribute CreateNormalizeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetNormalizeAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDLUX_API UsdShadeInput GetInput(const TfToken &name) const
Return the requested input if it exists.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
USDLUX_API UsdAttribute GetColorAttr() const
The color of emitted light, in energy-linear terms.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
USDLUX_API std::vector< UsdShadeOutput > GetOutputs(bool onlyAuthored=true) const
Outputs are represented by attributes in the &quot;outputs:&quot; namespace.
USDLUX_API UsdCollectionAPI GetShadowLinkCollectionAPI() const
Return the UsdCollectionAPI interface used for examining and modifying the shadow-linking of this lig...
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128
USDLUX_API UsdShadeOutput CreateOutput(const TfToken &name, const SdfValueTypeName &typeName)
Create an output which can either have a value or can be connected.
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
Base class for all lights.
Definition: light.h:79
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: light.h:85
Represents a non-concrete typed schema.
TfType represents a dynamic runtime type.
Definition: type.h:64
Singleton registry that provides access to schema type information and the prim definitions for regis...
static USDLUX_API UsdLuxLight Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdLuxLight holding the prim adhering to this schema at path on stage.
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
Definition: output.h:47
USDLUX_API UsdAttribute GetSpecularAttr() const
A multiplier for the effect of this light on the specular response of materials.
The base class for all schema types in Usd.
Definition: schemaBase.h:56
USDLUX_API UsdAttribute CreateEnableColorTemperatureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetEnableColorTemperatureAttr(), and also Create vs Get Property Methods for when to use Get vs C...
Base class for all transformable prims, which allows arbitrary sequences of component affine transfor...
Definition: xformable.h:252
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:168
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
USDLUX_API UsdShadeOutput GetOutput(const TfToken &name) const
Return the requested output if it exists.