HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rmanUtilities.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_USD_RI_RMAN_UTILITIES_H
8 #define PXR_USD_USD_RI_RMAN_UTILITIES_H
9 
10 /// \file usdRi/rmanUtilities.h
11 /// Utilities for converting between USD encodings and Renderman encodings in
12 /// cases where there is a difference.
13 
14 #include "pxr/pxr.h"
15 #include "pxr/usd/usdRi/api.h"
16 #include "pxr/usd/sdf/listOp.h"
17 
19 
20 class TfToken;
21 
22 /// Given a \p token representing a UsdGeom interpolate boundary value, returns
23 /// corresponding rman enum (converted to int).
26 
27 /// Given the integer \p i that corresponds to an rman enum for interpolate
28 /// boundary condition, returns the equivalent UsdGeom token.
31 
32 /// Given a \p token representing a UsdGeom face-varying interpolate boundary
33 /// value, returns corresponding rman enum (converted to int).
36 
37 /// Given the integer \p i that corresponds to an rman enum for face-varying
38 /// interpolate boundary condition, returns the equivalent UsdGeom token.
41 
42 /// Given a \p token representing a UsdGeom Catmull-Clark triangle subdivision
43 /// rule value, returns corresponding rman enum (converted to int).
46 
47 /// Given the integer \p i that corresponds to an rman enum for a Catmull-
48 /// Clark triangle subdivision rule, returns the equivalent UsdGeom token.
51 
52 /// Convert the given RenderMan set specification statement to an
53 /// equivalent SdfStringListOp form.
54 ///
55 /// RenderMan specifies certain set operations using a string encoding.
56 /// The string form contains either a list of named groups, or a unary
57 /// operator ("+" or "-") followed by a list of named groups.
58 /// In set-algebra terms "+" is a union and "-" is a difference
59 /// operator.
60 ///
61 /// This method converts the string form to an equivalent USD type,
62 /// SdfStringListOp.
63 ///
64 /// The string representation is used implicitly for certain
65 /// attributes; see UsdRiDoesAttributeUseSetSpecification().
66 ///
67 /// \note SdfStringListOp is more expressive than the RenderMan
68 /// grouping membership representation, so lossless
69 /// round-trip conversion is not possible in general.
70 ///
71 /// \see SdfStringListOp::ApplyOperations()
72 ///
75 
76 /// Return true if an only if the given attribute name uses a
77 /// string set specification representation in the RenderMan interface.
78 ///
79 /// Consult the RenderMan documentation for more details, but
80 /// at time of writing, this includes the following:
81 ///
82 /// - grouping:membership
83 /// - lighting:excludesubset
84 /// - lighting:subset
85 /// - lightfilter:subset
86 ///
89 
91 
92 #endif //PXR_USD_USD_RI_RMAN_UTILITIES_H
USDRI_API bool UsdRiDoesAttributeUseSetSpecification(TfToken const &attrName)
USDRI_API int UsdRiConvertToRManInterpolateBoundary(const TfToken &token)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
USDRI_API const TfToken & UsdRiConvertFromRManInterpolateBoundary(int i)
USDRI_API const TfToken & UsdRiConvertFromRManFaceVaryingLinearInterpolation(int i)
Definition: token.h:70
USDRI_API SdfStringListOp UsdRiConvertRManSetSpecificationToListOp(std::string const &)
class SdfListOp< std::string > SdfStringListOp
Definition: listOp.h:376
#define USDRI_API
Definition: api.h:23
USDRI_API int UsdRiConvertToRManTriangleSubdivisionRule(const TfToken &token)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDRI_API const TfToken & UsdRiConvertFromRManTriangleSubdivisionRule(int i)
USDRI_API int UsdRiConvertToRManFaceVaryingLinearInterpolation(const TfToken &token)