HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sphereLight.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_SPHERELIGHT_H
8 #define USDLUX_GENERATED_SPHERELIGHT_H
9 
10 /// \file usdLux/sphereLight.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/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 // SPHERELIGHT //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdLuxSphereLight
37 ///
38 /// Light emitted outward from a sphere.
39 ///
41 {
42 public:
43  /// Compile time constant representing what kind of schema this class is.
44  ///
45  /// \sa UsdSchemaKind
47 
48  /// Construct a UsdLuxSphereLight on UsdPrim \p prim .
49  /// Equivalent to UsdLuxSphereLight::Get(prim.GetStage(), prim.GetPath())
50  /// for a \em valid \p prim, but will not immediately throw an error for
51  /// an invalid \p prim
52  explicit UsdLuxSphereLight(const UsdPrim& prim=UsdPrim())
54  {
55  }
56 
57  /// Construct a UsdLuxSphereLight on the prim held by \p schemaObj .
58  /// Should be preferred over UsdLuxSphereLight(schemaObj.GetPrim()),
59  /// as it preserves SchemaBase state.
60  explicit UsdLuxSphereLight(const UsdSchemaBase& schemaObj)
61  : UsdLuxBoundableLightBase(schemaObj)
62  {
63  }
64 
65  /// Destructor.
67  virtual ~UsdLuxSphereLight();
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.
73  static const TfTokenVector &
74  GetSchemaAttributeNames(bool includeInherited=true);
75 
76  /// Return a UsdLuxSphereLight holding the prim adhering to this
77  /// schema at \p path on \p stage. If no prim exists at \p path on
78  /// \p stage, or if the prim at that path does not adhere to this schema,
79  /// return an invalid schema object. This is shorthand for the following:
80  ///
81  /// \code
82  /// UsdLuxSphereLight(stage->GetPrimAtPath(path));
83  /// \endcode
84  ///
86  static UsdLuxSphereLight
87  Get(const UsdStagePtr &stage, const SdfPath &path);
88 
89  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
90  /// is defined (according to UsdPrim::IsDefined()) on this stage.
91  ///
92  /// If a prim adhering to this schema at \p path is already defined on this
93  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
94  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
95  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
96  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
97  /// current EditTarget for any nonexistent, or existing but not \a Defined
98  /// ancestors.
99  ///
100  /// The given \a path must be an absolute prim path that does not contain
101  /// any variant selections.
102  ///
103  /// If it is impossible to author any of the necessary PrimSpecs, (for
104  /// example, in case \a path cannot map to the current UsdEditTarget's
105  /// namespace) issue an error and return an invalid \a UsdPrim.
106  ///
107  /// Note that this method may return a defined prim whose typeName does not
108  /// specify this schema class, in case a stronger typeName opinion overrides
109  /// the opinion at the current EditTarget.
110  ///
111  USDLUX_API
112  static UsdLuxSphereLight
113  Define(const UsdStagePtr &stage, const SdfPath &path);
114 
115 protected:
116  /// Returns the kind of schema this class belongs to.
117  ///
118  /// \sa UsdSchemaKind
119  USDLUX_API
120  UsdSchemaKind _GetSchemaKind() const override;
121 
122 private:
123  // needs to invoke _GetStaticTfType.
124  friend class UsdSchemaRegistry;
125  USDLUX_API
126  static const TfType &_GetStaticTfType();
127 
128  static bool _IsTypedSchema();
129 
130  // override SchemaBase virtuals.
131  USDLUX_API
132  const TfType &_GetTfType() const override;
133 
134 public:
135  // --------------------------------------------------------------------- //
136  // RADIUS
137  // --------------------------------------------------------------------- //
138  /// Radius of the sphere.
139  ///
140  /// | ||
141  /// | -- | -- |
142  /// | Declaration | `float inputs:radius = 0.5` |
143  /// | C++ Type | float |
144  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
145  USDLUX_API
146  UsdAttribute GetRadiusAttr() const;
147 
148  /// See GetRadiusAttr(), and also
149  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
150  /// If specified, author \p defaultValue as the attribute's default,
151  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
152  /// the default for \p writeSparsely is \c false.
153  USDLUX_API
154  UsdAttribute CreateRadiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
155 
156 public:
157  // --------------------------------------------------------------------- //
158  // TREATASPOINT
159  // --------------------------------------------------------------------- //
160  /// A hint that this light can be treated as a 'point'
161  /// light (effectively, a zero-radius sphere) by renderers that
162  /// benefit from non-area lighting. Renderers that only support
163  /// area lights can disregard this.
164  ///
165  /// | ||
166  /// | -- | -- |
167  /// | Declaration | `bool treatAsPoint = 0` |
168  /// | C++ Type | bool |
169  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
170  USDLUX_API
172 
173  /// See GetTreatAsPointAttr(), and also
174  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
175  /// If specified, author \p defaultValue as the attribute's default,
176  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
177  /// the default for \p writeSparsely is \c false.
178  USDLUX_API
179  UsdAttribute CreateTreatAsPointAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
180 
181 public:
182  // ===================================================================== //
183  // Feel free to add custom code below this line, it will be preserved by
184  // the code generator.
185  //
186  // Just remember to:
187  // - Close the class declaration with };
188  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
189  // - Close the include guard with #endif
190  // ===================================================================== //
191  // --(BEGIN CUSTOM CODE)--
192 };
193 
195 
196 #endif
static const UsdSchemaKind schemaKind
Definition: sphereLight.h:46
UsdLuxSphereLight(const UsdSchemaBase &schemaObj)
Definition: sphereLight.h:60
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define USDLUX_API
Definition: api.h:23
UsdLuxSphereLight(const UsdPrim &prim=UsdPrim())
Definition: sphereLight.h:52
virtual USDLUX_API ~UsdLuxSphereLight()
Destructor.
Represents a concrete typed schema.
USDLUX_API UsdAttribute GetTreatAsPointAttr() const
static USDLUX_API UsdLuxSphereLight Get(const UsdStagePtr &stage, const SdfPath &path)
USDLUX_API UsdAttribute CreateRadiusAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
static USDLUX_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
Definition: path.h:273
UsdSchemaKind
Definition: common.h:112
USDLUX_API UsdAttribute GetRadiusAttr() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDLUX_API UsdAttribute CreateTreatAsPointAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: type.h:47
static USDLUX_API UsdLuxSphereLight Define(const UsdStagePtr &stage, const SdfPath &path)
Definition: value.h:146