HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geometryLight.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_GEOMETRYLIGHT_H
8 #define USDLUX_GENERATED_GEOMETRYLIGHT_H
9 
10 /// \file usdLux/geometryLight.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 // GEOMETRYLIGHT //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdLuxGeometryLight
37 ///
38 /// \deprecated
39 /// Light emitted outward from a geometric prim (UsdGeomGprim),
40 /// which is typically a mesh.
41 ///
43 {
44 public:
45  /// Compile time constant representing what kind of schema this class is.
46  ///
47  /// \sa UsdSchemaKind
49 
50  /// Construct a UsdLuxGeometryLight on UsdPrim \p prim .
51  /// Equivalent to UsdLuxGeometryLight::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 UsdLuxGeometryLight(const UsdPrim& prim=UsdPrim())
56  {
57  }
58 
59  /// Construct a UsdLuxGeometryLight on the prim held by \p schemaObj .
60  /// Should be preferred over UsdLuxGeometryLight(schemaObj.GetPrim()),
61  /// as it preserves SchemaBase state.
62  explicit UsdLuxGeometryLight(const UsdSchemaBase& schemaObj)
63  : UsdLuxNonboundableLightBase(schemaObj)
64  {
65  }
66 
67  /// Destructor.
69  virtual ~UsdLuxGeometryLight();
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 UsdLuxGeometryLight 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  /// UsdLuxGeometryLight(stage->GetPrimAtPath(path));
85  /// \endcode
86  ///
88  static UsdLuxGeometryLight
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 UsdLuxGeometryLight
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  // GEOMETRY
139  // --------------------------------------------------------------------- //
140  /// Relationship to the geometry to use as the light source.
141  ///
142  USDLUX_API
144 
145  /// See GetGeometryRel(), and also
146  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
147  USDLUX_API
149 
150 public:
151  // ===================================================================== //
152  // Feel free to add custom code below this line, it will be preserved by
153  // the code generator.
154  //
155  // Just remember to:
156  // - Close the class declaration with };
157  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
158  // - Close the include guard with #endif
159  // ===================================================================== //
160  // --(BEGIN CUSTOM CODE)--
161 };
162 
164 
165 #endif
static USDLUX_API UsdLuxGeometryLight Get(const UsdStagePtr &stage, const SdfPath &path)
virtual USDLUX_API ~UsdLuxGeometryLight()
Destructor.
USDLUX_API UsdSchemaKind _GetSchemaKind() const override
USDLUX_API UsdRelationship GetGeometryRel() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
static const UsdSchemaKind schemaKind
Definition: geometryLight.h:48
#define USDLUX_API
Definition: api.h:23
Represents a concrete typed schema.
UsdLuxGeometryLight(const UsdSchemaBase &schemaObj)
Definition: geometryLight.h:62
UsdLuxGeometryLight(const UsdPrim &prim=UsdPrim())
Definition: geometryLight.h:54
Definition: prim.h:116
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
UsdSchemaKind
Definition: common.h:112
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static USDLUX_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDLUX_API UsdRelationship CreateGeometryRel() const
static USDLUX_API UsdLuxGeometryLight Define(const UsdStagePtr &stage, const SdfPath &path)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47