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
23#include "pxr/base/tf/token.h"
24
25#include <iosfwd>
26#include <string>
27
28PXR_NAMESPACE_OPEN_SCOPE
29
43{
44 SDF_DECLARE_ABSTRACT_SPEC(SdfPropertySpec, SdfSpec);
45
46public:
50
52 SDF_API
53 const std::string &GetName() const;
54
56 SDF_API
58
64 SDF_API
65 bool CanSetName(const std::string &newName, std::string *whyNot) const;
66
74 SDF_API
75 bool SetName(const std::string &newName, bool validate = true);
76
80 SDF_API
81 static bool IsValidName(const std::string &name);
82
86
88 SDF_API
89 SdfSpecHandle GetOwner() const;
90
94
106 SDF_API
108
121 SDF_API
123
127 SDF_API
128 void SetCustomData(const std::string &name, const VtValue &value);
129
136 SDF_API
137 void SetAssetInfo(const std::string& name, const VtValue& value);
138
142 SDF_API
143 std::string GetDisplayGroup() const;
144
146 SDF_API
147 void SetDisplayGroup(const std::string &value);
148
152 SDF_API
153 std::string GetDisplayName() const;
154
156 SDF_API
157 void SetDisplayName(const std::string &value);
158
162 SDF_API
163 std::string GetDocumentation() const;
164
166 SDF_API
167 void SetDocumentation(const std::string &value);
168
172 SDF_API
173 bool GetHidden() const;
174
176 SDF_API
177 void SetHidden(bool value);
178
182 SDF_API
184
186 SDF_API
188
192 SDF_API
193 std::string GetPrefix() const;
194
196 SDF_API
197 void SetPrefix(const std::string &value);
198
202 SDF_API
203 std::string GetSuffix() const;
204
206 SDF_API
207 void SetSuffix(const std::string &value);
208
212 SDF_API
213 std::string GetSymmetricPeer() const;
214
219 SDF_API
220 void SetSymmetricPeer(const std::string &peerName);
221
225 SDF_API
227
232 SDF_API
233 void SetSymmetryArgument(const std::string &name, const VtValue &value);
234
238 SDF_API
240
245 SDF_API
246 void SetSymmetryFunction(const TfToken &functionName);
247
251
253 SDF_API
255
257 SDF_API
259
264 SDF_API
266
270 SDF_API
272
277 SDF_API
278 bool SetDefaultValue(const VtValue &defaultValue);
279
281 SDF_API
282 bool HasDefaultValue() const;
283
285 SDF_API
287
291
295 SDF_API
296 std::string GetComment() const;
297
299 SDF_API
300 void SetComment(const std::string &value);
301
303 SDF_API
304 bool IsCustom() const;
305
307 SDF_API
308 void SetCustom(bool custom);
309
338 SDF_API
340
352 SDF_API
354
355private:
356 inline TfToken _GetAttributeValueTypeName() const;
357};
358
359PXR_NAMESPACE_CLOSE_SCOPE
360
361#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:43
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 SdfTimeSampleMap GetTimeSampleMap() const
Returns the entire set of time samples.
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:71
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:147
Standard pointer typedefs.
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
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:277