HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pxrRampLightFilter.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USDRI_GENERATED_PXRRAMPLIGHTFILTER_H
25 #define USDRI_GENERATED_PXRRAMPLIGHTFILTER_H
26 
27 /// \file usdRi/pxrRampLightFilter.h
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdRi/api.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "pxr/usd/usdRi/tokens.h"
35 
37 
38 
39 #include "pxr/base/vt/value.h"
40 
41 #include "pxr/base/gf/vec3d.h"
42 #include "pxr/base/gf/vec3f.h"
43 #include "pxr/base/gf/matrix4d.h"
44 
45 #include "pxr/base/tf/token.h"
46 #include "pxr/base/tf/type.h"
47 
49 
50 class SdfAssetPath;
51 
52 // -------------------------------------------------------------------------- //
53 // PXRRAMPLIGHTFILTER //
54 // -------------------------------------------------------------------------- //
55 
56 /// \class UsdRiPxrRampLightFilter
57 ///
58 ///
59 /// \deprecated This schema will be replaced in a future release.
60 /// A ramp to modulate how a light falls off with distance.
61 ///
62 ///
63 /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
64 /// that are text/tokens, the actual token is published and defined in \ref UsdRiTokens.
65 /// So to set an attribute to the value "rightHanded", use UsdRiTokens->rightHanded
66 /// as the value.
67 ///
69 {
70 public:
71  /// Compile time constant representing what kind of schema this class is.
72  ///
73  /// \sa UsdSchemaKind
75 
76  /// Construct a UsdRiPxrRampLightFilter on UsdPrim \p prim .
77  /// Equivalent to UsdRiPxrRampLightFilter::Get(prim.GetStage(), prim.GetPath())
78  /// for a \em valid \p prim, but will not immediately throw an error for
79  /// an invalid \p prim
80  explicit UsdRiPxrRampLightFilter(const UsdPrim& prim=UsdPrim())
81  : UsdLuxLightFilter(prim)
82  {
83  }
84 
85  /// Construct a UsdRiPxrRampLightFilter on the prim held by \p schemaObj .
86  /// Should be preferred over UsdRiPxrRampLightFilter(schemaObj.GetPrim()),
87  /// as it preserves SchemaBase state.
88  explicit UsdRiPxrRampLightFilter(const UsdSchemaBase& schemaObj)
89  : UsdLuxLightFilter(schemaObj)
90  {
91  }
92 
93  /// Destructor.
94  USDRI_API
95  virtual ~UsdRiPxrRampLightFilter();
96 
97  /// Return a vector of names of all pre-declared attributes for this schema
98  /// class and all its ancestor classes. Does not include attributes that
99  /// may be authored by custom/extended methods of the schemas involved.
100  USDRI_API
101  static const TfTokenVector &
102  GetSchemaAttributeNames(bool includeInherited=true);
103 
104  /// Return a UsdRiPxrRampLightFilter holding the prim adhering to this
105  /// schema at \p path on \p stage. If no prim exists at \p path on
106  /// \p stage, or if the prim at that path does not adhere to this schema,
107  /// return an invalid schema object. This is shorthand for the following:
108  ///
109  /// \code
110  /// UsdRiPxrRampLightFilter(stage->GetPrimAtPath(path));
111  /// \endcode
112  ///
113  USDRI_API
115  Get(const UsdStagePtr &stage, const SdfPath &path);
116 
117  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
118  /// is defined (according to UsdPrim::IsDefined()) on this stage.
119  ///
120  /// If a prim adhering to this schema at \p path is already defined on this
121  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
122  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
123  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
124  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
125  /// current EditTarget for any nonexistent, or existing but not \a Defined
126  /// ancestors.
127  ///
128  /// The given \a path must be an absolute prim path that does not contain
129  /// any variant selections.
130  ///
131  /// If it is impossible to author any of the necessary PrimSpecs, (for
132  /// example, in case \a path cannot map to the current UsdEditTarget's
133  /// namespace) issue an error and return an invalid \a UsdPrim.
134  ///
135  /// Note that this method may return a defined prim whose typeName does not
136  /// specify this schema class, in case a stronger typeName opinion overrides
137  /// the opinion at the current EditTarget.
138  ///
139  USDRI_API
141  Define(const UsdStagePtr &stage, const SdfPath &path);
142 
143 protected:
144  /// Returns the kind of schema this class belongs to.
145  ///
146  /// \sa UsdSchemaKind
147  USDRI_API
148  UsdSchemaKind _GetSchemaKind() const override;
149 
150 private:
151  // needs to invoke _GetStaticTfType.
152  friend class UsdSchemaRegistry;
153  USDRI_API
154  static const TfType &_GetStaticTfType();
155 
156  static bool _IsTypedSchema();
157 
158  // override SchemaBase virtuals.
159  USDRI_API
160  const TfType &_GetTfType() const override;
161 
162 public:
163  // --------------------------------------------------------------------- //
164  // RAMPMODE
165  // --------------------------------------------------------------------- //
166  /// Specifies the direction in which the ramp is applied
167  ///
168  /// | ||
169  /// | -- | -- |
170  /// | Declaration | `token rampMode = "distanceToLight"` |
171  /// | C++ Type | TfToken |
172  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
173  /// | \ref UsdRiTokens "Allowed Values" | distanceToLight, linear, spherical, radial |
174  USDRI_API
176 
177  /// See GetRampModeAttr(), and also
178  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
179  /// If specified, author \p defaultValue as the attribute's default,
180  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
181  /// the default for \p writeSparsely is \c false.
182  USDRI_API
183  UsdAttribute CreateRampModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
184 
185 public:
186  // --------------------------------------------------------------------- //
187  // BEGINDISTANCE
188  // --------------------------------------------------------------------- //
189  /// Distance where the ramp starts.
190  ///
191  /// | ||
192  /// | -- | -- |
193  /// | Declaration | `float beginDistance = 0` |
194  /// | C++ Type | float |
195  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
196  USDRI_API
198 
199  /// See GetBeginDistanceAttr(), and also
200  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
201  /// If specified, author \p defaultValue as the attribute's default,
202  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
203  /// the default for \p writeSparsely is \c false.
204  USDRI_API
205  UsdAttribute CreateBeginDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
206 
207 public:
208  // --------------------------------------------------------------------- //
209  // ENDDISTANCE
210  // --------------------------------------------------------------------- //
211  /// Distance where the ramp ends.
212  ///
213  /// | ||
214  /// | -- | -- |
215  /// | Declaration | `float endDistance = 10` |
216  /// | C++ Type | float |
217  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
218  USDRI_API
220 
221  /// See GetEndDistanceAttr(), and also
222  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
223  /// If specified, author \p defaultValue as the attribute's default,
224  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
225  /// the default for \p writeSparsely is \c false.
226  USDRI_API
227  UsdAttribute CreateEndDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
228 
229 public:
230  // --------------------------------------------------------------------- //
231  // FALLOFF
232  // --------------------------------------------------------------------- //
233  /// Controls the transition from the core to the edge.
234  ///
235  /// | ||
236  /// | -- | -- |
237  /// | Declaration | `int falloff = 4` |
238  /// | C++ Type | int |
239  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
240  USDRI_API
242 
243  /// See GetFalloffAttr(), and also
244  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
245  /// If specified, author \p defaultValue as the attribute's default,
246  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
247  /// the default for \p writeSparsely is \c false.
248  USDRI_API
249  UsdAttribute CreateFalloffAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
250 
251 public:
252  // --------------------------------------------------------------------- //
253  // FALLOFFKNOTS
254  // --------------------------------------------------------------------- //
255  /// Knots of the falloff spline.
256  ///
257  /// | ||
258  /// | -- | -- |
259  /// | Declaration | `float[] falloff:knots = [0, 0, 1, 1]` |
260  /// | C++ Type | VtArray<float> |
261  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->FloatArray |
262  USDRI_API
264 
265  /// See GetFalloffKnotsAttr(), and also
266  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
267  /// If specified, author \p defaultValue as the attribute's default,
268  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
269  /// the default for \p writeSparsely is \c false.
270  USDRI_API
271  UsdAttribute CreateFalloffKnotsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
272 
273 public:
274  // --------------------------------------------------------------------- //
275  // FALLOFFFLOATS
276  // --------------------------------------------------------------------- //
277  /// Float values of the falloff spline.
278  ///
279  /// | ||
280  /// | -- | -- |
281  /// | Declaration | `float[] falloff:floats = [0, 0, 1, 1]` |
282  /// | C++ Type | VtArray<float> |
283  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->FloatArray |
284  USDRI_API
286 
287  /// See GetFalloffFloatsAttr(), and also
288  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
289  /// If specified, author \p defaultValue as the attribute's default,
290  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
291  /// the default for \p writeSparsely is \c false.
292  USDRI_API
293  UsdAttribute CreateFalloffFloatsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
294 
295 public:
296  // --------------------------------------------------------------------- //
297  // FALLOFFINTERPOLATION
298  // --------------------------------------------------------------------- //
299  /// Falloff spline type.
300  ///
301  /// | ||
302  /// | -- | -- |
303  /// | Declaration | `token falloff:interpolation = "linear"` |
304  /// | C++ Type | TfToken |
305  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
306  /// | \ref UsdRiTokens "Allowed Values" | linear, catmull-rom, bspline, constant |
307  USDRI_API
309 
310  /// See GetFalloffInterpolationAttr(), and also
311  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
312  /// If specified, author \p defaultValue as the attribute's default,
313  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
314  /// the default for \p writeSparsely is \c false.
315  USDRI_API
316  UsdAttribute CreateFalloffInterpolationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
317 
318 public:
319  // --------------------------------------------------------------------- //
320  // COLORRAMP
321  // --------------------------------------------------------------------- //
322  /// Controls the color gradient for the transition.
323  ///
324  /// | ||
325  /// | -- | -- |
326  /// | Declaration | `int colorRamp = 4` |
327  /// | C++ Type | int |
328  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
329  USDRI_API
331 
332  /// See GetColorRampAttr(), and also
333  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
334  /// If specified, author \p defaultValue as the attribute's default,
335  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
336  /// the default for \p writeSparsely is \c false.
337  USDRI_API
338  UsdAttribute CreateColorRampAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
339 
340 public:
341  // --------------------------------------------------------------------- //
342  // COLORRAMPKNOTS
343  // --------------------------------------------------------------------- //
344  /// Knots of the colorRamp spline.
345  ///
346  /// | ||
347  /// | -- | -- |
348  /// | Declaration | `float[] colorRamp:knots = [0, 0, 1, 1]` |
349  /// | C++ Type | VtArray<float> |
350  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->FloatArray |
351  USDRI_API
353 
354  /// See GetColorRampKnotsAttr(), and also
355  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
356  /// If specified, author \p defaultValue as the attribute's default,
357  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
358  /// the default for \p writeSparsely is \c false.
359  USDRI_API
360  UsdAttribute CreateColorRampKnotsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
361 
362 public:
363  // --------------------------------------------------------------------- //
364  // COLORRAMPCOLORS
365  // --------------------------------------------------------------------- //
366  /// Color values of the colorRamp spline.
367  ///
368  /// | ||
369  /// | -- | -- |
370  /// | Declaration | `color3f[] colorRamp:colors = [(1, 1, 1), (1, 1, 1), (1, 1, 1), (1, 1, 1)]` |
371  /// | C++ Type | VtArray<GfVec3f> |
372  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Color3fArray |
373  USDRI_API
375 
376  /// See GetColorRampColorsAttr(), and also
377  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
378  /// If specified, author \p defaultValue as the attribute's default,
379  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
380  /// the default for \p writeSparsely is \c false.
381  USDRI_API
382  UsdAttribute CreateColorRampColorsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
383 
384 public:
385  // --------------------------------------------------------------------- //
386  // COLORRAMPINTERPOLATION
387  // --------------------------------------------------------------------- //
388  /// ColorRamp spline type.
389  ///
390  /// | ||
391  /// | -- | -- |
392  /// | Declaration | `token colorRamp:interpolation = "linear"` |
393  /// | C++ Type | TfToken |
394  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
395  /// | \ref UsdRiTokens "Allowed Values" | linear, catmull-rom, bspline, constant |
396  USDRI_API
398 
399  /// See GetColorRampInterpolationAttr(), and also
400  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
401  /// If specified, author \p defaultValue as the attribute's default,
402  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
403  /// the default for \p writeSparsely is \c false.
404  USDRI_API
405  UsdAttribute CreateColorRampInterpolationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
406 
407 public:
408  // ===================================================================== //
409  // Feel free to add custom code below this line, it will be preserved by
410  // the code generator.
411  //
412  // Just remember to:
413  // - Close the class declaration with };
414  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
415  // - Close the include guard with #endif
416  // ===================================================================== //
417  // --(BEGIN CUSTOM CODE)--
418 
419  /// Return the UsdRiSplineAPI interface used for examining and modifying
420  /// the falloff ramp.
421  USDRI_API
423 
424  /// Return the UsdRiSplineAPI interface used for examining and modifying
425  /// the color ramp.
426  USDRI_API
428 };
429 
431 
432 #endif
USDRI_API UsdAttribute GetColorRampColorsAttr() const
USDRI_API UsdSchemaKind _GetSchemaKind() const override
USDRI_API UsdAttribute CreateFalloffFloatsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute CreateEndDistanceAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static USDRI_API UsdRiPxrRampLightFilter Define(const UsdStagePtr &stage, const SdfPath &path)
USDRI_API UsdAttribute GetFalloffFloatsAttr() const
USDRI_API UsdAttribute CreateColorRampInterpolationAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute GetFalloffAttr() const
USDRI_API UsdAttribute GetFalloffKnotsAttr() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
static const UsdSchemaKind schemaKind
USDRI_API UsdAttribute CreateFalloffInterpolationAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute CreateColorRampKnotsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdRiSplineAPI GetColorRampAPI() const
USDRI_API UsdAttribute CreateRampModeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute CreateBeginDistanceAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdSchemaKind
Definition: common.h:127
USDRI_API UsdAttribute GetRampModeAttr() const
USDRI_API UsdAttribute GetColorRampAttr() const
USDRI_API UsdRiSplineAPI GetFalloffRampAPI() const
USDRI_API UsdAttribute CreateFalloffKnotsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
Represents a concrete typed schema.
USDRI_API UsdAttribute GetColorRampInterpolationAttr() const
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
virtual USDRI_API ~UsdRiPxrRampLightFilter()
Destructor.
#define USDRI_API
Definition: api.h:40
Definition: path.h:288
USDRI_API UsdAttribute CreateFalloffAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdRiPxrRampLightFilter(const UsdSchemaBase &schemaObj)
USDRI_API UsdAttribute CreateColorRampColorsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute GetFalloffInterpolationAttr() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
USDRI_API UsdAttribute CreateColorRampAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute GetBeginDistanceAttr() const
static USDRI_API UsdRiPxrRampLightFilter Get(const UsdStagePtr &stage, const SdfPath &path)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDRI_API UsdAttribute GetEndDistanceAttr() const
Definition: type.h:64
static USDRI_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
USDRI_API UsdAttribute GetColorRampKnotsAttr() const
UsdRiPxrRampLightFilter(const UsdPrim &prim=UsdPrim())
Definition: value.h:168