Loading...
Searching...
No Matches
propertySpec.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_SDF_PROPERTY_SPEC_H
8#define PXR_USD_SDF_PROPERTY_SPEC_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/declareSpec.h"
15#include "pxr/usd/sdf/spec.h"
17#include "pxr/usd/sdf/proxyTypes.h"
18#include "pxr/usd/sdf/types.h"
19
20#include "pxr/base/vt/value.h"
21
24#include "pxr/base/tf/token.h"
25
26#include <iosfwd>
27#include <string>
28
29PXR_NAMESPACE_OPEN_SCOPE
30
31SDF_API
32extern TfEnvSetting<bool> SDF_LEGACY_UI_HINTS_WARN_ON_WRITE;
33
47{
48 SDF_DECLARE_ABSTRACT_SPEC(SdfPropertySpec, SdfSpec);
49
50public:
54
56 SDF_API
57 const std::string &GetName() const;
58
60 SDF_API
62
68 SDF_API
69 bool CanSetName(const std::string &newName, std::string *whyNot) const;
70
78 SDF_API
79 bool SetName(const std::string &newName, bool validate = true);
80
84 SDF_API
85 static bool IsValidName(const std::string &name);
86
90
92 SDF_API
93 SdfSpecHandle GetOwner() const;
94
98
110 SDF_API
112
125 SDF_API
127
131 SDF_API
132 void SetCustomData(const std::string &name, const VtValue &value);
133
140 SDF_API
141 void SetAssetInfo(const std::string& name, const VtValue& value);
142
149 SDF_API
150 std::string GetDisplayGroup() const;
151
156 SDF_API
157 void SetDisplayGroup(const std::string &value);
158
165 SDF_API
166 std::string GetDisplayName() const;
167
172 SDF_API
173 void SetDisplayName(const std::string &value);
174
178 SDF_API
179 std::string GetDocumentation() const;
180
182 SDF_API
183 void SetDocumentation(const std::string &value);
184
191 SDF_API
192 bool GetHidden() const;
193
198 SDF_API
199 void SetHidden(bool value);
200
204 SDF_API
206
208 SDF_API
210
214 SDF_API
215 std::string GetPrefix() const;
216
218 SDF_API
219 void SetPrefix(const std::string &value);
220
224 SDF_API
225 std::string GetSuffix() const;
226
228 SDF_API
229 void SetSuffix(const std::string &value);
230
234 SDF_API
235 std::string GetSymmetricPeer() const;
236
241 SDF_API
242 void SetSymmetricPeer(const std::string &peerName);
243
247 SDF_API
249
254 SDF_API
255 void SetSymmetryArgument(const std::string &name, const VtValue &value);
256
260 SDF_API
262
267 SDF_API
268 void SetSymmetryFunction(const TfToken &functionName);
269
273
275 SDF_API
277
282 SDF_API
284
288 SDF_API
290
295 SDF_API
296 bool SetDefaultValue(const VtValue &defaultValue);
297
299 SDF_API
300 bool HasDefaultValue() const;
301
303 SDF_API
305
309
313 SDF_API
314 std::string GetComment() const;
315
317 SDF_API
318 void SetComment(const std::string &value);
319
321 SDF_API
322 bool IsCustom() const;
323
325 SDF_API
326 void SetCustom(bool custom);
327
356 SDF_API
358
370 SDF_API
372
373private:
374 inline TfToken _GetAttributeValueTypeName() const;
375};
376
377PXR_NAMESPACE_CLOSE_SCOPE
378
379#endif // #ifndef PXR_USD_SDF_PROPERTY_SPEC_H
A proxy for editing map-like values.
Definition: mapEditProxy.h:101
Base class for SdfAttributeSpec and SdfRelationshipSpec.
Definition: propertySpec.h:47
SDF_API std::string GetDisplayGroup() const
Returns the displayGroup string for this property spec.
SDF_API void SetDocumentation(const std::string &value)
Sets the documentation string for this property spec.
SDF_API void ClearDefaultValue()
Clear the attribute's default value.
SDF_API TfType GetValueType() const
Returns the TfType representing the value type this property holds.
SDF_API TfToken GetNameToken() const
Returns the property's name, as a token.
SDF_API void SetHidden(bool value)
Sets whether this property spec will be hidden in browsers.
SDF_API bool IsCustom() const
Returns true if this spec declares a custom property.
SDF_API void SetAssetInfo(const std::string &name, const VtValue &value)
Sets a asset info entry for this property.
SDF_API void SetSymmetryArgument(const std::string &name, const VtValue &value)
Sets a property symmetry argument.
SDF_API void SetSymmetryFunction(const TfToken &functionName)
Sets the property's symmetry function.
SDF_API TfToken GetSymmetryFunction() const
Returns the property's symmetry function.
SDF_API SdfPermission GetPermission() const
Returns the property's permission restriction.
SDF_API std::string GetDocumentation() const
Returns the documentation string for this property spec.
SDF_API void SetPrefix(const std::string &value)
Sets the prefix string for this property spec.
SDF_API VtValue GetDefaultValue() const
Returns the attribute's default value.
SDF_API SdfSpecHandle GetOwner() const
Returns the owner prim or relationship of this property.
SDF_API SdfVariability GetVariability() const
Returns the variability of the property.
SDF_API bool GetHidden() const
Returns whether this property spec will be hidden in browsers.
SDF_API SdfDictionaryProxy GetSymmetryArguments() const
Returns the property's symmetry arguments.
SDF_API SdfValueTypeName GetTypeName() const
Returns the name of the value type that this property holds.
SDF_API const std::string & GetName() const
Returns the property's name.
SDF_API bool CanSetName(const std::string &newName, std::string *whyNot) const
Returns true if setting the property spec's name to newName will succeed.
SDF_API void SetPermission(SdfPermission value)
Sets the property's permission restriction.
SDF_API void SetCustom(bool custom)
Sets whether this spec declares a custom property.
SDF_API void SetCustomData(const std::string &name, const VtValue &value)
Sets a property custom data entry.
SDF_API bool SetDefaultValue(const VtValue &defaultValue)
Sets the attribute's default value.
SDF_API void SetComment(const std::string &value)
Sets the comment string for this property spec.
SDF_API std::string GetComment() const
Returns the comment string for this property spec.
SDF_API bool SetName(const std::string &newName, bool validate=true)
Sets the property's name.
SDF_API void SetDisplayGroup(const std::string &value)
Sets the displayGroup string for this property spec.
SDF_API std::string GetPrefix() const
Returns the prefix string for this property spec.
SDF_API bool HasDefaultValue() const
Returns true if a default value is set for this attribute.
SDF_API void SetDisplayName(const std::string &value)
Sets the displayName string for this property spec.
static SDF_API bool IsValidName(const std::string &name)
Returns true if the given name is considered a valid name for a property.
SDF_API std::string GetSuffix() const
Returns the suffix string for this property spec.
SDF_API void SetSuffix(const std::string &value)
Sets the suffix string for this property spec.
SDF_API std::string GetDisplayName() const
Returns the displayName string for this property spec.
SDF_API SdfDictionaryProxy GetAssetInfo() const
Returns the asset info dictionary for this property.
SDF_API bool HasOnlyRequiredFields() const
Returns true if this PropertySpec has no significant data other than just what is necessary for insta...
SDF_API SdfDictionaryProxy GetCustomData() const
Returns the property's custom data.
SDF_API void SetSymmetricPeer(const std::string &peerName)
Sets the property's symmetric peer.
SDF_API std::string GetSymmetricPeer() const
Returns the property's symmetric peer.
Base class for all Sdf spec classes.
Definition: spec.h:33
Represents a value type name, i.e.
Definition: valueTypeName.h:72
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
TfType represents a dynamic runtime type.
Definition: type.h:48
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
Standard pointer typedefs.
Environment setting variable.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
Basic Sdf data types.
SdfVariability
An enum that identifies variability types for attributes.
Definition: types.h:156
SdfPermission
An enum that defines permission levels.
Definition: types.h:132