attributeHints.h
1 //
2 // Copyright 2025 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_USD_USDUI_ATTRIBUTE_HINTS_H
9 #define PXR_USD_USDUI_ATTRIBUTE_HINTS_H
10 
12 #include "pxr/usd/usd/attribute.h"
13 
14 #include "pxr/base/vt/dictionary.h"
15 #include "pxr/base/vt/value.h"
16 
17 #include <string>
18 
19 PXR_NAMESPACE_OPEN_SCOPE
20 
35 {
36 public:
41  USDUI_API
43 
45  USDUI_API
46  explicit UsdUIAttributeHints(const UsdAttribute& attr);
47 
49  UsdAttribute GetAttribute() const { return _attr; }
50 
55  USDUI_API
57 
65  USDUI_API
66  bool SetValueLabels(const VtDictionary& labels);
67 
70  USDUI_API
71  VtTokenArray GetValueLabelsOrder() const;
72 
74  USDUI_API
75  bool SetValueLabelsOrder(const VtTokenArray& order);
76 
81  USDUI_API
82  bool ApplyValueLabel(const std::string& label);
83 
84 private:
85  UsdAttribute _attr;
86 };
87 
88 PXR_NAMESPACE_CLOSE_SCOPE
89 
90 #endif
A "schema-like" wrapper that provides API for retrieving and authoring UI hint values within the uiHi...
A map with string keys and VtValue values.
Definition: dictionary.h:52
UsdAttribute GetAttribute() const
Return the attribute that this hints instance is interpreting.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
USDUI_API bool SetValueLabelsOrder(const VtTokenArray &order)
Set the attribute's value labels order. Return true if successful.
USDUI_API bool SetValueLabels(const VtDictionary &labels)
Set the attribute's value labels dictionary.
A "schema-like" wrapper that provides API for retrieving and authoring UI hint values within the uiHi...
Definition: propertyHints.h:31
USDUI_API VtDictionary GetValueLabels() const
Return the attribute's value labels dictionary.
USDUI_API bool ApplyValueLabel(const std::string &label)
Author the value associated with the given label to the attribute.
USDUI_API UsdUIAttributeHints()
Default constructor that creates an invalid hints object.
USDUI_API VtTokenArray GetValueLabelsOrder() const
Return the value labels order, indicating the order in which value labels should appear.