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 
133  USDRI_API
134  static UsdRiStatementsAPI
135  Apply(const UsdPrim &prim);
136 
137 protected:
141  USDRI_API
142  UsdSchemaType _GetSchemaType() const override;
143 
144 private:
145  // needs to invoke _GetStaticTfType.
146  friend class UsdSchemaRegistry;
147  USDRI_API
148  static const TfType &_GetStaticTfType();
149 
150  static bool _IsTypedSchema();
151 
152  // override SchemaBase virtuals.
153  USDRI_API
154  const TfType &_GetTfType() const override;
155 
156 public:
157  // ===================================================================== //
158  // Feel free to add custom code below this line, it will be preserved by
159  // the code generator.
160  //
161  // Just remember to:
162  // - Close the class declaration with };
163  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
164  // - Close the include guard with #endif
165  // ===================================================================== //
166  // --(BEGIN CUSTOM CODE)--
167 
168  // --------------------------------------------------------------------- //
169  // CreateRiAttribute
170  // --------------------------------------------------------------------- //
184  USDRI_API
187  const TfToken &name,
188  const std::string &riType,
189  const std::string &nameSpace = "user");
190 
193  USDRI_API
196  const TfToken &name,
197  const TfType &tfType,
198  const std::string &nameSpace = "user");
199 
204  USDRI_API
207  const TfToken &name,
208  const std::string &nameSpace = "user");
209 
210  // --------------------------------------------------------------------- //
211  // GetRiAttributes
212  // --------------------------------------------------------------------- //
219  USDRI_API
220  std::vector<UsdProperty>
221  GetRiAttributes(const std::string &nameSpace = "") const;
222  // --------------------------------------------------------------------- //
223  // GetRiAttributeName
224  // --------------------------------------------------------------------- //
227  inline static TfToken GetRiAttributeName(const UsdProperty &prop) {
228  return prop.GetBaseName();
229  }
230 
231  // --------------------------------------------------------------------- //
232  // GetRiAttributeNameSpace
233  // --------------------------------------------------------------------- //
236  USDRI_API
237  static TfToken GetRiAttributeNameSpace(const UsdProperty &prop);
238 
239  // --------------------------------------------------------------------- //
240  // IsRiAttribute
241  // --------------------------------------------------------------------- //
244  USDRI_API
245  static bool IsRiAttribute(const UsdProperty &prop);
246 
247  // --------------------------------------------------------------------- //
248  // MakeRiAttributePropertyName
249  // --------------------------------------------------------------------- //
271  USDRI_API
272  static std::string MakeRiAttributePropertyName(const std::string &attrName);
273 
274  // --------------------------------------------------------------------- //
275  // SetCoordinateSystem
276  // --------------------------------------------------------------------- //
285  USDRI_API
286  void SetCoordinateSystem(const std::string &coordSysName);
287 
288  // --------------------------------------------------------------------- //
289  // GetCoordinateSystem
290  // --------------------------------------------------------------------- //
293  USDRI_API
294  std::string GetCoordinateSystem() const;
295 
296  // --------------------------------------------------------------------- //
297  // HasCoordinateSystem
298  // --------------------------------------------------------------------- //
301  USDRI_API
302  bool HasCoordinateSystem() const;
303 
304  // --------------------------------------------------------------------- //
305  // SetScopedCoordinateSystem
306  // --------------------------------------------------------------------- //
317  USDRI_API
318  void SetScopedCoordinateSystem(const std::string &coordSysName);
319 
320  // --------------------------------------------------------------------- //
321  // GetScopedCoordinateSystem
322  // --------------------------------------------------------------------- //
326  USDRI_API
327  std::string GetScopedCoordinateSystem() const;
328 
329  // --------------------------------------------------------------------- //
330  // HasScopedCoordinateSystem
331  // --------------------------------------------------------------------- //
335  USDRI_API
336  bool HasScopedCoordinateSystem() const;
337 
338  // --------------------------------------------------------------------- //
339  // GetModelCoordinateSystems
340  // --------------------------------------------------------------------- //
345  USDRI_API
346  bool GetModelCoordinateSystems(SdfPathVector *targets) const;
347 
348  // --------------------------------------------------------------------- //
349  // GetModelScopedCoordinateSystems
350  // --------------------------------------------------------------------- //
355  USDRI_API
356  bool GetModelScopedCoordinateSystems(SdfPathVector *targets) const;
357 
358 };
359 
360 PXR_NAMESPACE_CLOSE_SCOPE
361 
362 #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:89
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:149
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
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:287
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:70
Singleton registry that provides access to prim and property definition information for registered Us...
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.