HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lightFilterAPI.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_LIGHTFILTERAPI_H
25 #define USDRI_GENERATED_LIGHTFILTERAPI_H
26 
27 /// \file usdRi/lightFilterAPI.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 
36 #include "pxr/base/vt/value.h"
37 
38 #include "pxr/base/gf/vec3d.h"
39 #include "pxr/base/gf/vec3f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 
42 #include "pxr/base/tf/token.h"
43 #include "pxr/base/tf/type.h"
44 
46 
47 class SdfAssetPath;
48 
49 // -------------------------------------------------------------------------- //
50 // RILIGHTFILTERAPI //
51 // -------------------------------------------------------------------------- //
52 
53 /// \class UsdRiLightFilterAPI
54 ///
55 ///
56 /// \deprecated RenderMan-specific light filter settings will move to a
57 /// new schema in a future release.
58 ///
59 /// Renderman-specific attributes for light filters.
60 ///
61 /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
62 /// that are text/tokens, the actual token is published and defined in \ref UsdRiTokens.
63 /// So to set an attribute to the value "rightHanded", use UsdRiTokens->rightHanded
64 /// as the value.
65 ///
67 {
68 public:
69  /// Compile time constant representing what kind of schema this class is.
70  ///
71  /// \sa UsdSchemaType
73 
74  /// Construct a UsdRiLightFilterAPI on UsdPrim \p prim .
75  /// Equivalent to UsdRiLightFilterAPI::Get(prim.GetStage(), prim.GetPath())
76  /// for a \em valid \p prim, but will not immediately throw an error for
77  /// an invalid \p prim
78  explicit UsdRiLightFilterAPI(const UsdPrim& prim=UsdPrim())
79  : UsdAPISchemaBase(prim)
80  {
81  }
82 
83  /// Construct a UsdRiLightFilterAPI on the prim held by \p schemaObj .
84  /// Should be preferred over UsdRiLightFilterAPI(schemaObj.GetPrim()),
85  /// as it preserves SchemaBase state.
86  explicit UsdRiLightFilterAPI(const UsdSchemaBase& schemaObj)
87  : UsdAPISchemaBase(schemaObj)
88  {
89  }
90 
91  /// Destructor.
92  USDRI_API
93  virtual ~UsdRiLightFilterAPI();
94 
95  /// Return a vector of names of all pre-declared attributes for this schema
96  /// class and all its ancestor classes. Does not include attributes that
97  /// may be authored by custom/extended methods of the schemas involved.
98  USDRI_API
99  static const TfTokenVector &
100  GetSchemaAttributeNames(bool includeInherited=true);
101 
102  /// Return a UsdRiLightFilterAPI holding the prim adhering to this
103  /// schema at \p path on \p stage. If no prim exists at \p path on
104  /// \p stage, or if the prim at that path does not adhere to this schema,
105  /// return an invalid schema object. This is shorthand for the following:
106  ///
107  /// \code
108  /// UsdRiLightFilterAPI(stage->GetPrimAtPath(path));
109  /// \endcode
110  ///
111  USDRI_API
112  static UsdRiLightFilterAPI
113  Get(const UsdStagePtr &stage, const SdfPath &path);
114 
115 
116  /// Applies this <b>single-apply</b> API schema to the given \p prim.
117  /// This information is stored by adding "RiLightFilterAPI" to the
118  /// token-valued, listOp metadata \em apiSchemas on the prim.
119  ///
120  /// \return A valid UsdRiLightFilterAPI object is returned upon success.
121  /// An invalid (or empty) UsdRiLightFilterAPI object is returned upon
122  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
123  /// resulting in failure.
124  ///
125  /// \sa UsdPrim::GetAppliedSchemas()
126  /// \sa UsdPrim::HasAPI()
127  /// \sa UsdPrim::ApplyAPI()
128  /// \sa UsdPrim::RemoveAPI()
129  ///
130  USDRI_API
131  static UsdRiLightFilterAPI
132  Apply(const UsdPrim &prim);
133 
134 protected:
135  /// Returns the type of schema this class belongs to.
136  ///
137  /// \sa UsdSchemaType
138  USDRI_API
139  UsdSchemaType _GetSchemaType() const override;
140 
141 private:
142  // needs to invoke _GetStaticTfType.
143  friend class UsdSchemaRegistry;
144  USDRI_API
145  static const TfType &_GetStaticTfType();
146 
147  static bool _IsTypedSchema();
148 
149  // override SchemaBase virtuals.
150  USDRI_API
151  const TfType &_GetTfType() const override;
152 
153 public:
154  // --------------------------------------------------------------------- //
155  // RICOMBINEMODE
156  // --------------------------------------------------------------------- //
157  /// Specifies how this filter combines with others.
158  /// Valid values are:
159  ///
160  /// - multiply: The results of filters are multiplied together
161  /// - max: The maximum result of the filters is used. This
162  /// works best for grey-scale filters.
163  /// - min: The minimum result of the filters is used. This
164  /// works best for grey-scale filters.
165  /// - screen: Similar to max, but combines gradients in a smoother
166  /// way by using a screen operation:
167  /// <pre>screen(a,b) = 1-(1-a)(1-b)</pre>
168  /// This works best for grey-scale filters.
169  ///
170  /// Light filters on a light are grouped by their combine mode.
171  /// Each group is executed and combined using that mode. Then,
172  /// the final results of each group are multiplied together.
173  ///
174  /// Fallback: multiply
175  ///
176  ///
177  /// | ||
178  /// | -- | -- |
179  /// | Declaration | `token ri:combineMode = "multiply"` |
180  /// | C++ Type | TfToken |
181  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
182  /// | \ref UsdRiTokens "Allowed Values" | multiply, max, min, screen |
183  USDRI_API
185 
186  /// See GetRiCombineModeAttr(), and also
187  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
188  /// If specified, author \p defaultValue as the attribute's default,
189  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
190  /// the default for \p writeSparsely is \c false.
191  USDRI_API
192  UsdAttribute CreateRiCombineModeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
193 
194 public:
195  // --------------------------------------------------------------------- //
196  // RIDENSITY
197  // --------------------------------------------------------------------- //
198  /// Scales the strength of the filter.
199  ///
200  /// | ||
201  /// | -- | -- |
202  /// | Declaration | `float ri:density = 1` |
203  /// | C++ Type | float |
204  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
205  USDRI_API
207 
208  /// See GetRiDensityAttr(), and also
209  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
210  /// If specified, author \p defaultValue as the attribute's default,
211  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
212  /// the default for \p writeSparsely is \c false.
213  USDRI_API
214  UsdAttribute CreateRiDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
215 
216 public:
217  // --------------------------------------------------------------------- //
218  // RIINVERT
219  // --------------------------------------------------------------------- //
220  /// When true, inverts the output of the light filter.
221  ///
222  /// | ||
223  /// | -- | -- |
224  /// | Declaration | `bool ri:invert = 0` |
225  /// | C++ Type | bool |
226  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
227  USDRI_API
229 
230  /// See GetRiInvertAttr(), and also
231  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
232  /// If specified, author \p defaultValue as the attribute's default,
233  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
234  /// the default for \p writeSparsely is \c false.
235  USDRI_API
236  UsdAttribute CreateRiInvertAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
237 
238 public:
239  // --------------------------------------------------------------------- //
240  // RIINTENSITY
241  // --------------------------------------------------------------------- //
242  /// Multipier for the diffuse and specular result.
243  ///
244  /// | ||
245  /// | -- | -- |
246  /// | Declaration | `float ri:intensity = 0` |
247  /// | C++ Type | float |
248  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
249  USDRI_API
251 
252  /// See GetRiIntensityAttr(), and also
253  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
254  /// If specified, author \p defaultValue as the attribute's default,
255  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
256  /// the default for \p writeSparsely is \c false.
257  USDRI_API
258  UsdAttribute CreateRiIntensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
259 
260 public:
261  // --------------------------------------------------------------------- //
262  // RIEXPOSURE
263  // --------------------------------------------------------------------- //
264  /// Exposure control for the multiplier.
265  ///
266  /// | ||
267  /// | -- | -- |
268  /// | Declaration | `float ri:exposure = 0` |
269  /// | C++ Type | float |
270  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
271  USDRI_API
273 
274  /// See GetRiExposureAttr(), and also
275  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
276  /// If specified, author \p defaultValue as the attribute's default,
277  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
278  /// the default for \p writeSparsely is \c false.
279  USDRI_API
280  UsdAttribute CreateRiExposureAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
281 
282 public:
283  // --------------------------------------------------------------------- //
284  // RIDIFFUSE
285  // --------------------------------------------------------------------- //
286  /// A multiplier for the effect of this light on the diffuse
287  /// response of materials. This is a non-physical control.
288  ///
289  /// | ||
290  /// | -- | -- |
291  /// | Declaration | `float ri:diffuse = 1` |
292  /// | C++ Type | float |
293  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
294  USDRI_API
296 
297  /// See GetRiDiffuseAttr(), and also
298  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
299  /// If specified, author \p defaultValue as the attribute's default,
300  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
301  /// the default for \p writeSparsely is \c false.
302  USDRI_API
303  UsdAttribute CreateRiDiffuseAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
304 
305 public:
306  // --------------------------------------------------------------------- //
307  // RISPECULAR
308  // --------------------------------------------------------------------- //
309  /// A multiplier for the effect of this light on the specular
310  /// response of materials. This is a non-physical control.
311  ///
312  /// | ||
313  /// | -- | -- |
314  /// | Declaration | `float ri:specular = 1` |
315  /// | C++ Type | float |
316  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
317  USDRI_API
319 
320  /// See GetRiSpecularAttr(), and also
321  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
322  /// If specified, author \p defaultValue as the attribute's default,
323  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
324  /// the default for \p writeSparsely is \c false.
325  USDRI_API
326  UsdAttribute CreateRiSpecularAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
327 
328 public:
329  // ===================================================================== //
330  // Feel free to add custom code below this line, it will be preserved by
331  // the code generator.
332  //
333  // Just remember to:
334  // - Close the class declaration with };
335  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
336  // - Close the include guard with #endif
337  // ===================================================================== //
338  // --(BEGIN CUSTOM CODE)--
339 };
340 
342 
343 #endif
static USDRI_API UsdRiLightFilterAPI Get(const UsdStagePtr &stage, const SdfPath &path)
USDRI_API UsdAttribute GetRiInvertAttr() const
virtual USDRI_API ~UsdRiLightFilterAPI()
Destructor.
USDRI_API UsdAttribute CreateRiCombineModeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute GetRiDensityAttr() const
UsdRiLightFilterAPI(const UsdSchemaBase &schemaObj)
USDRI_API UsdAttribute CreateRiIntensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdSchemaType _GetSchemaType() const override
USDRI_API UsdAttribute GetRiCombineModeAttr() const
UsdRiLightFilterAPI(const UsdPrim &prim=UsdPrim())
USDRI_API UsdAttribute CreateRiDensityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute GetRiIntensityAttr() const
UsdSchemaType
Definition: common.h:127
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:446
Single Apply API schema.
#define USDRI_API
Definition: api.h:40
Definition: path.h:288
USDRI_API UsdAttribute CreateRiExposureAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GLsizei const GLchar *const * path
Definition: glew.h:6461
USDRI_API UsdAttribute CreateRiSpecularAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute CreateRiInvertAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDRI_API UsdAttribute GetRiSpecularAttr() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1346
USDRI_API UsdAttribute GetRiDiffuseAttr() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
Definition: type.h:64
USDRI_API UsdAttribute CreateRiDiffuseAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static const UsdSchemaType schemaType
static USDRI_API UsdRiLightFilterAPI Apply(const UsdPrim &prim)
static USDRI_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Definition: value.h:174
USDRI_API UsdAttribute GetRiExposureAttr() const