HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
registeredVariantSet.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_UTILS_REGISTERED_VARIANT_SET_H
8 #define PXR_USD_USD_UTILS_REGISTERED_VARIANT_SET_H
9 
10 /// \file usdUtils/registeredVariantSet.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdUtils/api.h"
14 #include <string>
15 
17 
18 
19 /// \class UsdUtilsRegisteredVariantSet
20 ///
21 /// Class that holds information about variantSets that are registered with
22 /// the pipeline.
23 ///
24 /// Registered variantSets are known variantSets in a pipeline that may need to
25 /// be reasoned about by apps during import/export.
26 ///
27 /// \sa UsdUtilsGetRegisteredVariantSets
29 {
30 public:
31  /// The name of the variantSet.
32  const std::string name;
33 
34  /// This specifies how the variantSet should be treated during export.
35  ///
36  /// Note, in the plugInfo.json, the values for these enum's are
37  /// lowerCamelCase.
38  enum class SelectionExportPolicy {
39  /// Never `"never"`
40  ///
41  /// This variantSet selection is meant to remain entirely within an
42  /// application. This typically represents a "session" variantSelection
43  /// that should not be transmitted down the pipeline.
44  Never,
45 
46  /// IfAuthored `"ifAuthored"`
47  ///
48  /// This variantSet selection should be exported if there is an authored
49  /// opinion in the application. This is only relevant if the
50  /// application is able to distinguish between "default" and "set"
51  /// opinions.
52  IfAuthored,
53 
54  /// Authored `"authored"`
55  ///
56  /// This variantSet selection should always be exported.
57  Always,
58  };
59 
60  /// Returns the export policy from the string.
62  const std::string& selectionExportPolicyStr,
64 
65  /// Specifies how to export a variant selection.
67 
69  const std::string& name,
71  name(name),
72  selectionExportPolicy(selectionExportPolicy)
73  {
74  }
75 
76  // provided so this can be stored in a std::set.
78  other) const {
79  return this->name < other.name;
80  }
81 };
82 
83 
85 
86 #endif /* PXR_USD_USD_UTILS_REGISTERED_VARIANT_SET_H */
static bool GetSelectionExportPolicyFromString(const std::string &selectionExportPolicyStr, SelectionExportPolicy *selectionExportPolicy)
Returns the export policy from the string.
UsdUtilsRegisteredVariantSet(const std::string &name, const SelectionExportPolicy &selectionExportPolicy)
bool operator<(const UsdUtilsRegisteredVariantSet &other) const
GLuint const GLchar * name
Definition: glcorearb.h:786
const SelectionExportPolicy selectionExportPolicy
Specifies how to export a variant selection.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
const std::string name
The name of the variantSet.