All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
statementsAPI.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_STATEMENTSAPI_H
25 #define USDRI_GENERATED_STATEMENTSAPI_H
26 
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 
36 
37 
38 #include "pxr/base/vt/value.h"
39 
40 #include "pxr/base/gf/vec3d.h"
41 #include "pxr/base/gf/vec3f.h"
42 #include "pxr/base/gf/matrix4d.h"
43 
44 #include "pxr/base/tf/token.h"
45 #include "pxr/base/tf/type.h"
46 
47 PXR_NAMESPACE_OPEN_SCOPE
48 
49 class SdfAssetPath;
50 
51 // -------------------------------------------------------------------------- //
52 // STATEMENTSAPI //
53 // -------------------------------------------------------------------------- //
54 
72 {
73 public:
78 
83  explicit UsdRiStatementsAPI(const UsdPrim& prim=UsdPrim())
84  : UsdAPISchemaBase(prim)
85  {
86  }
87 
91  explicit UsdRiStatementsAPI(const UsdSchemaBase& schemaObj)
92  : UsdAPISchemaBase(schemaObj)
93  {
94  }
95 
97  USDRI_API
98  virtual ~UsdRiStatementsAPI();
99 
103  USDRI_API
104  static const TfTokenVector &
105  GetSchemaAttributeNames(bool includeInherited=true);
106 
116  USDRI_API
117  static UsdRiStatementsAPI
118  Get(const UsdStagePtr &stage, const SdfPath &path);
119 
120 
137  USDRI_API
138  static bool
139  CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
140 
156  USDRI_API
157  static UsdRiStatementsAPI
158  Apply(const UsdPrim &prim);
159 
160 protected:
164  USDRI_API
165  UsdSchemaKind _GetSchemaKind() const override;
166 
167 private:
168  // needs to invoke _GetStaticTfType.
169  friend class UsdSchemaRegistry;
170  USDRI_API
171  static const TfType &_GetStaticTfType();
172 
173  static bool _IsTypedSchema();
174 
175  // override SchemaBase virtuals.
176  USDRI_API
177  const TfType &_GetTfType() const override;
178 
179 public:
180  // ===================================================================== //
181  // Feel free to add custom code below this line, it will be preserved by
182  // the code generator.
183  //
184  // Just remember to:
185  // - Close the class declaration with };
186  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
187  // - Close the include guard with #endif
188  // ===================================================================== //
189  // --(BEGIN CUSTOM CODE)--
190 
191  // --------------------------------------------------------------------- //
192  // CreateRiAttribute
193  // --------------------------------------------------------------------- //
207  USDRI_API
210  const TfToken &name,
211  const std::string &riType,
212  const std::string &nameSpace = "user");
213 
216  USDRI_API
219  const TfToken &name,
220  const TfType &tfType,
221  const std::string &nameSpace = "user");
222 
227  USDRI_API
230  const TfToken &name,
231  const std::string &nameSpace = "user");
232 
233  // --------------------------------------------------------------------- //
234  // GetRiAttributes
235  // --------------------------------------------------------------------- //
242  USDRI_API
243  std::vector<UsdProperty>
244  GetRiAttributes(const std::string &nameSpace = "") const;
245  // --------------------------------------------------------------------- //
246  // GetRiAttributeName
247  // --------------------------------------------------------------------- //
250  inline static TfToken GetRiAttributeName(const UsdProperty &prop) {
251  return prop.GetBaseName();
252  }
253 
254  // --------------------------------------------------------------------- //
255  // GetRiAttributeNameSpace
256  // --------------------------------------------------------------------- //
259  USDRI_API
260  static TfToken GetRiAttributeNameSpace(const UsdProperty &prop);
261 
262  // --------------------------------------------------------------------- //
263  // IsRiAttribute
264  // --------------------------------------------------------------------- //
267  USDRI_API
268  static bool IsRiAttribute(const UsdProperty &prop);
269 
270  // --------------------------------------------------------------------- //
271  // MakeRiAttributePropertyName
272  // --------------------------------------------------------------------- //
294  USDRI_API
295  static std::string MakeRiAttributePropertyName(const std::string &attrName);
296 
297  // --------------------------------------------------------------------- //
298  // SetCoordinateSystem
299  // --------------------------------------------------------------------- //
308  USDRI_API
309  void SetCoordinateSystem(const std::string &coordSysName);
310 
311  // --------------------------------------------------------------------- //
312  // GetCoordinateSystem
313  // --------------------------------------------------------------------- //
316  USDRI_API
317  std::string GetCoordinateSystem() const;
318 
319  // --------------------------------------------------------------------- //
320  // HasCoordinateSystem
321  // --------------------------------------------------------------------- //
324  USDRI_API
325  bool HasCoordinateSystem() const;
326 
327  // --------------------------------------------------------------------- //
328  // SetScopedCoordinateSystem
329  // --------------------------------------------------------------------- //
340  USDRI_API
341  void SetScopedCoordinateSystem(const std::string &coordSysName);
342 
343  // --------------------------------------------------------------------- //
344  // GetScopedCoordinateSystem
345  // --------------------------------------------------------------------- //
349  USDRI_API
350  std::string GetScopedCoordinateSystem() const;
351 
352  // --------------------------------------------------------------------- //
353  // HasScopedCoordinateSystem
354  // --------------------------------------------------------------------- //
358  USDRI_API
359  bool HasScopedCoordinateSystem() const;
360 
361  // --------------------------------------------------------------------- //
362  // GetModelCoordinateSystems
363  // --------------------------------------------------------------------- //
368  USDRI_API
369  bool GetModelCoordinateSystems(SdfPathVector *targets) const;
370 
371  // --------------------------------------------------------------------- //
372  // GetModelScopedCoordinateSystems
373  // --------------------------------------------------------------------- //
378  USDRI_API
379  bool GetModelScopedCoordinateSystems(SdfPathVector *targets) const;
380 
381 };
382 
383 PXR_NAMESPACE_CLOSE_SCOPE
384 
385 #endif
static USDRI_API UsdRiStatementsAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdRiStatementsAPI holding the prim adhering to this schema at path on stage.
static USDRI_API UsdRiStatementsAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: statementsAPI.h:77
USDRI_API std::string GetCoordinateSystem() const
Returns the value in the &quot;ri:coordinateSystem&quot; attribute if it exists.
virtual USDRI_API ~UsdRiStatementsAPI()
Destructor.
static USDRI_API std::string MakeRiAttributePropertyName(const std::string &attrName)
Returns the given attrName prefixed with the full Ri attribute namespace, creating a name suitable fo...
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:127
USDRI_API std::string GetScopedCoordinateSystem() const
Returns the value in the &quot;ri:scopedCoordinateSystem&quot; attribute if it exists.
USDRI_API bool GetModelCoordinateSystems(SdfPathVector *targets) const
Populates the output targets with the authored ri:modelCoordinateSystems, if any. ...
Single Apply API schema.
USDRI_API bool GetModelScopedCoordinateSystems(SdfPathVector *targets) const
Populates the output targets with the authored ri:modelScopedCoordinateSystems, if any...
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
UsdRiStatementsAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdRiStatementsAPI on UsdPrim prim .
Definition: statementsAPI.h:83
USDRI_API std::vector< UsdProperty > GetRiAttributes(const std::string &nameSpace="") const
Return all rib attributes on this prim, or under a specific namespace (e.g. &quot;user&quot;).
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
static USDRI_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
USDRI_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDRI_API bool HasCoordinateSystem() const
Returns true if the underlying prim has a ri:coordinateSystem opinion.
static TfToken GetRiAttributeName(const UsdProperty &prop)
Return the base, most-specific name of the rib attribute.
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
USDRI_API bool HasScopedCoordinateSystem() const
Returns true if the underlying prim has a ri:scopedCoordinateSystem opinion.
Base class for UsdAttribute and UsdRelationship scenegraph objects.
Definition: property.h:55
USDRI_API UsdAttribute CreateRiAttribute(const TfToken &name, const std::string &riType, const std::string &nameSpace="user")
Create a rib attribute on the prim to which this schema is attached.
static USDRI_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
static USDRI_API bool IsRiAttribute(const UsdProperty &prop)
Return true if the property is in the &quot;ri:attributes&quot; namespace.
Container namespace schema for all renderman statements.
Definition: statementsAPI.h:71
USDRI_API void SetScopedCoordinateSystem(const std::string &coordSysName)
Sets the &quot;ri:scopedCoordinateSystem&quot; attribute to the given string value, creating the attribute if n...
TfType represents a dynamic runtime type.
Definition: type.h:64
Singleton registry that provides access to schema type information and the prim definitions for regis...
UsdRiStatementsAPI(const UsdSchemaBase &schemaObj)
Construct a UsdRiStatementsAPI on the prim held by schemaObj .
Definition: statementsAPI.h:91
USDRI_API UsdAttribute GetRiAttribute(const TfToken &name, const std::string &nameSpace="user")
Return a UsdAttribute representing the Ri attribute with the name name, in the namespace nameSpace...
The base class for all schema types in Usd.
Definition: schemaBase.h:56
USDRI_API void SetCoordinateSystem(const std::string &coordSysName)
Sets the &quot;ri:coordinateSystem&quot; attribute to the given string value, creating the attribute if needed...
static USDRI_API TfToken GetRiAttributeNameSpace(const UsdProperty &prop)
Return the containing namespace of the rib attribute (e.g. &quot;user&quot;).
USD_API TfToken GetBaseName() const
Return this property&#39;s name with all namespace prefixes removed, i.e.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...