GH_IndexRange

References
Represents a range of indices.

Constructors

GH_IndexRange

#
public GH_IndexRange(int index)
Create a new singular range.
index (int)Index of range start and end.

GH_IndexRange

#
public GH_IndexRange(int index0, int index1)
Create a new range.
index0 (int)First index in range.
index1 (int)Last index in range.

Properties

Index0

#
public int Index0 { get; }
Gets the first index in the range.

Index1

#
public int Index1 { get; }
Gets the last index in the range.

InvalidRange

#
public static GH_IndexRange InvalidRange { get; }
Gets the predefined invalid range.

IsSingular

#
public bool IsSingular { get; }
Gets whether the range has zero length.

IsValid

#
public bool IsValid { get; }
Gets whether this range is valid.

Length

#
public int Length { get; }
Gets the length of the range.

MaxValue

#
public static GH_IndexRange MaxValue { get; }

Methods

AdjacentTo

#
public bool AdjacentTo(GH_IndexRange range)
Tests whether this range is adjacent to another.
range (GH_IndexRange)Range to test.
True if the ranges are adjacent and not intersecting.

Contains

#
public bool Contains(GH_IndexRange range)
Tests whether a specified range is entirely contained within this range.
range (GH_IndexRange)Range to test.
True if the range is inside this one.

Contains

#
public bool Contains(int index)
Tests whether a specified index is defined by this range.
index (int)Index to test.
True if the index is inside this range.

Intersection

#
public static GH_IndexRange Intersection(GH_IndexRange range0, GH_IndexRange range1)
Create the intersection between two ranges.
range0 (GH_IndexRange)First range to intersect.
range1 (GH_IndexRange)Second range to intersect.
The intersection or an invalid range if the input doesn't intersect.

IntersectsWith

#
public bool IntersectsWith(GH_IndexRange range)
Tests whether certain indices are described by both this and another range.
range (GH_IndexRange)Range to intersect with.
True if the ranges intersect.

Read

#
reader (GH_IReader)
Read

Split

#
public static int Split(GH_IndexRange range, GH_IndexRange splitter, ref GH_IndexRange result0, ref GH_IndexRange result1)
Split a range into two using an integer index.
range (GH_IndexRange)Range to split.
splitter (GH_IndexRange)Range to split with.
result0 (ref GH_IndexRange)First split result if successful, or an invalid range if not.
result1 (ref GH_IndexRange)Second split result if successful, or an invalid range if not.
The number of valid split results.

ToString

#
public override string ToString()

Union

#
public static GH_IndexRange Union(GH_IndexRange range0, GH_IndexRange range1)
Create a range which contains both input ranges.
range0 (GH_IndexRange)
range1 (GH_IndexRange)
Smallest range big enough to contain both range0 and range1.

Write

#
[EditorBrowsable(EditorBrowsableState.Never)] public bool Write(GH_IWriter writer)
writer (GH_IWriter)
Write