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