GH_StructureT Class |
Namespace: Grasshopper.Kernel.Data
public class GH_Structure<T> : IGH_Structure, IEnumerable<T>, GH_ISerializable where T : IGH_Goo
The GH_StructureT type exposes the following members.
Name | Description | |
---|---|---|
GH_StructureT |
Default constructor, create a blank data structure.
| |
GH_StructureT(GH_StructureT, Boolean) |
Copy constructor, duplicate another data structure.
|
Name | Description | |
---|---|---|
BranchGH_Path |
Gets a limited access pointer to the data list associated with a certain path.
| |
BranchInt32 |
Gets a limited access pointer to the data list at the specified index
| |
Branches |
Gets a list of all the data-arrays in this structure
| |
DataCount |
Gets the total number of data items stored in all paths.
| |
DataItemInt32 |
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.
| |
DataItemGH_Path, Int32 |
Gets a direct pointer to a data item under a specific path and index.
| |
DataListGH_Path |
Gets a direct pointer to the list of data under a specific path.
| |
DataListInt32 |
Gets a direct pointer to the list of data under the specified index.
| |
FirstItem |
Gets the first item in the structure.
If no such item exists, null is returned.
| |
IsEmpty |
Gets the Empty state of the structure. If the structure is Empty it contains no paths and no branches.
| |
LastItem |
Gets the last item in the structure.
If no such item exists, null is returned.
| |
NonNulls |
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.
| |
Path |
Gets the data path at the specified index.
| |
PathCount |
Gets the number of paths defined in this structure.
| |
Paths |
Gets a list of all the paths in this structure.
| |
StructureProxy |
Gets a proxy list of all the data-arrays in this structure.
| |
TopologyDescription |
Gets a description of the topology of the structure.
Useful for debugging purposes.
|
Name | Description | |
---|---|---|
AllData |
Gets an enumerator for all the data items in this structure.
| |
Append(T) |
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}]
| |
Append(T, GH_Path) |
Append a data item to the specified branch in the structure.
If the branch doesn't exist yet, it will be created.
| |
AppendRange(IEnumerableT) |
Append a list of data items to the last branch in the structure
| |
AppendRange(IEnumerableT, GH_Path) |
Append a list of data items to the specified branch in the structure.
If the branch doesn't exist yet, it will be created.
| |
Clear |
Clears the entire structure.
| |
ClearData |
Removes all data from all paths without affecting the structure topology.
| |
DataDescription |
Gets a description of the data contained in this structure.
| |
Duplicate |
Create an exact duplicate of this structure. All data items are copied as well.
| |
DuplicateCastQ |
Create a duplicate of this structure in a different type.
| |
EnsureCapacity |
Ensures that all current branches have a certain capacity.
| |
EnsurePath(GH_Path) |
Create a new branch with the specified path if it doesn't already exists.
| |
EnsurePath(Int32) |
Create a new branch with the specified path if it doesn't already exists.
| |
ExpandPath |
Expand a path in this structure by appending an element.
| |
Flatten |
Flattens the entire structure into a single path.
| |
FlattenData |
Collects all data in the structure under a single list.
Does not alter the state of this structure.
| |
GetEnumerator | ||
GetEnumerator_Generic | ||
Graft(GH_GraftMode) |
Grafts all paths by reallocating all data into child paths.
| |
Graft(GH_GraftMode, GH_Path) |
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.
| |
Insert |
Insert a data item into the specified branch in the structure.
If the branch doesn't exist yet, it will be created.
| |
LongestPathIndex |
Finds the path in this structure with the most dimensions.
In case of multiple equally long longest paths, the last one
will be returned.
| |
MergeStructure |
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.
| |
PathExists |
Returns True if the specified path is already defined inside the structure.
| |
PathIndex |
Find the indices that surround the given path domain. Indices may be out of bounds.
| |
Read |
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.
| |
RemoveData |
Removes the first occurence of a data instance in the tree.
| |
RemovePath |
Removes a path and all associated data from the structure.
If the path doesn't exist, nothing will happen.
| |
ReplacePath |
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.
| |
Reverse |
Reverse the order of items in all branches.
| |
ShallowDuplicate |
Create a structure with a similar topology to this one with pointers to the same data items.
| |
ShortestPathIndex |
Finds the path in this structure with the least dimensions.
In case of multiple equally long longest paths, the first one
will be returned.
| |
Simplify |
Simplify the data structure by collapsing path indices shared by all branches.
| |
ToString | (Overrides ObjectToString.) | |
TrimExcess |
Trims the excess allocated memory in all branches.
| |
Write |
Write the entire GH_Structure to an archive.
This method relies on the the serialization of the IGH_Goo items it contains.
|