HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
purpose.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 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 __GUSD_PURPOSE_H__
25 #define __GUSD_PURPOSE_H__
26 
27 #include <UT/UT_StringArray.h>
28 #include <UT/UT_StringHolder.h>
29 
30 #include "pxr/pxr.h"
31 #include "pxr/usd/usdGeom/tokens.h"
32 
33 #include "gusd/api.h"
34 
35 
37 
38 
45 };
46 
47 
49 inline GusdPurposeSet
51 {
52  if(name == UsdGeomTokens->default_)
53  return GUSD_PURPOSE_DEFAULT;
54  else if(name == UsdGeomTokens->proxy)
55  return GUSD_PURPOSE_PROXY;
56  else if(name == UsdGeomTokens->render)
57  return GUSD_PURPOSE_RENDER;
58  else if(name == UsdGeomTokens->guide)
59  return GUSD_PURPOSE_GUIDE;
60  return GUSD_PURPOSE_NONE;
61 }
62 
63 
65 inline GusdPurposeSet
67 {
68  if(name == UsdGeomTokens->default_)
69  return GUSD_PURPOSE_DEFAULT;
70  else if(name == UsdGeomTokens->proxy)
71  return GUSD_PURPOSE_PROXY;
72  else if(name == UsdGeomTokens->render)
73  return GUSD_PURPOSE_RENDER;
74  else if(name == UsdGeomTokens->guide)
75  return GUSD_PURPOSE_GUIDE;
76  return GUSD_PURPOSE_NONE;
77 }
78 
79 
81 inline bool
83 {
84  return set&GusdPurposeSetFromName(name);
85 }
86 
87 
88 /// Create a purpose set from an array of purpose strings.
89 /// @{
92 
95 /// @}
96 
97 
98 /// Extract an array of tokens for @a purposes.
101 
102 
103 /// Extract an array of strings for @a purposes.
104 GUSD_API
106 
107 
108 /// Return a purpose set from a string providing a mask of purposes.
109 GUSD_API
111 
112 
114 
115 #endif // __GUSD_PURPOSE_H__
GUSD_API GusdPurposeSet GusdPurposeSetFromMask(const char *mask)
Return a purpose set from a string providing a mask of purposes.
GUSD_API TfTokenVector GusdPurposeSetToTokens(GusdPurposeSet purposes)
Extract an array of tokens for purposes.
GUSD_API UT_StringArray GusdPurposeSetToStrings(GusdPurposeSet purposes)
Extract an array of strings for purposes.
Definition: token.h:87
GLint GLuint mask
Definition: glcorearb.h:124
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
GLuint const GLchar * name
Definition: glcorearb.h:786
GUSD_API GusdPurposeSet GusdPurposeSetFromArray(const UT_StringArray &purposes)
USDGEOM_API TfStaticData< UsdGeomTokensType > UsdGeomTokens
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
GUSD_API bool GusdPurposeInSet(const TfToken &name, GusdPurposeSet set)
Definition: purpose.h:82
#define GUSD_API
Definition: api.h:40
GUSD_API GusdPurposeSet GusdPurposeSetFromName(const UT_StringRef &name)
Definition: purpose.h:50
GusdPurposeSet
Definition: purpose.h:39