IGH_Structure

References
public interface IGH_Structure
Base interface for all GH_Structure types.

Properties

Branch

#
IList Branch[GH_Path path] { get; }
Gets a limited access pointer to the data list associated with a certain path.
path (GH_Path)Path of data to retrieve.

Branch

#
IList Branch[int index] { get; }
Gets a limited access pointer to the data list at the specified index.
index (int)Index of data to retrieve.

DataCount

#
int DataCount { get; }
Gets the total number of data items stored in all paths.

IsEmpty

#
bool IsEmpty { get; }
Gets the Empty state of the structure. If the structure is Empty when it contains no paths and no branches.

Path

#
GH_Path Path[int index] { get; }
Gets the data path at the specified index.
index (int)Index of path to retrieve.
IndexOutOfRangeExceptionThrown if the index does not represent a valid path.

PathCount

#
int PathCount { get; }
Gets the number of paths defined in this structure.

Paths

#
IList<GH_Path> Paths { get; }
Gets a list of all the paths in this structure.

StructureProxy

#
IList<IList> StructureProxy { get; }
Gets a proxy list of all the data-arrays in this structure

TopologyDescription

#
string TopologyDescription { get; }
Gets a description of the topology of the structure. Useful for debugging purposes.

Methods

AllData

#
IGH_StructureEnumerator AllData(bool skipNulls)
Gets an enumerator for all the data items in this structure.
skipNulls (bool)If True, null items will be skipped.

Clear

#
void Clear()
Clears the entire structure.

ClearData

#
void ClearData()
Removes all data from all paths without affecting the structure topology.

DataDescription

#
string DataDescription(bool includeIndices, bool includePaths)
Gets a description of the data contained in this structure.
includeIndices (bool)If true, every data item will be prefixed by its index.
includePaths (bool)If true, every branch of data will be preceded by the path.
A string describing the data.

EnsureCapacity

#
void EnsureCapacity(int capacity)
Ensures that all branches have a certain capacity
capacity (int)Capacity per branch.

ExpandPath

#
void ExpandPath(GH_Path path, int element, GH_ExpandMode mode)
Expand a path in this structure by appending an element.
path (GH_Path)Path to expand, if the path doesn't exist, nothing will happen.
element (int)Element to append to the path.
mode (GH_ExpandMode)Expansion mode.

Flatten

#
void Flatten(GH_Path path = null)
Flattens the entire structure into a single path.
path (GH_Path = null)The path of the flattened data. If null, the path will be {0}

Graft

#
[EditorBrowsable(EditorBrowsableState.Never)] void Graft(bool clearSingleNulls)
obsoletethis method has been replaced by Graft(GH_GraftMode)
Grafts all paths by reallocating all data into child paths.
clearSingleNulls (bool)If true, nulls will not be grafted.

Graft

#
void Graft(GH_GraftMode mode, GH_Path 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.
mode (GH_GraftMode)Graft mode.
path (GH_Path)Path to graft

Graft

#
void Graft(GH_GraftMode mode)
Grafts all paths by reallocating all data into child paths.
mode (GH_GraftMode)Graft mode.

Graft

#
[EditorBrowsable(EditorBrowsableState.Never)] void Graft(GH_Path path, bool clearSingleNulls)
obsoletethis method has been replaced by 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.
path (GH_Path)Path of data to graft.
clearSingleNulls (bool)If true, nulls will not be grafted.

LongestPathIndex

#
int 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.
The index of the longest path or -1 if there are no paths.

PathExists

#
bool PathExists(GH_Path path)
Returns True if the specified path is already defined inside the structure.
path (GH_Path)The data path to search for

PathIndex

#
void PathIndex(GH_Path path, ref int idx0, ref int idx1)
Find the indices that delineate the given path domain.
path (GH_Path)Path to search for (it need not exist in the structure).
idx0 (ref int)The index of the path itself or the first smaller path if the path is not defined.
idx1 (ref int)The index of the path itself of the first larger path if the path is not defined.

RemovePath

#
void RemovePath(GH_Path path)
Removes a path and all associated data from the structure. If the path doesn't exist, nothing will happen.
path (GH_Path)Path the remove.

ReplacePath

#
void ReplacePath(GH_Path find, GH_Path replace)
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.
find (GH_Path)The path to search for.
replace (GH_Path)The new path.

ShortestPathIndex

#
int 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.
The index of the shortest path or -1 if there are no paths.

Simplify

#
void Simplify(GH_SimplificationMode mode)
Simplify the data structure by removing path indices shared by all branches.
mode (GH_SimplificationMode)Simplification algorithm to use.

TrimExcess

#
void TrimExcess()
Trims the excess allocated memory in all branches