C# Class MapAround.Geometry.PlanarGraph

Represents a graph embedded into 2D plane. Planar graph is used in plenty of spatial operations such as overlay or Clementini operators.
Show file Open project: gkrsu/maparound.core Class Usage Examples

Public Methods

Method Description
Build ( IGeometry geometry1, IGeometry geometry2 ) : PlanarGraph

Builds a planar graph of two geometries.

BuildFaces ( IList &redundantSegments ) : List

Builds all faces.

BuildPoints ( ) : List

Builds a points from graph nodes.

BuildPolygon ( bool markObject1EdgesOrientation, bool markObject2EdgesOrientation ) : Polygon

Builds a polygon from graph edges.

BuildPolyline ( bool markObject1EdgesOrientation, bool markObject2EdgesOrientation ) : Polyline

Builds a polyline from graph edges.

BuildWithSnap ( IGeometry geometry1, IGeometry geometry2, ICoordinate gridOrigin ) : PlanarGraph

Builds a planar graph of two geometries.

SetElementsEnabledState ( bool enabled ) : void

Sets enabled state to all graph nodes and edges.

Private Methods

Method Description
PlanarGraph ( ) : System

Initializes a new instance of MapAround.Geometry.PlanarGraph

addEdge ( PlanarGraphEdge edge ) : void
addEdges ( ) : void
addOrMergeNode ( ICoordinate coordinate, IGeometry obj ) : void
addSourceSegments ( IGeometry g, int objectNumber ) : void
addSplittedSegment ( SplittedSegment ss ) : void
addVerticesAsNodes ( IGeometry g ) : void
areEqualContours ( Contour c1, Contour c2 ) : bool
build ( ) : void
cutSelfTouch ( Contour contour, int i1, int i2, bool heterogenous ) : Contour
getAngle ( ICoordinate p1, ICoordinate p2, ICoordinate p3, bool counterClockwise ) : double

Gets an angle between p2p1 and p2p3 rays. Angle is measured from p2p1 ray.

getAngleBetweenEdges ( Segment &s1, Segment &s2, bool counterClockwise ) : double

Gets an angle between two segments that share an endpoint.

getContourSelfTouchIndicies ( Contour contour, int &i1, int &i2 ) : bool
getNodeAt ( ICoordinate &point ) : PlanarGraphNode
getRelatedSegments ( Segment segment ) : List
init ( ) : void
internalBuild ( IGeometry geometry1, IGeometry geometry2 ) : void
normalizeContour ( Contour contour, bool heterogenous ) : List
normalizeContours ( List contours ) : void
normalizeSourceSegment ( SourceSegment s ) : void
pointQuadrantNumber ( ICoordinate p ) : int
processContour ( PlanarGraphEdge startEdge, bool backward ) : Contour

Constructs a contour.

processContour ( int startNodeIndex, PlanarGraphNode layout, bool markObject1EdgesOrientation, bool markObject2EdgesOrientation ) : Contour

Constructs a contour.

processLinePath ( int startNodeIndex, bool markObject1EdgesOrientation, bool markObject2EdgesOrientation ) : LinePath
removeSplittedSegment ( SplittedSegment ss ) : void
splitContour ( Contour contour, List contours, List segments ) : void
splitSegmentByNodes ( SourceSegment segment ) : bool
splitSegmentBySegments ( List relatedSegments, SourceSegment currentSegment ) : bool
splitSegments ( ) : void
splitSegmentsByCrossPoints ( List segmentsToSplit, List segmentsCrossPoints, SourceSegment currentSegment ) : void
throwIfNotBuilt ( ) : void
translateAngleQuadrant ( double angle, int quadrantNumber ) : double
updateSplittedSegment ( List relatedSegments, SourceSegment segment ) : bool

Method Details

Build() public static method

Builds a planar graph of two geometries.
public static Build ( IGeometry geometry1, IGeometry geometry2 ) : PlanarGraph
geometry1 IGeometry First geometry
geometry2 IGeometry Second geometry
return PlanarGraph

BuildFaces() public method

Builds all faces.
public BuildFaces ( IList &redundantSegments ) : List
redundantSegments IList
return List

BuildPoints() public method

Builds a points from graph nodes.
public BuildPoints ( ) : List
return List

BuildPolygon() public method

Builds a polygon from graph edges.
public BuildPolygon ( bool markObject1EdgesOrientation, bool markObject2EdgesOrientation ) : Polygon
markObject1EdgesOrientation bool
markObject2EdgesOrientation bool
return Polygon

BuildPolyline() public method

Builds a polyline from graph edges.
public BuildPolyline ( bool markObject1EdgesOrientation, bool markObject2EdgesOrientation ) : Polyline
markObject1EdgesOrientation bool
markObject2EdgesOrientation bool
return Polyline

BuildWithSnap() public static method

Builds a planar graph of two geometries.
public static BuildWithSnap ( IGeometry geometry1, IGeometry geometry2, ICoordinate gridOrigin ) : PlanarGraph
geometry1 IGeometry First geometry
geometry2 IGeometry Second geometry
gridOrigin ICoordinate Snapping grid origin
return PlanarGraph

SetElementsEnabledState() public method

Sets enabled state to all graph nodes and edges.
public SetElementsEnabledState ( bool enabled ) : void
enabled bool Enabled state
return void