HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rectLight.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_RECTLIGHT_H
8 #define USDLUX_GENERATED_RECTLIGHT_H
9 
10 /// \file usdLux/rectLight.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 // RECTLIGHT //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdLuxRectLight
37 ///
38 /// Light emitted from one side of a rectangle.
39 /// The rectangle is centered in the XY plane and emits light along the -Z axis.
40 /// The rectangle is 1 unit in length in the X and Y axis. In the default
41 /// position, a texture file's min coordinates should be at (+X, +Y) and
42 /// max coordinates at (-X, -Y).
43 ///
45 {
46 public:
47  /// Compile time constant representing what kind of schema this class is.
48  ///
49  /// \sa UsdSchemaKind
51 
52  /// Construct a UsdLuxRectLight on UsdPrim \p prim .
53  /// Equivalent to UsdLuxRectLight::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
56  explicit UsdLuxRectLight(const UsdPrim& prim=UsdPrim())
58  {
59  }
60 
61  /// Construct a UsdLuxRectLight on the prim held by \p schemaObj .
62  /// Should be preferred over UsdLuxRectLight(schemaObj.GetPrim()),
63  /// as it preserves SchemaBase state.
64  explicit UsdLuxRectLight(const UsdSchemaBase& schemaObj)
65  : UsdLuxBoundableLightBase(schemaObj)
66  {
67  }
68 
69  /// Destructor.
71  virtual ~UsdLuxRectLight();
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 UsdLuxRectLight 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  /// UsdLuxRectLight(stage->GetPrimAtPath(path));
87  /// \endcode
88  ///
90  static UsdLuxRectLight
91  Get(const UsdStagePtr &stage, const SdfPath &path);
92 
93  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
94  /// is defined (according to UsdPrim::IsDefined()) on this stage.
95  ///
96  /// If a prim adhering to this schema at \p path is already defined on this
97  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
98  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
99  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
100  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
101  /// current EditTarget for any nonexistent, or existing but not \a Defined
102  /// ancestors.
103  ///
104  /// The given \a path must be an absolute prim path that does not contain
105  /// any variant selections.
106  ///
107  /// If it is impossible to author any of the necessary PrimSpecs, (for
108  /// example, in case \a path cannot map to the current UsdEditTarget's
109  /// namespace) issue an error and return an invalid \a UsdPrim.
110  ///
111  /// Note that this method may return a defined prim whose typeName does not
112  /// specify this schema class, in case a stronger typeName opinion overrides
113  /// the opinion at the current EditTarget.
114  ///
115  USDLUX_API
116  static UsdLuxRectLight
117  Define(const UsdStagePtr &stage, const SdfPath &path);
118 
119 protected:
120  /// Returns the kind of schema this class belongs to.
121  ///
122  /// \sa UsdSchemaKind
123  USDLUX_API
124  UsdSchemaKind _GetSchemaKind() const override;
125 
126 private:
127  // needs to invoke _GetStaticTfType.
128  friend class UsdSchemaRegistry;
129  USDLUX_API
130  static const TfType &_GetStaticTfType();
131 
132  static bool _IsTypedSchema();
133 
134  // override SchemaBase virtuals.
135  USDLUX_API
136  const TfType &_GetTfType() const override;
137 
138 public:
139  // --------------------------------------------------------------------- //
140  // WIDTH
141  // --------------------------------------------------------------------- //
142  /// Width of the rectangle, in the local X axis.
143  ///
144  /// | ||
145  /// | -- | -- |
146  /// | Declaration | `float inputs:width = 1` |
147  /// | C++ Type | float |
148  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
149  USDLUX_API
150  UsdAttribute GetWidthAttr() const;
151 
152  /// See GetWidthAttr(), and also
153  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
154  /// If specified, author \p defaultValue as the attribute's default,
155  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
156  /// the default for \p writeSparsely is \c false.
157  USDLUX_API
158  UsdAttribute CreateWidthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
159 
160 public:
161  // --------------------------------------------------------------------- //
162  // HEIGHT
163  // --------------------------------------------------------------------- //
164  /// Height of the rectangle, in the local Y axis.
165  ///
166  /// | ||
167  /// | -- | -- |
168  /// | Declaration | `float inputs:height = 1` |
169  /// | C++ Type | float |
170  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
171  USDLUX_API
172  UsdAttribute GetHeightAttr() const;
173 
174  /// See GetHeightAttr(), and also
175  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
176  /// If specified, author \p defaultValue as the attribute's default,
177  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
178  /// the default for \p writeSparsely is \c false.
179  USDLUX_API
180  UsdAttribute CreateHeightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
181 
182 public:
183  // --------------------------------------------------------------------- //
184  // TEXTUREFILE
185  // --------------------------------------------------------------------- //
186  /// A color texture to use on the rectangle.
187  ///
188  /// | ||
189  /// | -- | -- |
190  /// | Declaration | `asset inputs:texture:file` |
191  /// | C++ Type | SdfAssetPath |
192  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Asset |
193  USDLUX_API
195 
196  /// See GetTextureFileAttr(), and also
197  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
198  /// If specified, author \p defaultValue as the attribute's default,
199  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
200  /// the default for \p writeSparsely is \c false.
201  USDLUX_API
202  UsdAttribute CreateTextureFileAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
203 
204 public:
205  // ===================================================================== //
206  // Feel free to add custom code below this line, it will be preserved by
207  // the code generator.
208  //
209  // Just remember to:
210  // - Close the class declaration with };
211  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
212  // - Close the include guard with #endif
213  // ===================================================================== //
214  // --(BEGIN CUSTOM CODE)--
215 };
216 
218 
219 #endif
USDLUX_API UsdAttribute CreateHeightAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static USDLUX_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
virtual USDLUX_API ~UsdLuxRectLight()
Destructor.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define USDLUX_API
Definition: api.h:23
USDLUX_API UsdAttribute GetTextureFileAttr() const
Represents a concrete typed schema.
USDLUX_API UsdAttribute GetWidthAttr() const
USDLUX_API UsdAttribute CreateWidthAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
UsdLuxRectLight(const UsdSchemaBase &schemaObj)
Definition: rectLight.h:64
static const UsdSchemaKind schemaKind
Definition: rectLight.h:50
Definition: path.h:273
UsdSchemaKind
Definition: common.h:112
USDLUX_API UsdAttribute GetHeightAttr() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
USDLUX_API UsdAttribute CreateTextureFileAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
static USDLUX_API UsdLuxRectLight Define(const UsdStagePtr &stage, const SdfPath &path)
Definition: value.h:146
UsdLuxRectLight(const UsdPrim &prim=UsdPrim())
Definition: rectLight.h:56
static USDLUX_API UsdLuxRectLight Get(const UsdStagePtr &stage, const SdfPath &path)