HDK
|
#include <property.h>
Public Member Functions | |
NDR_API | NdrProperty (const TfToken &name, const TfToken &type, const VtValue &defaultValue, bool isOutput, size_t arraySize, bool isDynamicArray, const NdrTokenMap &metadata) |
Constructor. More... | |
virtual NDR_API | ~NdrProperty () |
Destructor. More... | |
The Basics | |
NDR_API const TfToken & | GetName () const |
Gets the name of the property. More... | |
NDR_API const TfToken & | GetType () const |
Gets the type of the property. More... | |
NDR_API const VtValue & | GetDefaultValue () const |
NDR_API bool | IsOutput () const |
Whether this property is an output. More... | |
NDR_API bool | IsArray () const |
Whether this property's type is an array type. More... | |
NDR_API bool | IsDynamicArray () const |
Whether this property's array type is dynamically-sized. More... | |
NDR_API int | GetArraySize () const |
virtual NDR_API std::string | GetInfoString () const |
Metadata | |
The metadata returned here is a direct result of what the parser plugin is able to determine about the node. See the documentation for a specific parser plugin to get help on what the parser is looking for to populate these values. | |
virtual NDR_API const NdrTokenMap & | GetMetadata () const |
All of the metadata that came from the parse process. More... | |
Connection Information | |
virtual NDR_API bool | IsConnectable () const |
Whether this property can be connected to other properties. More... | |
virtual NDR_API bool | CanConnectTo (const NdrProperty &other) const |
Determines if this property can be connected to the specified property. More... | |
Utilities | |
virtual NDR_API const NdrSdfTypeIndicator | GetTypeAsSdfType () const |
virtual NDR_API const VtValue & | GetDefaultValueAsSdfType () const |
Protected Member Functions | |
NdrProperty & | operator= (const NdrProperty &)=delete |
Protected Attributes | |
TfToken | _name |
TfToken | _type |
VtValue | _defaultValue |
bool | _isOutput |
size_t | _arraySize |
bool | _isDynamicArray |
bool | _isConnectable |
NdrTokenMap | _metadata |
Represents a property (input or output) that is part of a NdrNode
instance.
A property must have a name and type, but may also specify a host of additional metadata. Instances can also be queried to determine if another NdrProperty
instance can be connected to it.
In almost all cases, this class will not be used directly. More specialized properties can be created that derive from NdrProperty
; those specialized properties can add their own domain-specific data and methods.
Definition at line 50 of file property.h.
NDR_API NdrProperty::NdrProperty | ( | const TfToken & | name, |
const TfToken & | type, | ||
const VtValue & | defaultValue, | ||
bool | isOutput, | ||
size_t | arraySize, | ||
bool | isDynamicArray, | ||
const NdrTokenMap & | metadata | ||
) |
Constructor.
|
virtual |
Destructor.
|
virtual |
Determines if this property can be connected to the specified property.
Reimplemented in SdrShaderProperty.
Gets this property's array size.
If this property is a fixed-size array type, the array size is returned. In the case of a dynamically-sized array, this method returns the array size that the parser reports, and should not be relied upon to be accurate. A parser may report -1 for the array size, for example, to indicate a dynamically-sized array. For types that are not a fixed-size array or dynamic array, this returns 0.
Definition at line 108 of file property.h.
Gets this property's default value associated with the type of the property.
Definition at line 85 of file property.h.
Provides default value corresponding to the SdfValueTypeName returned by GetTypeAsSdfType.
Derived classes providing an implementation for GetTypeAsSdfType should also provide an implementation for this.
Reimplemented in SdrShaderProperty.
|
virtual |
Gets a string with basic information about this property. Helpful for things like adding this property to a log.
|
inlinevirtual |
All of the metadata that came from the parse process.
Definition at line 127 of file property.h.
Gets the name of the property.
Definition at line 74 of file property.h.
Gets the type of the property.
Definition at line 78 of file property.h.
|
virtual |
Converts the property's type from GetType()
into a SdfValueTypeName
.
Two scenarios can result: an exact mapping from property type to Sdf type, and an inexact mapping. In the first scenario, the first element in the pair will be the cleanly-mapped Sdf type, and the second element, a TfToken, will be empty. In the second scenario, the Sdf type will be set to Token
to indicate an unclean mapping, and the second element will be set to the original type returned by GetType()
.
This base property class is generic and cannot know ahead of time how to perform this mapping reliably, thus it will always fall into the second scenario. It is up to specialized properties to perform the mapping.
Reimplemented in SdrShaderProperty.
|
inline |
Whether this property's type is an array type.
Definition at line 93 of file property.h.
|
virtual |
Whether this property can be connected to other properties.
Reimplemented in SdrShaderProperty.
|
inline |
Whether this property's array type is dynamically-sized.
Definition at line 97 of file property.h.
|
inline |
Whether this property is an output.
Definition at line 89 of file property.h.
|
protecteddelete |
|
protected |
Definition at line 185 of file property.h.
|
protected |
Definition at line 183 of file property.h.
|
protected |
Definition at line 187 of file property.h.
|
protected |
Definition at line 186 of file property.h.
|
protected |
Definition at line 184 of file property.h.
|
protected |
Definition at line 188 of file property.h.
|
protected |
Definition at line 181 of file property.h.
|
protected |
Definition at line 182 of file property.h.