Skip to content

GH_Structure.T.

Public Class

Represents a data tree where each branch has a unique path

Inheritance Hierarchy

System.Object
Grasshopper.Kernel.Data.GH_Structure.T.

Namespace: Grasshopper.Kernel.Data

Assembly: Grasshopper (in Grasshopper.dll)

Syntax

public class GH_Structure<T> : IGH_Structure,
IEnumerable<T>, GH_ISerializable
where T : IGH_Goo

T

The data type that this structure maintains. Must implement IGH_Goo or derive from a class that implements IGH_Goo.

The GH_Structure.T. type exposes the following members.

Constructors

Name

Description


Public Method

Default constructor, create a blank data structure.


Public Method

Copy constructor, duplicate another data structure.


Properties

Name

Description


Public Property

Gets a limited access pointer to the data list associated with a certain path.


Public Property

Gets a limited access pointer to the data list at the specified index


Public Property

Gets a list of all the data-arrays in this structure


Public Property

Gets the total number of data items stored in all paths.


Public Property

Gets the item at a given offset. The structure is treated as a linear list in this case. If index is out of range, null is returned. For repeated indexed retrieval, consider using a For Each loop since the enumerator is more efficient.


Public Property

Gets a direct pointer to a data item under a specific path and index.


Public Property

Gets a direct pointer to the list of data under a specific path.


Public Property

Gets a direct pointer to the list of data under the specified index.


Public Property

Gets the first item in the structure. If no such item exists, null is returned.


Public Property

Gets the Empty state of the structure. If the structure is Empty it contains no paths and no branches.


Public Property

Gets the last item in the structure. If no such item exists, null is returned.


Public Property

Get an enumerator for this structure that allow linear iteration over the data hierarchy while skipping all Null entries. This Enumerator has been optimized, do not cache instances of it.


Public Property

Gets the data path at the specified index.


Public Property

Gets the number of paths defined in this structure.


Public Property

Gets a list of all the paths in this structure.


Public Property

Gets a proxy list of all the data-arrays in this structure.


Public Property

Gets a description of the topology of the structure. Useful for debugging purposes.


Methods

Name

Description


Public Method

Gets an enumerator for all the data items in this structure.


Public Method

Append a data item to the last branch in the structure. If no branch exist yet, a new one will be created with [path = {0}]


Public Method

Append a data item to the specified branch in the structure. If the branch doesn’t exist yet, it will be created.


Public Method

Append a list of data items to the last branch in the structure


Public Method

Append a list of data items to the specified branch in the structure. If the branch doesn’t exist yet, it will be created.


Public Method

Clears the entire structure.


Public Method

Removes all data from all paths without affecting the structure topology.


Public Method

Gets a description of the data contained in this structure.


Public Method

Create an exact duplicate of this structure. All data items are copied as well.


Public Method

Create a duplicate of this structure in a different type.


Public Method

Ensures that all current branches have a certain capacity.


Public Method

Create a new branch with the specified path if it doesn’t already exists.


Public Method

Create a new branch with the specified path if it doesn’t already exists.


Public Method

Expand a path in this structure by appending an element.


Public Method

Flattens the entire structure into a single path.


Public Method

Collects all data in the structure under a single list. Does not alter the state of this structure.


Public Method

Public Method

Public Method

Grafts all paths by reallocating all data into child paths.


Public Method

Grafts a specific path by reallocating all data into child paths. If a grafted path coincides with an existing path, the data item in question will be appended to the existing path.


Public Method

Insert a data item into the specified branch in the structure. If the branch doesn’t exist yet, it will be created.


Public Method

Finds the path in this structure with the most dimensions. In case of multiple equally long longest paths, the last one will be returned.


Public Method

Merges two structures together. Data inside similar paths will be merged into single lists and unique paths will be appended. The other structure will not be altered, so beware that data is now shared among both structures.


Public Method

Returns True if the specified path is already defined inside the structure.


Public Method

Find the indices that surround the given path domain. Indices may be out of bounds.


Public Method

Read the entire GH_Structure from an archive. This method relies on the the serialization of the IGH_Goo items it contains. Also, the IGH_Goo T generic must have a public constructor that takes no arguments.


Public Method

Removes the first occurence of a data instance in the tree.


Public Method

Removes a path and all associated data from the structure. If the path doesn’t exist, nothing will happen.


Public Method

Replace an existing path with a different one. If the operation is successfull, then the ‘find’ path will be deleted. If the ‘replace’ path is already defined, the items in ‘find’ will be appended to the existing path.


Public Method

Reverse the order of items in all branches.


Public Method

Create a structure with a similar topology to this one with pointers to the same data items.


Public Method

Finds the path in this structure with the least dimensions. In case of multiple equally long longest paths, the first one will be returned.


Public Method

Simplify the data structure by collapsing path indices shared by all branches.


Public Method

(Overrides Object.ToString..)


Public Method

Trims the excess allocated memory in all branches.


Public Method

Write the entire GH_Structure to an archive. This method relies on the the serialization of the IGH_Goo items it contains.