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"
31 #include "pxr/usd/usd/apiSchemaBase.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 
35 #include "pxr/usd/usdGeom/primvarsAPI.h"
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 
135  USDRI_API
136  static UsdRiStatementsAPI
137  Apply(const UsdPrim &prim);
138 
139 protected:
143  USDRI_API
144  UsdSchemaType _GetSchemaType() const override;
145 
146 private:
147  // needs to invoke _GetStaticTfType.
148  friend class UsdSchemaRegistry;
149  USDRI_API
150  static const TfType &_GetStaticTfType();
151 
152  static bool _IsTypedSchema();
153 
154  // override SchemaBase virtuals.
155  USDRI_API
156  const TfType &_GetTfType() const override;
157 
158 public:
159  // ===================================================================== //
160  // Feel free to add custom code below this line, it will be preserved by
161  // the code generator.
162  //
163  // Just remember to:
164  // - Close the class declaration with };
165  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
166  // - Close the include guard with #endif
167  // ===================================================================== //
168  // --(BEGIN CUSTOM CODE)--
169 
170  // --------------------------------------------------------------------- //
171  // CreateRiAttribute
172  // --------------------------------------------------------------------- //
186  USDRI_API
189  const TfToken &name,
190  const std::string &riType,
191  const std::string &nameSpace = "user");
192 
195  USDRI_API
198  const TfToken &name,
199  const TfType &tfType,
200  const std::string &nameSpace = "user");
201 
206  USDRI_API
209  const TfToken &name,
210  const std::string &nameSpace = "user");
211 
212  // --------------------------------------------------------------------- //
213  // GetRiAttributes
214  // --------------------------------------------------------------------- //
221  USDRI_API
222  std::vector<UsdProperty>
223  GetRiAttributes(const std::string &nameSpace = "") const;
224  // --------------------------------------------------------------------- //
225  // GetRiAttributeName
226  // --------------------------------------------------------------------- //
229  inline static TfToken GetRiAttributeName(const UsdProperty &prop) {
230  return prop.GetBaseName();
231  }
232 
233  // --------------------------------------------------------------------- //
234  // GetRiAttributeNameSpace
235  // --------------------------------------------------------------------- //
238  USDRI_API
239  static TfToken GetRiAttributeNameSpace(const UsdProperty &prop);
240 
241  // --------------------------------------------------------------------- //
242  // IsRiAttribute
243  // --------------------------------------------------------------------- //
246  USDRI_API
247  static bool IsRiAttribute(const UsdProperty &prop);
248 
249  // --------------------------------------------------------------------- //
250  // MakeRiAttributePropertyName
251  // --------------------------------------------------------------------- //
273  USDRI_API
274  static std::string MakeRiAttributePropertyName(const std::string &attrName);
275 
276  // --------------------------------------------------------------------- //
277  // SetCoordinateSystem
278  // --------------------------------------------------------------------- //
287  USDRI_API
288  void SetCoordinateSystem(const std::string &coordSysName);
289 
290  // --------------------------------------------------------------------- //
291  // GetCoordinateSystem
292  // --------------------------------------------------------------------- //
295  USDRI_API
296  std::string GetCoordinateSystem() const;
297 
298  // --------------------------------------------------------------------- //
299  // HasCoordinateSystem
300  // --------------------------------------------------------------------- //
303  USDRI_API
304  bool HasCoordinateSystem() const;
305 
306  // --------------------------------------------------------------------- //
307  // SetScopedCoordinateSystem
308  // --------------------------------------------------------------------- //
319  USDRI_API
320  void SetScopedCoordinateSystem(const std::string &coordSysName);
321 
322  // --------------------------------------------------------------------- //
323  // GetScopedCoordinateSystem
324  // --------------------------------------------------------------------- //
328  USDRI_API
329  std::string GetScopedCoordinateSystem() const;
330 
331  // --------------------------------------------------------------------- //
332  // HasScopedCoordinateSystem
333  // --------------------------------------------------------------------- //
337  USDRI_API
338  bool HasScopedCoordinateSystem() const;
339 
340  // --------------------------------------------------------------------- //
341  // GetModelCoordinateSystems
342  // --------------------------------------------------------------------- //
347  USDRI_API
348  bool GetModelCoordinateSystems(SdfPathVector *targets) const;
349 
350  // --------------------------------------------------------------------- //
351  // GetModelScopedCoordinateSystems
352  // --------------------------------------------------------------------- //
357  USDRI_API
358  bool GetModelScopedCoordinateSystems(SdfPathVector *targets) const;
359 
360 };
361 
362 PXR_NAMESPACE_CLOSE_SCOPE
363 
364 #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 UsdSchemaType schemaType
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.
USDRI_API UsdSchemaType _GetSchemaType() const override
Returns the type of schema this class belongs to.
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
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. ...
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;).
UsdSchemaType
An enum representing which type of schema a given schema class belongs to.
Definition: common.h:127
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
Single Apply API schema.
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 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:43
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 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.