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