C# Класс MapAround.Geometry.MonotoneChain

Represents a monotone chain of segments. All segments in chain are placed in single quadrant Monotone chain segments are used to avoid a large number of segments intersection checks.
Наследование: IIndexable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BoundsContainPoint ( ICoordinate point ) : bool

Determines whether the bounding rectangle of this monotone chain contains point.

BoundsIntersect ( MonotoneChain chain ) : bool

Determines whether the bounding rectangle of this chain intersects the bounding rectangle of specified chain.

Clone ( ) : object

Creates a new object that is a copy of the current instance.

CrossesWith ( MonotoneChain chain ) : bool

Determines whether this chain crosses with other.

GetCrossPoints ( MonotoneChain chain ) : List

Calculates the intersection points of two chains.

GetCrossSegments ( MonotoneChain chain ) : List

Computes the 2D intersections of two chains.

GetSegmentOrientation ( Segment segment ) : Orientation

Computes an orientation of specified segment.

InsertSegment ( Segment segment ) : bool

Adds a segment to the chain.

InsertSegment ( Segment segment, SegmentLabel label ) : bool

Adds a segment to the chain.

IsPointInSegmentsBounds ( ICoordinate point ) : bool

Defines if a specified point lies into the bounding rectangle of any segment of chain.

MonotoneChain ( Orientation orientation ) : System

Initializes a new instance of MonotoneChain.

MonotoneChain ( Segment segment ) : System

Initializes a new instance of MonotoneChain.

MonotoneChain ( Segment segment, SegmentLabel tag ) : System

Initializes a new instance of MonotoneChain.

ReduceSegments ( double minLength ) : void

Removes all segments from chain which length is less than specified. The remaining segments are connected.

ReplaceLabel ( int index, SegmentLabel newValue ) : void

Replaces the label associated with segment having specified index in the chain.

Split ( List list ) : bool

Splits the segments of the chain at the specified points.

Приватные методы

Метод Описание
boundsChanged ( ) : void
checkSegment ( Segment segment ) : bool
getSubChainBounds ( int index1, int index2 ) : BoundingRectangle
internalInsertSegment ( Segment segment, SegmentLabel tag ) : void
isPointInSegmentsBounds ( ICoordinate point, int minIndex, int maxIndex ) : bool

Описание методов

BoundsContainPoint() публичный Метод

Determines whether the bounding rectangle of this monotone chain contains point.
public BoundsContainPoint ( ICoordinate point ) : bool
point ICoordinate Point coordinate
Результат bool

BoundsIntersect() публичный Метод

Determines whether the bounding rectangle of this chain intersects the bounding rectangle of specified chain.
public BoundsIntersect ( MonotoneChain chain ) : bool
chain MonotoneChain Monotone chain
Результат bool

Clone() публичный Метод

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
Результат object

CrossesWith() публичный Метод

Determines whether this chain crosses with other.
public CrossesWith ( MonotoneChain chain ) : bool
chain MonotoneChain Chain
Результат bool

GetCrossPoints() публичный Метод

Calculates the intersection points of two chains.
public GetCrossPoints ( MonotoneChain chain ) : List
chain MonotoneChain Monotone chain
Результат List

GetCrossSegments() публичный Метод

Computes the 2D intersections of two chains.
public GetCrossSegments ( MonotoneChain chain ) : List
chain MonotoneChain Monotone chain
Результат List

GetSegmentOrientation() публичный статический Метод

Computes an orientation of specified segment.
public static GetSegmentOrientation ( Segment segment ) : Orientation
segment Segment Segment to compute orientation
Результат Orientation

InsertSegment() публичный Метод

Adds a segment to the chain.
public InsertSegment ( Segment segment ) : bool
segment Segment The segment to add
Результат bool

InsertSegment() публичный Метод

Adds a segment to the chain.
public InsertSegment ( Segment segment, SegmentLabel label ) : bool
segment Segment The segment to add
label SegmentLabel The label of the segment
Результат bool

IsPointInSegmentsBounds() публичный Метод

Defines if a specified point lies into the bounding rectangle of any segment of chain.
public IsPointInSegmentsBounds ( ICoordinate point ) : bool
point ICoordinate Coordinate of point
Результат bool

MonotoneChain() публичный Метод

Initializes a new instance of MonotoneChain.
public MonotoneChain ( Orientation orientation ) : System
orientation Orientation Orientation of segments
Результат System

MonotoneChain() публичный Метод

Initializes a new instance of MonotoneChain.
public MonotoneChain ( Segment segment ) : System
segment Segment An initial segment
Результат System

MonotoneChain() публичный Метод

Initializes a new instance of MonotoneChain.
public MonotoneChain ( Segment segment, SegmentLabel tag ) : System
segment Segment An initial segment
tag SegmentLabel A label of initial segment
Результат System

ReduceSegments() публичный Метод

Removes all segments from chain which length is less than specified. The remaining segments are connected.
public ReduceSegments ( double minLength ) : void
minLength double The minimum length of segment
Результат void

ReplaceLabel() публичный Метод

Replaces the label associated with segment having specified index in the chain.
public ReplaceLabel ( int index, SegmentLabel newValue ) : void
index int The index of segment in the chain
newValue SegmentLabel Instance of label
Результат void

Split() публичный Метод

Splits the segments of the chain at the specified points.
public Split ( List list ) : bool
list List A list contatinig points where you need to split the chain
Результат bool