Loading...
Searching...
No Matches
objectHints.h
Go to the documentation of this file.
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_OBJECT_HINTS_H
9#define PXR_USD_USDUI_OBJECT_HINTS_H
10
12
13#include "pxr/usd/usd/object.h"
14#include "pxr/usd/usdUI/api.h"
15
18
19#include <string>
20
21PXR_NAMESPACE_OPEN_SCOPE
22
23USDUI_API
24extern TfEnvSetting<bool> USDUI_WRITE_LEGACY_UI_HINTS;
25
27#define USDUI_HINT_KEYS \
28 ((UIHints, "uiHints")) \
29 ((DisplayName, "displayName")) \
30 ((DisplayGroup, "displayGroup")) \
31 ((Hidden, "hidden")) \
32 ((ShownIf, "shownIf")) \
33 ((ValueLabels, "valueLabels")) \
34 ((ValueLabelsOrder, "valueLabelsOrder")) \
35 ((DisplayGroupsExpanded, "displayGroupsExpanded")) \
36 ((DisplayGroupsShownIf, "displayGroupsShownIf")) \
37
45 UsdUIHintKeys, USDUI_API, USDUI_HINT_KEYS);
46
60{
61public:
66 USDUI_API
68
70 USDUI_API
71 explicit UsdUIObjectHints(const UsdObject& obj);
72
74 UsdObject GetObject() const { return _obj; }
75
83 USDUI_API
84 std::string GetDisplayName() const;
85
91 USDUI_API
92 bool SetDisplayName(const std::string& name);
93
101 USDUI_API
102 bool GetHidden() const;
103
110 USDUI_API
111 bool SetHidden(bool hidden);
112
114 explicit operator bool() const {
115 return bool(_obj);
116 }
117
119 bool operator==(const UsdUIObjectHints& rhs) const {
120 return _obj == rhs._obj;
121 }
122
124 bool operator!=(const UsdUIObjectHints& rhs) const {
125 return !(*this == rhs);
126 }
127
128protected:
131 USDUI_API
133 const TfToken& key1,
134 const TfToken& key2);
135
136private:
137 UsdObject _obj;
138};
139
140PXR_NAMESPACE_CLOSE_SCOPE
141
142#endif
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Base class for Usd scenegraph objects, providing common API.
Definition: object.h:115
A "schema-like" wrapper that provides API for retrieving and authoring UI hint values within the uiHi...
Definition: objectHints.h:60
USDUI_API UsdUIObjectHints(const UsdObject &obj)
Construct a hints object for the given UsdObject obj.
bool operator!=(const UsdUIObjectHints &rhs) const
Inequality operator.
Definition: objectHints.h:124
bool operator==(const UsdUIObjectHints &rhs) const
Equality operator.
Definition: objectHints.h:119
USDUI_API bool GetHidden() const
Return the object's hidden status, indicating whether or not it should be hidden from the UI.
USDUI_API UsdUIObjectHints()
Default constructor that creates an invalid hints object.
USDUI_API std::string GetDisplayName() const
Return the object's display name, indicating how it should appear in the UI.
static USDUI_API TfToken _MakeKeyPath(const TfToken &key1, const TfToken &key2)
Combine key1 and key2 into a single token, separated by the namespace delimiter ':'.
USDUI_API bool SetDisplayName(const std::string &name)
Set the object's display name to name.
USDUI_API bool SetHidden(bool hidden)
Set the object's hidden status to hidden.
UsdObject GetObject() const
Return the object that this hints intance is interpreting.
Definition: objectHints.h:74
Environment setting variable.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:92