C# Class 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.
Inheritance: IIndexable
ファイルを表示 Open project: gkrsu/maparound.core Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
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

Method Details

BoundsContainPoint() public method

Determines whether the bounding rectangle of this monotone chain contains point.
public BoundsContainPoint ( ICoordinate point ) : bool
point ICoordinate Point coordinate
return bool

BoundsIntersect() public method

Determines whether the bounding rectangle of this chain intersects the bounding rectangle of specified chain.
public BoundsIntersect ( MonotoneChain chain ) : bool
chain MonotoneChain Monotone chain
return bool

Clone() public method

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
return object

CrossesWith() public method

Determines whether this chain crosses with other.
public CrossesWith ( MonotoneChain chain ) : bool
chain MonotoneChain Chain
return bool

GetCrossPoints() public method

Calculates the intersection points of two chains.
public GetCrossPoints ( MonotoneChain chain ) : List
chain MonotoneChain Monotone chain
return List

GetCrossSegments() public method

Computes the 2D intersections of two chains.
public GetCrossSegments ( MonotoneChain chain ) : List
chain MonotoneChain Monotone chain
return List

GetSegmentOrientation() public static method

Computes an orientation of specified segment.
public static GetSegmentOrientation ( Segment segment ) : Orientation
segment Segment Segment to compute orientation
return Orientation

InsertSegment() public method

Adds a segment to the chain.
public InsertSegment ( Segment segment ) : bool
segment Segment The segment to add
return bool

InsertSegment() public method

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
return bool

IsPointInSegmentsBounds() public method

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
return bool

MonotoneChain() public method

Initializes a new instance of MonotoneChain.
public MonotoneChain ( Orientation orientation ) : System
orientation Orientation Orientation of segments
return System

MonotoneChain() public method

Initializes a new instance of MonotoneChain.
public MonotoneChain ( Segment segment ) : System
segment Segment An initial segment
return System

MonotoneChain() public method

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
return System

ReduceSegments() public method

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
return void

ReplaceLabel() public method

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
return void

Split() public method

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
return bool