HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lightSettingsAPI.cpp
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 #include ".//lightSettingsAPI.h"
26 #include "pxr/usd/usd/typed.h"
27 #include "pxr/usd/usd/tokens.h"
28 
29 #include "pxr/usd/sdf/types.h"
30 #include "pxr/usd/sdf/assetPath.h"
31 
33 
34 // Register the schema with the TfType system.
36 {
39 
40 }
41 
43  _schemaTokens,
44  (KarmaLightSettingsAPI)
45 );
46 
47 /* virtual */
49 {
50 }
51 
52 /* static */
54 usdKarmaLightSettingsAPI::Get(const UsdStagePtr &stage, const SdfPath &path)
55 {
56  if (!stage) {
57  TF_CODING_ERROR("Invalid stage");
58  return usdKarmaLightSettingsAPI();
59  }
60  return usdKarmaLightSettingsAPI(stage->GetPrimAtPath(path));
61 }
62 
63 
64 /* virtual */
67 }
68 
69 /* static */
72 {
73  return UsdAPISchemaBase::_ApplyAPISchema<usdKarmaLightSettingsAPI>(
74  prim, _schemaTokens->KarmaLightSettingsAPI);
75 }
76 
77 /* static */
78 const TfType &
79 usdKarmaLightSettingsAPI::_GetStaticTfType()
80 {
81  static TfType tfType = TfType::Find<usdKarmaLightSettingsAPI>();
82  return tfType;
83 }
84 
85 /* static */
86 bool
87 usdKarmaLightSettingsAPI::_IsTypedSchema()
88 {
89  static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
90  return isTyped;
91 }
92 
93 /* virtual */
94 const TfType &
95 usdKarmaLightSettingsAPI::_GetTfType() const
96 {
97  return _GetStaticTfType();
98 }
99 
102 {
103  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightActiveradius);
104 }
105 
107 usdKarmaLightSettingsAPI::CreateKarmaLightActiveradiusAttr(VtValue const &defaultValue, bool writeSparsely) const
108 {
109  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightActiveradius,
110  SdfValueTypeNames->Float,
111  /* custom = */ false,
113  defaultValue,
114  writeSparsely);
115 }
116 
119 {
120  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightCategory);
121 }
122 
124 usdKarmaLightSettingsAPI::CreateKarmaLightCategoryAttr(VtValue const &defaultValue, bool writeSparsely) const
125 {
126  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightCategory,
127  SdfValueTypeNames->String,
128  /* custom = */ false,
130  defaultValue,
131  writeSparsely);
132 }
133 
136 {
137  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightDistant_blur);
138 }
139 
141 usdKarmaLightSettingsAPI::CreateKarmaLightDistant_blurAttr(VtValue const &defaultValue, bool writeSparsely) const
142 {
143  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightDistant_blur,
144  SdfValueTypeNames->Float,
145  /* custom = */ false,
147  defaultValue,
148  writeSparsely);
149 }
150 
153 {
154  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightForce_uniform_sampling);
155 }
156 
159 {
160  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightForce_uniform_sampling,
161  SdfValueTypeNames->Bool,
162  /* custom = */ false,
164  defaultValue,
165  writeSparsely);
166 }
167 
170 {
171  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightHdri_max_isize);
172 }
173 
175 usdKarmaLightSettingsAPI::CreateKarmaLightHdri_max_isizeAttr(VtValue const &defaultValue, bool writeSparsely) const
176 {
177  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightHdri_max_isize,
178  SdfValueTypeNames->Int,
179  /* custom = */ false,
181  defaultValue,
182  writeSparsely);
183 }
184 
187 {
188  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightMisbias);
189 }
190 
192 usdKarmaLightSettingsAPI::CreateKarmaLightMisbiasAttr(VtValue const &defaultValue, bool writeSparsely) const
193 {
194  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightMisbias,
195  SdfValueTypeNames->Float,
196  /* custom = */ false,
198  defaultValue,
199  writeSparsely);
200 }
201 
204 {
205  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightSamplingquality);
206 }
207 
209 usdKarmaLightSettingsAPI::CreateKarmaLightSamplingqualityAttr(VtValue const &defaultValue, bool writeSparsely) const
210 {
211  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightSamplingquality,
212  SdfValueTypeNames->Float,
213  /* custom = */ false,
215  defaultValue,
216  writeSparsely);
217 }
218 
221 {
222  return GetPrim().GetAttribute(usdKarmaTokens()->karmaLightShadowtraceset);
223 }
224 
226 usdKarmaLightSettingsAPI::CreateKarmaLightShadowtracesetAttr(VtValue const &defaultValue, bool writeSparsely) const
227 {
228  return UsdSchemaBase::_CreateAttr(usdKarmaTokens()->karmaLightShadowtraceset,
229  SdfValueTypeNames->String,
230  /* custom = */ false,
232  defaultValue,
233  writeSparsely);
234 }
235 
236 namespace {
237 static inline TfTokenVector
238 _ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
239 {
241  result.reserve(left.size() + right.size());
242  result.insert(result.end(), left.begin(), left.end());
243  result.insert(result.end(), right.begin(), right.end());
244  return result;
245 }
246 }
247 
248 /*static*/
249 const TfTokenVector&
251 {
252  static TfTokenVector localNames = {
253  usdKarmaTokens()->karmaLightActiveradius,
254  usdKarmaTokens()->karmaLightCategory,
255  usdKarmaTokens()->karmaLightDistant_blur,
256  usdKarmaTokens()->karmaLightForce_uniform_sampling,
257  usdKarmaTokens()->karmaLightHdri_max_isize,
258  usdKarmaTokens()->karmaLightMisbias,
259  usdKarmaTokens()->karmaLightSamplingquality,
260  usdKarmaTokens()->karmaLightShadowtraceset,
261  };
262  static TfTokenVector allNames =
263  _ConcatenateAttributeNames(
265  localNames);
266 
267  if (includeInherited)
268  return allNames;
269  else
270  return localNames;
271 }
272 
274 
275 // ===================================================================== //
276 // Feel free to add custom code below this line. It will be preserved by
277 // the code generator.
278 //
279 // Just remember to wrap code in the appropriate delimiters:
280 // 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
281 // ===================================================================== //
282 // --(BEGIN CUSTOM CODE)--
static const UsdSchemaType schemaType
UsdAttribute CreateKarmaLightHdri_max_isizeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdAttribute CreateKarmaLightActiveradiusAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdAttribute CreateKarmaLightDistant_blurAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GLint left
Definition: glew.h:8008
UsdAttribute GetKarmaLightSamplingqualityAttr() const
#define TF_CODING_ERROR
UsdAttribute CreateKarmaLightForce_uniform_samplingAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdAttribute GetKarmaLightShadowtracesetAttr() const
usdKarmaLightSettingsAPI(const UsdPrim &prim=UsdPrim())
UsdAttribute CreateKarmaLightMisbiasAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
UsdAttribute GetKarmaLightForce_uniform_samplingAttr() const
static usdKarmaLightSettingsAPI Apply(const UsdPrim &prim)
UsdAttribute GetKarmaLightDistant_blurAttr() const
UsdAttribute GetKarmaLightActiveradiusAttr() const
UsdAttribute GetKarmaLightMisbiasAttr() const
static usdKarmaLightSettingsAPI Get(const UsdStagePtr &stage, const SdfPath &path)
static TfType const & Define()
Definition: type_Impl.h:78
UsdSchemaType
Definition: common.h:149
Definition: prim.h:131
Definition: typed.h:47
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
UsdAttribute CreateKarmaLightCategoryAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GLfloat right
Definition: glew.h:15186
Definition: path.h:287
UsdAttribute CreateKarmaLightSamplingqualityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GLsizei const GLchar *const * path
Definition: glew.h:6461
SDF_API TfStaticData< const Sdf_ValueTypeNamesType, Sdf_ValueTypeNamesType::_Init > SdfValueTypeNames
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
TF_DEFINE_PRIVATE_TOKENS(_schemaTokens,(KarmaLightSettingsAPI))
UsdAttribute GetKarmaLightCategoryAttr() const
USD_API UsdAttribute _CreateAttr(TfToken const &attrName, SdfValueTypeName const &typeName, bool custom, SdfVariability variability, VtValue const &defaultValue, bool writeSparsely) const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
static USD_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Definition: type.h:70
UsdAttribute CreateKarmaLightShadowtracesetAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GLuint64EXT * result
Definition: glew.h:14007
TF_API bool IsA(TfType queryType) const
TfStaticData< usdKarmaTokensType > & usdKarmaTokens()
Definition: tokens.cpp:166
UsdAttribute GetKarmaLightHdri_max_isizeAttr() const
USD_API UsdAttribute GetAttribute(const TfToken &attrName) const
UsdPrim GetPrim() const
Return this schema object's held prim.
Definition: schemaBase.h:119
Definition: value.h:182
virtual UsdSchemaType _GetSchemaType() const
PXR_NAMESPACE_OPEN_SCOPE TF_REGISTRY_FUNCTION(TfType)
virtual ~usdKarmaLightSettingsAPI()
Destructor.