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