MetaData
ReferencesRepresents an unbounded collection of meta data.
Constructors
Properties
Indexers
Methods
Add
#Add a byte array. This method will duplicate the array, as internally it is stored as an ImmutableArray.
Add
#Add a double precision floating point value.
Add
#Add a globally unique identifier value.
Add
#Add a Transformation matrix value.
Compare
#Perform sort comparison on two blobs of meta data.
ContainsName
#Determines whether this data contains an element with the specified name.
Returns: True if the name exists within this data.
DebugData
#Create a meta data palette containing all supported data types. This is handy for debugging purposes.
Returns: Custom data filled with debug entries.
DebugDataSmall
#Create a meta data palette containing only system types. This is handy for debugging purposes.
Returns: Custom data filled with debug entries.
Equals
#Compare two meta data values for equality.
FindCommonData
#Find all non-conflicting meta data in a collection.
FindCommonData
#Find all non-conflicting meta data in an indexed array of pears.
FindCommonData
#Find all non-conflicting meta data in an indexed collection.
FindCommonData
#Find all non-conflicting meta data in a twig by index.
Get<T>
#Gets the value with the given or alternate name. This overload makes it easier to check for names which may have different spellings, such as Color/Colour, or Neighbor/Neighbour.
Returns: True if value was found, false if name is undefined or if the type doesn't match.
Get<T>
#Gets the value with the given name. If the name is defined but associated with a value type other than T, a widening conversion will be performed if possible.
Returns: True if value was found, false if name is undefined or if the type doesn't match.
GetNamesAndValues
#Get two string arrays describing both the names and the values.
GetNamesAndValues
#Get two string arrays describing both the names and the values.
Matches
#Tests whether any of the names matches any of the patterns.
Returns: True if at least a single name can be matched up to one of the patterns.
Merge
#Merged multiple metas data collections into a single meta data.
public static MetaData Merge()
behaviour,
Merge behaviour.
conflicts,
If not null, unmerged conflicting names will be appended here.
metaData
Meta data to merge.
Returns: Merged data.
Merge
#Merged multiple metas data collections into a single meta data.
Returns: Merged data.
Merge
#Merge all data from another MetaData instance.
Merge
#Merge all data from another MetaData instance.
public MetaData Merge()
other,
MetaData to merge from.
mergeBehaviour,
Behaviour for colliding names.
conflicts
List of conflicting values that couldn't be merged.
Remove
#Remove entries with the specified names.
Returns: Modified metadata. This method returns null if the removed entry was the last remaining one.
RemovePattern
#Remove all entries which match the specified wildcard pattern.
Returns: The number of entries removed.
RemoveTransient
#Remove all transient values from this metadata.
public MetaData RemoveTransient()
removeTransient = true,
If true, all entries marked as MetaName.IsTransient are removed.
removeRhinoId = false,
If true, Rhino.Id entries are removed as well.
removeUserText = false
If true, Record.UserText entries are removed as well.
Rename
#Rename one of the entries in this metadata. If there is already an entry with the 'replace' name, it will be overwritten.
ToString
#Returns a string representing the meta data.
Returns: A string that represents the current data.
Overrides: Object.ToString
Transform
#Deform this meta data. Note that this is much less well defined than linear transforms. We'll do the best we can, but sometimes meta data simply cannot be deformed correctly. Only points and planes can be deformed as they have a location in space.
Returns: Deformed data.
TransformableNames
#Gets all transformable names. These names represent items which will be affected when this data is transformed using a 4x4 matrix.
Returns: Enumeration of all transformable names.
Validate
#Validate a bunch of meta data using the currently known rules. Plugins may supply their own rules so the behaviour of this method depends on the state of the loaded plugins. As a result, no action should be taken based on the return value of this method, it is meant purely to provide interface feedback, nothing more.
Returns: True if data is valid, false otherwise.
Events
ValidationRequired
#A static event used for testing meta data validity. Handle this event if you wish to flag warnings when the wrong kind of data or the wrong kind of value is associated with a name you care about.
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| MetaData | + | MetaData | MetaData | Merge two metadata instances. This operator correctly handles null instances. In the case of conflicting entries, the left hand instance wins. |
| MetaData | + | (MetaName name, MetaValue value) | MetaData | Merge two metadata instances. This operator correctly handles null instances. In the case of conflicting entries, the left hand instance wins. |
| MetaData | - | MetaName | MetaData | |